diff options
author | Justin Gluck <justin.gluck@livio.io> | 2019-09-17 10:30:03 -0400 |
---|---|---|
committer | Justin Gluck <justin.gluck@livio.io> | 2019-09-17 10:30:03 -0400 |
commit | bec18c5b27c59f84102a772211a3551ce6e3501c (patch) | |
tree | 928ea4d1f84f3d90f06e906cbf65c85fe814580c | |
parent | 897d491f24c15f1e36e8574d7d9b8364f2a0e7d9 (diff) | |
download | sdl_ios-bug/issue-1395-Missing-remote-control-availability.tar.gz |
adding missing remote control property to HMICapabilities, updated testsbug/issue-1395-Missing-remote-control-availability
-rw-r--r-- | SmartDeviceLink/SDLHMICapabilities.h | 7 | ||||
-rw-r--r-- | SmartDeviceLink/SDLHMICapabilities.m | 8 | ||||
-rw-r--r-- | SmartDeviceLink/SDLRPCParameterNames.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/SDLRPCParameterNames.m | 1 | ||||
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m | 17 |
5 files changed, 33 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLHMICapabilities.h b/SmartDeviceLink/SDLHMICapabilities.h index 43ee2b810..0f904ed66 100644 --- a/SmartDeviceLink/SDLHMICapabilities.h +++ b/SmartDeviceLink/SDLHMICapabilities.h @@ -29,6 +29,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, copy, nonatomic) NSNumber<SDLBool> *videoStreaming; +/** + Availability of built in remote control. True: Available, False: Not Available + + Boolean value. Optional. +**/ +@property (nullable, copy, nonatomic) NSNumber<SDLBool> *remoteControl; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLHMICapabilities.m b/SmartDeviceLink/SDLHMICapabilities.m index 353d90a27..5c0815bc4 100644 --- a/SmartDeviceLink/SDLHMICapabilities.m +++ b/SmartDeviceLink/SDLHMICapabilities.m @@ -35,6 +35,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.store sdl_objectForName:SDLRPCParameterNameVideoStreaming ofClass:NSNumber.class error:nil]; } +- (void)setRemoteControl:(nullable NSNumber<SDLBool> *)remoteControl { + [self.store sdl_setObject:remoteControl forName:SDLRPCParameterNameRemoteControl]; +} + +- (nullable NSNumber<SDLBool> *)remoteControl { + return [self.store sdl_objectForName:SDLRPCParameterNameRemoteControl ofClass:NSNumber.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h index cddaef941..27af54f6a 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.h +++ b/SmartDeviceLink/SDLRPCParameterNames.h @@ -506,6 +506,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameRect; extern SDLRPCParameterName const SDLRPCParameterNameRed; extern SDLRPCParameterName const SDLRPCParameterNameRegion; extern SDLRPCParameterName const SDLRPCParameterNameRegions; +extern SDLRPCParameterName const SDLRPCParameterNameRemoteControl; extern SDLRPCParameterName const SDLRPCParameterNameRemoteControlCapability; extern SDLRPCParameterName const SDLRPCParameterNameRequest; extern SDLRPCParameterName const SDLRPCParameterNameRequestServiceActive; diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m index 9da8f235e..f1eedf82e 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.m +++ b/SmartDeviceLink/SDLRPCParameterNames.m @@ -500,6 +500,7 @@ SDLRPCParameterName const SDLRPCParameterNameRed = @"red"; SDLRPCParameterName const SDLRPCParameterNameRect = @"rect"; SDLRPCParameterName const SDLRPCParameterNameRegion = @"REG"; SDLRPCParameterName const SDLRPCParameterNameRegions = @"regions"; +SDLRPCParameterName const SDLRPCParameterNameRemoteControl = @"remoteControl"; SDLRPCParameterName const SDLRPCParameterNameRemoteControlCapability = @"remoteControlCapability"; SDLRPCParameterName const SDLRPCParameterNameRequest = @"request"; SDLRPCParameterName const SDLRPCParameterNameRequestServiceActive = @"requestServiceActive"; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m index 9f64d4af8..cae7e6ab4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMICapabilitiesSpec.m @@ -17,6 +17,7 @@ describe(@"SDLHMICapabilities struct", ^{ __block NSNumber *somePhoneCallState = @NO; __block NSNumber *someNavigationState = @YES; __block NSNumber *someVideoStreamState = @NO; + __block NSNumber *someRemoteControlState = @YES; context(@"When initialized with properties", ^{ beforeEach(^{ @@ -24,6 +25,7 @@ describe(@"SDLHMICapabilities struct", ^{ testStruct.phoneCall = somePhoneCallState; testStruct.navigation = someNavigationState; testStruct.videoStreaming = someVideoStreamState; + testStruct.remoteControl = someRemoteControlState; }); it(@"should properly set phone call", ^{ @@ -37,6 +39,10 @@ describe(@"SDLHMICapabilities struct", ^{ it(@"should properly set video streaming", ^{ expect(testStruct.videoStreaming).to(equal(someVideoStreamState)); }); + + it(@"should properly set remote control", ^{ + expect(testStruct.remoteControl).to(equal(someRemoteControlState)); + }); }); context(@"When initialized with a dictionary", ^{ @@ -44,7 +50,8 @@ describe(@"SDLHMICapabilities struct", ^{ NSDictionary<NSString *, NSNumber *> *structInitDict = @{ SDLRPCParameterNameNavigation: someNavigationState, SDLRPCParameterNamePhoneCall: somePhoneCallState, - SDLRPCParameterNameVideoStreaming: someVideoStreamState + SDLRPCParameterNameVideoStreaming: someVideoStreamState, + SDLRPCParameterNameRemoteControl: someRemoteControlState }; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -63,6 +70,10 @@ describe(@"SDLHMICapabilities struct", ^{ it(@"should properly set video streaming", ^{ expect(testStruct.videoStreaming).to(equal(someVideoStreamState)); }); + + it(@"should properly set remote control", ^{ + expect(testStruct.remoteControl).to(equal(someRemoteControlState)); + }); }); context(@"When not initialized", ^{ @@ -81,6 +92,10 @@ describe(@"SDLHMICapabilities struct", ^{ it(@"video streaming should be nil", ^{ expect(testStruct.videoStreaming).to(beNil()); }); + + it(@"remote control should be nil", ^{ + expect(testStruct.remoteControl).to(beNil()); + }); }); }); |