From bec18c5b27c59f84102a772211a3551ce6e3501c Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Tue, 17 Sep 2019 10:30:03 -0400 Subject: [PATCH 1/2] adding missing remote control property to HMICapabilities, updated tests --- SmartDeviceLink/SDLHMICapabilities.h | 7 +++++++ SmartDeviceLink/SDLHMICapabilities.m | 8 ++++++++ SmartDeviceLink/SDLRPCParameterNames.h | 1 + SmartDeviceLink/SDLRPCParameterNames.m | 1 + .../StructSpecs/SDLHMICapabilitiesSpec.m | 17 ++++++++++++++++- 5 files changed, 33 insertions(+), 1 deletion(-) 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 *videoStreaming; +/** + Availability of built in remote control. True: Available, False: Not Available + + Boolean value. Optional. +**/ +@property (nullable, copy, nonatomic) NSNumber *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 @@ - (void)setVideoStreaming:(nullable NSNumber *)videoStreaming { return [self.store sdl_objectForName:SDLRPCParameterNameVideoStreaming ofClass:NSNumber.class error:nil]; } +- (void)setRemoteControl:(nullable NSNumber *)remoteControl { + [self.store sdl_setObject:remoteControl forName:SDLRPCParameterNameRemoteControl]; +} + +- (nullable NSNumber *)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 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 @@ __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 @@ testStruct.phoneCall = somePhoneCallState; testStruct.navigation = someNavigationState; testStruct.videoStreaming = someVideoStreamState; + testStruct.remoteControl = someRemoteControlState; }); it(@"should properly set phone call", ^{ @@ -37,6 +39,10 @@ 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 @@ NSDictionary *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 @@ 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 @@ it(@"video streaming should be nil", ^{ expect(testStruct.videoStreaming).to(beNil()); }); + + it(@"remote control should be nil", ^{ + expect(testStruct.remoteControl).to(beNil()); + }); }); }); From 60d39e4b3a9fe0876eb64d5bda4b4a1232a9075a Mon Sep 17 00:00:00 2001 From: Justin Gluck Date: Wed, 18 Sep 2019 12:58:04 -0400 Subject: [PATCH 2/2] PR issues adding since information --- SmartDeviceLink/SDLHMICapabilities.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/SmartDeviceLink/SDLHMICapabilities.h b/SmartDeviceLink/SDLHMICapabilities.h index 0f904ed66..14b278bda 100644 --- a/SmartDeviceLink/SDLHMICapabilities.h +++ b/SmartDeviceLink/SDLHMICapabilities.h @@ -6,12 +6,19 @@ NS_ASSUME_NONNULL_BEGIN +/** + Contains information about the HMI capabilities. + + Since SDL 3.0 +**/ @interface SDLHMICapabilities : SDLRPCStruct /** Availability of built in Nav. True: Available, False: Not Available Boolean value. Optional. + + Since SDL 3.0 */ @property (nullable, copy, nonatomic) NSNumber *navigation; @@ -19,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN Availability of built in phone. True: Available, False: Not Available Boolean value. Optional. + + Since SDL 3.0 */ @property (nullable, copy, nonatomic) NSNumber *phoneCall; @@ -26,6 +35,8 @@ NS_ASSUME_NONNULL_BEGIN Availability of built in video streaming. True: Available, False: Not Available Boolean value. Optional. + + Since SDL 4.5 */ @property (nullable, copy, nonatomic) NSNumber *videoStreaming; @@ -33,6 +44,8 @@ NS_ASSUME_NONNULL_BEGIN Availability of built in remote control. True: Available, False: Not Available Boolean value. Optional. + + Since SDL 4.5 **/ @property (nullable, copy, nonatomic) NSNumber *remoteControl;