From c38d5caefb8607dc710b0fff78ed9af85dfb0ac4 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Wed, 10 Jul 2019 04:07:36 -0700 Subject: [PATCH 01/35] Create SDLModuleInfo & SDLGrid Structs --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 16 +++++ .../SDLClimateControlCapabilities.h | 8 +++ SmartDeviceLink/SDLGrid.h | 56 +++++++++++++++ SmartDeviceLink/SDLGrid.m | 70 +++++++++++++++++++ SmartDeviceLink/SDLModuleInfo.h | 50 +++++++++++++ SmartDeviceLink/SDLModuleInfo.m | 52 ++++++++++++++ SmartDeviceLink/SDLRPCParameterNames.h | 9 +++ SmartDeviceLink/SDLRPCParameterNames.m | 9 +++ 8 files changed, 270 insertions(+) create mode 100644 SmartDeviceLink/SDLGrid.h create mode 100644 SmartDeviceLink/SDLGrid.m create mode 100644 SmartDeviceLink/SDLModuleInfo.h create mode 100644 SmartDeviceLink/SDLModuleInfo.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index df83d8900..a7647dd20 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -7,6 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + 0055412622D40DAB003194D3 /* SDLModuleInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412422D40DAB003194D3 /* SDLModuleInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0055412722D40DAB003194D3 /* SDLModuleInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412522D40DAB003194D3 /* SDLModuleInfo.m */; }; + 0055412A22D5DC0B003194D3 /* SDLGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412822D5DC0B003194D3 /* SDLGrid.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0055412B22D5DC0B003194D3 /* SDLGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412922D5DC0B003194D3 /* SDLGrid.m */; }; 162E82CA1A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */; }; 162E82CB1A9BDE8A00906325 /* SDLAppHMITypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */; }; 162E82CC1A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */; }; @@ -1631,6 +1635,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0055412422D40DAB003194D3 /* SDLModuleInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLModuleInfo.h; sourceTree = ""; }; + 0055412522D40DAB003194D3 /* SDLModuleInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLModuleInfo.m; sourceTree = ""; }; + 0055412822D5DC0B003194D3 /* SDLGrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGrid.h; sourceTree = ""; }; + 0055412922D5DC0B003194D3 /* SDLGrid.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGrid.m; sourceTree = ""; }; 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAmbientLightStatusSpec.m; sourceTree = ""; }; 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppHMITypeSpec.m; sourceTree = ""; }; 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppInterfaceUnregisteredReasonSpec.m; sourceTree = ""; }; @@ -4593,6 +4601,10 @@ 88D5EB36220CD95000EC3782 /* SDLWeatherServiceData.m */, 880D267B220DE5DF00B3F496 /* SDLWeatherServiceManifest.h */, 880D267C220DE5DF00B3F496 /* SDLWeatherServiceManifest.m */, + 0055412422D40DAB003194D3 /* SDLModuleInfo.h */, + 0055412522D40DAB003194D3 /* SDLModuleInfo.m */, + 0055412822D5DC0B003194D3 /* SDLGrid.h */, + 0055412922D5DC0B003194D3 /* SDLGrid.m */, ); name = Structs; sourceTree = ""; @@ -6348,6 +6360,7 @@ 5D61FD791A84238C00846EE7 /* SDLScreenParams.h in Headers */, 5D61FDCF1A84238C00846EE7 /* SDLTireStatus.h in Headers */, 5D61FDFD1A84238C00846EE7 /* SDLVehicleDataActiveStatus.h in Headers */, + 0055412622D40DAB003194D3 /* SDLModuleInfo.h in Headers */, 5D61FD811A84238C00846EE7 /* SDLSetAppIconResponse.h in Headers */, 5D61FC551A84238C00846EE7 /* SDLButtonName.h in Headers */, 5D616B531D59044400553F6B /* SDLErrorConstants.h in Headers */, @@ -6635,6 +6648,7 @@ 5DA102A41D4122C700C15826 /* NSMutableDictionary+SafeRemove.h in Headers */, 5DBF062A1E64A92C00A5CF03 /* SDLLogTarget.h in Headers */, 5DA49CE51F1EA83300E65FC5 /* SDLControlFramePayloadRPCStartService.h in Headers */, + 0055412A22D5DC0B003194D3 /* SDLGrid.h in Headers */, 5D61FE031A84238C00846EE7 /* SDLVehicleDataResult.h in Headers */, 5D61FD911A84238C00846EE7 /* SDLShowConstantTBT.h in Headers */, 5D92937C20B70A3E00FCC775 /* SDLPresentKeyboardOperation.h in Headers */, @@ -7155,6 +7169,7 @@ 5D61FDE21A84238C00846EE7 /* SDLTurn.m in Sources */, 5D61FC5A1A84238C00846EE7 /* SDLCarModeStatus.m in Sources */, 5D82041B1BCD80BA00D0A41B /* SDLLockScreenConfiguration.m in Sources */, + 0055412B22D5DC0B003194D3 /* SDLGrid.m in Sources */, 8815D0F122330781000F24E6 /* SDLRPCRequestNotification.m in Sources */, 5D3E48CC1D7722FE0000BFEF /* NSBundle+SDLBundle.m in Sources */, 5D61FCBC1A84238C00846EE7 /* SDLGPSData.m in Sources */, @@ -7425,6 +7440,7 @@ 5D60088B1BE3ED540094A505 /* SDLStateMachine.m in Sources */, 8877F5EF1F34A72200DC128A /* SDLSendHapticDataResponse.m in Sources */, 5D61FD181A84238C00846EE7 /* SDLOnPermissionsChange.m in Sources */, + 0055412722D40DAB003194D3 /* SDLModuleInfo.m in Sources */, 8881AFAD2225D61900EA870B /* SDLSetCloudAppProperties.m in Sources */, 1EB59CAC202D96A200343A61 /* SDLMassageCushion.m in Sources */, 5D61FD3E1A84238C00846EE7 /* SDLPrimaryAudioSource.m in Sources */, diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.h b/SmartDeviceLink/SDLClimateControlCapabilities.h index a8d4035da..46ac24622 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.h +++ b/SmartDeviceLink/SDLClimateControlCapabilities.h @@ -5,6 +5,7 @@ #import "SDLRPCMessage.h" #import "SDLDefrostZone.h" #import "SDLVentilationMode.h" +#import "SDLModuleInfo.h" NS_ASSUME_NONNULL_BEGIN @@ -156,6 +157,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) NSNumber *climateEnableAvailable; +/* + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) SDLModuleInfo *moduleInfo; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLGrid.h b/SmartDeviceLink/SDLGrid.h new file mode 100644 index 000000000..a89a44370 --- /dev/null +++ b/SmartDeviceLink/SDLGrid.h @@ -0,0 +1,56 @@ +// +// SDLGrid.h +// SmartDeviceLink +// +// Created by standa1 on 7/10/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLRPCMessage.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Describes a location (origin coordinates and span) of a vehicle component. + */ +@interface SDLGrid : SDLRPCStruct + +/** + * + * Required, Integer, -1 - 100 + */ +@property (strong, nonatomic) NSNumber *col; + +/** + * + * Required, Integer, -1 - 100 + */ +@property (strong, nonatomic) NSNumber *row; + +/** + * + * Optional, Integer, -1 - 100 + */ +@property (strong, nonatomic) NSNumber *level; + +/** + * + * Optional, Integer, 1 - 100 + */ +@property (strong, nonatomic) NSNumber *colspan; + +/** + * + * Optional, Integer, 1 - 100 + */ +@property (strong, nonatomic) NSNumber *rowspan; + +/** + * + * Optional, Integer, 1 - 100 + */ +@property (strong, nonatomic) NSNumber *levelspan; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLGrid.m b/SmartDeviceLink/SDLGrid.m new file mode 100644 index 000000000..b146ebaa6 --- /dev/null +++ b/SmartDeviceLink/SDLGrid.m @@ -0,0 +1,70 @@ +// +// SDLGrid.m +// SmartDeviceLink +// +// Created by standa1 on 7/10/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLGrid.h" + +#import "NSMutableDictionary+Store.h" +#import "SDLRPCParameterNames.h" + +@implementation SDLGrid + +- (void)setCol:(NSNumber *)col { + [self.store sdl_setObject:col forName:SDLRPCParameterNameCol]; +} + +- (NSNumber *)col { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameCol ofClass:NSNumber.class error:&error]; +} + +- (void)setRow:(NSNumber *)row { + [self.store sdl_setObject:row forName:SDLRPCParameterNameRow]; +} + +- (NSNumber *)row { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameRow ofClass:NSNumber.class error:&error]; +} + +- (void)setLevel:(NSNumber *)level { + [self.store sdl_setObject:level forName:SDLRPCParameterNameLevel]; +} + +- (NSNumber *)level { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameLevel ofClass:NSNumber.class error:&error]; +} + +- (void)setColspan:(NSNumber *)colspan { + [self.store sdl_setObject:colspan forName:SDLRPCParameterNameColSpan]; +} + +- (NSNumber *)colspan { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameColSpan ofClass:NSNumber.class error:&error]; +} + +- (void)setRowspan:(NSNumber *)rowspan { + [self.store sdl_setObject:rowspan forName:SDLRPCParameterNameRowSpan]; +} + +- (NSNumber *)rowspan { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameRowSpan ofClass:NSNumber.class error:&error]; +} + +- (void)setLevelspan:(NSNumber *)levelspan { + [self.store sdl_setObject:levelspan forName:SDLRPCParameterNameLevelSpan]; +} + +- (NSNumber *)levelspan { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameLevelSpan ofClass:NSNumber.class error:&error]; +} + +@end diff --git a/SmartDeviceLink/SDLModuleInfo.h b/SmartDeviceLink/SDLModuleInfo.h new file mode 100644 index 000000000..347624f4d --- /dev/null +++ b/SmartDeviceLink/SDLModuleInfo.h @@ -0,0 +1,50 @@ +// +// SDLModuleInfo.h +// SmartDeviceLink +// +// Created by standa1 on 7/8/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLRPCMessage.h" +#import "SDLGrid.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Contains information about a RC module. + */ +@interface SDLModuleInfo : SDLRPCStruct + +/** + * UUID of a module. "moduleId + moduleType" uniquely identify a module. + * + * Max string length 100 chars + + Required + */ +@property (strong, nonatomic) NSString *moduleId; + +/** + * Location of a module. + * Optional + */ +@property (strong, nonatomic) SDLGrid *location; + +/** + * Service area of a module. + * Optional + */ +@property (strong, nonatomic) SDLGrid *serviceArea; + +/** + * Allow multiple users/apps to access the module or not + * + * Optional, Boolean + */ +@property (nullable, strong, nonatomic) NSNumber *allowMultipleAccess; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLModuleInfo.m b/SmartDeviceLink/SDLModuleInfo.m new file mode 100644 index 000000000..7a566cfcc --- /dev/null +++ b/SmartDeviceLink/SDLModuleInfo.m @@ -0,0 +1,52 @@ +// +// SDLModuleInfo.m +// SmartDeviceLink +// +// Created by standa1 on 7/8/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLModuleInfo.h" + +#import "NSMutableDictionary+Store.h" +#import "SDLRPCParameterNames.h" + +@implementation SDLModuleInfo + +- (void)setModuleId:(NSString *)moduleId { + [self.store sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; +} + +- (NSString *)moduleId { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; +} + +- (void)setLocation:(SDLGrid *)location { + [self.store sdl_setObject:location forName:SDLRPCParameterNameLocation]; +} + +- (SDLGrid *)location { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameLocation ofClass:SDLGrid.class error:&error]; +} + +- (void)setServiceArea:(SDLGrid *)serviceArea { + [self.store sdl_setObject:serviceArea forName:SDLRPCParameterNameServiceArea]; +} + +- (SDLGrid *)serviceArea { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameServiceArea ofClass:SDLGrid.class error:&error]; +} + +- (void)setAllowMultipleAccess:(NSNumber *)allowMultipleAccess { + [self.store sdl_setObject:allowMultipleAccess forName:SDLRPCParameterNameAllowMultipleAccess]; +} + +- (NSNumber *)allowMultipleAccess { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameAllowMultipleAccess ofClass:NSNumber.class error:&error]; +} + +@end diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h index fc0f17ddf..2665123e7 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.h +++ b/SmartDeviceLink/SDLRPCParameterNames.h @@ -28,6 +28,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameAlignment; extern SDLRPCParameterName const SDLRPCParameterNameAllocatedModules; extern SDLRPCParameterName const SDLRPCParameterNameAllowAppConsumers; extern SDLRPCParameterName const SDLRPCParameterNameAllowed; +extern SDLRPCParameterName const SDLRPCParameterNameAllowMultipleAccess; extern SDLRPCParameterName const SDLRPCParameterNameAltitude; extern SDLRPCParameterName const SDLRPCParameterNameAltitudeMeters; extern SDLRPCParameterName const SDLRPCParameterNameAmbientLightSensorStatus; @@ -104,6 +105,8 @@ extern SDLRPCParameterName const SDLRPCParameterNameClimateControlCapabilities; extern SDLRPCParameterName const SDLRPCParameterNameCloudCover; extern SDLRPCParameterName const SDLRPCParameterNameClusterModes; extern SDLRPCParameterName const SDLRPCParameterNameClusterModeStatus; +extern SDLRPCParameterName const SDLRPCParameterNameCol; +extern SDLRPCParameterName const SDLRPCParameterNameColSpan; extern SDLRPCParameterName const SDLRPCParameterNameCommandIcon; extern SDLRPCParameterName const SDLRPCParameterNameCommandId; extern SDLRPCParameterName const SDLRPCParameterNameCompassDirection; @@ -304,6 +307,8 @@ extern SDLRPCParameterName const SDLRPCParameterNameLeftRearInflatableBelted; extern SDLRPCParameterName const SDLRPCParameterNameLeftRow2BuckleBelted; extern SDLRPCParameterName const SDLRPCParameterNameLeftRow3BuckleBelted; extern SDLRPCParameterName const SDLRPCParameterNameLength; +extern SDLRPCParameterName const SDLRPCParameterNameLevel; +extern SDLRPCParameterName const SDLRPCParameterNameLevelSpan; extern SDLRPCParameterName const SDLRPCParameterNameLightControlCapabilities; extern SDLRPCParameterName const SDLRPCParameterNameLightControlData; extern SDLRPCParameterName const SDLRPCParameterNameLightState; @@ -376,6 +381,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameMinuteForecast; extern SDLRPCParameterName const SDLRPCParameterNameMinutes; extern SDLRPCParameterName const SDLRPCParameterNameModel; extern SDLRPCParameterName const SDLRPCParameterNameModuleData; +extern SDLRPCParameterName const SDLRPCParameterNameModuleId; extern SDLRPCParameterName const SDLRPCParameterNameModuleName; extern SDLRPCParameterName const SDLRPCParameterNameModuleType; extern SDLRPCParameterName const SDLRPCParameterNameModelYear; @@ -502,7 +508,9 @@ extern SDLRPCParameterName const SDLRPCParameterNameRightRearInflatableBelted; extern SDLRPCParameterName const SDLRPCParameterNameRightRow2BuckleBelted; extern SDLRPCParameterName const SDLRPCParameterNameRightRow3BuckleBelted; extern SDLRPCParameterName const SDLRPCParameterNameRolloverEvent; +extern SDLRPCParameterName const SDLRPCParameterNameRow; extern SDLRPCParameterName const SDLRPCParameterNameRows; +extern SDLRPCParameterName const SDLRPCParameterNameRowSpan; extern SDLRPCParameterName const SDLRPCParameterNameRPCName; extern SDLRPCParameterName const SDLRPCParameterNameRPCSpecVersion; extern SDLRPCParameterName const SDLRPCParameterNameRPM; @@ -523,6 +531,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameSecond; extern SDLRPCParameterName const SDLRPCParameterNameSeconds; extern SDLRPCParameterName const SDLRPCParameterNameSendLocationEnabled; extern SDLRPCParameterName const SDLRPCParameterNameServiceActive; +extern SDLRPCParameterName const SDLRPCParameterNameServiceArea; extern SDLRPCParameterName const SDLRPCParameterNameServiceData; extern SDLRPCParameterName const SDLRPCParameterNameServiceIcon; extern SDLRPCParameterName const SDLRPCParameterNameServiceID; diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m index 30236acb4..f37523a41 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.m +++ b/SmartDeviceLink/SDLRPCParameterNames.m @@ -25,6 +25,7 @@ SDLRPCParameterName const SDLRPCParameterNameAlignment = @"alignment"; SDLRPCParameterName const SDLRPCParameterNameAllowAppConsumers = @"allowAppConsumers"; SDLRPCParameterName const SDLRPCParameterNameAllowed = @"allowed"; +SDLRPCParameterName const SDLRPCParameterNameAllowMultipleAccess = @"allowMultipleAccess"; SDLRPCParameterName const SDLRPCParameterNameAllocatedModules = @"allocatedModules"; SDLRPCParameterName const SDLRPCParameterNameAltitude = @"altitude"; SDLRPCParameterName const SDLRPCParameterNameAltitudeMeters = @"altitudeMeters"; @@ -102,6 +103,8 @@ SDLRPCParameterName const SDLRPCParameterNameClusterModes = @"clusterModes"; SDLRPCParameterName const SDLRPCParameterNameClusterModeStatus = @"clusterModeStatus"; SDLRPCParameterName const SDLRPCParameterNameColor = @"color"; +SDLRPCParameterName const SDLRPCParameterNameCol = @"col"; +SDLRPCParameterName const SDLRPCParameterNameColSpan = @"colspan"; SDLRPCParameterName const SDLRPCParameterNameCommandIcon = @"cmdIcon"; SDLRPCParameterName const SDLRPCParameterNameCommandId = @"cmdID"; SDLRPCParameterName const SDLRPCParameterNameCompassDirection = @"compassDirection"; @@ -302,6 +305,8 @@ SDLRPCParameterName const SDLRPCParameterNameLeftRow2BuckleBelted = @"leftRow2BuckleBelted"; SDLRPCParameterName const SDLRPCParameterNameLeftRow3BuckleBelted = @"leftRow3BuckleBelted"; SDLRPCParameterName const SDLRPCParameterNameLength = @"length"; +SDLRPCParameterName const SDLRPCParameterNameLevel = @"level"; +SDLRPCParameterName const SDLRPCParameterNameLevelSpan = @"levelspan"; SDLRPCParameterName const SDLRPCParameterNameLightControlCapabilities = @"lightControlCapabilities"; SDLRPCParameterName const SDLRPCParameterNameLightControlData = @"lightControlData"; SDLRPCParameterName const SDLRPCParameterNameLightState = @"lightState"; @@ -370,6 +375,7 @@ SDLRPCParameterName const SDLRPCParameterNameMinutes = @"minutes"; SDLRPCParameterName const SDLRPCParameterNameModel = @"model"; SDLRPCParameterName const SDLRPCParameterNameModuleData = @"moduleData"; +SDLRPCParameterName const SDLRPCParameterNameModuleId = @"moduleId"; SDLRPCParameterName const SDLRPCParameterNameModuleName = @"moduleName"; SDLRPCParameterName const SDLRPCParameterNameModuleType = @"moduleType"; SDLRPCParameterName const SDLRPCParameterNameModelYear = @"modelYear"; @@ -497,7 +503,9 @@ SDLRPCParameterName const SDLRPCParameterNameRightRow2BuckleBelted = @"rightRow2BuckleBelted"; SDLRPCParameterName const SDLRPCParameterNameRightRow3BuckleBelted = @"rightRow3BuckleBelted"; SDLRPCParameterName const SDLRPCParameterNameRolloverEvent = @"rolloverEvent"; +SDLRPCParameterName const SDLRPCParameterNameRow = @"row"; SDLRPCParameterName const SDLRPCParameterNameRows = @"rows"; +SDLRPCParameterName const SDLRPCParameterNameRowSpan = @"rowspan"; SDLRPCParameterName const SDLRPCParameterNameRPCName = @"rpcName"; SDLRPCParameterName const SDLRPCParameterNameRPCSpecVersion = @"rpcSpecVersion"; SDLRPCParameterName const SDLRPCParameterNameRPM = @"rpm"; @@ -517,6 +525,7 @@ SDLRPCParameterName const SDLRPCParameterNameSeconds = @"seconds"; SDLRPCParameterName const SDLRPCParameterNameSendLocationEnabled = @"sendLocationEnabled"; SDLRPCParameterName const SDLRPCParameterNameServiceActive = @"serviceActive"; +SDLRPCParameterName const SDLRPCParameterNameServiceArea = @"serviceArea"; SDLRPCParameterName const SDLRPCParameterNameServiceData = @"serviceData"; SDLRPCParameterName const SDLRPCParameterNameServiceIcon = @"serviceIcon"; SDLRPCParameterName const SDLRPCParameterNameServiceID = @"serviceID"; From 0a09991073fe7d87155ab15d94f9142015d5af69 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 11 Jul 2019 03:18:52 -0700 Subject: [PATCH 02/35] Add Module Info to Capabilities Deprecate SupportedSeat & SDLSupportedSeat Id --- SmartDeviceLink/SDLAudioControlCapabilities.h | 8 ++++++++ SmartDeviceLink/SDLAudioControlCapabilities.m | 8 ++++++++ SmartDeviceLink/SDLButtonCapabilities.h | 8 ++++++++ SmartDeviceLink/SDLButtonCapabilities.m | 8 ++++++++ SmartDeviceLink/SDLClimateControlCapabilities.m | 7 +++++++ SmartDeviceLink/SDLHMISettingsControlCapabilities.h | 8 ++++++++ SmartDeviceLink/SDLHMISettingsControlCapabilities.m | 8 ++++++++ SmartDeviceLink/SDLLightControlCapabilities.h | 7 +++++++ SmartDeviceLink/SDLLightControlCapabilities.m | 7 +++++++ SmartDeviceLink/SDLModuleData.h | 7 +++++++ SmartDeviceLink/SDLModuleData.m | 9 +++++++++ SmartDeviceLink/SDLRPCParameterNames.h | 1 + SmartDeviceLink/SDLRPCParameterNames.m | 1 + SmartDeviceLink/SDLRadioControlCapabilities.h | 8 ++++++++ SmartDeviceLink/SDLRadioControlCapabilities.m | 8 ++++++++ SmartDeviceLink/SDLSeatControlCapabilities.h | 7 +++++++ SmartDeviceLink/SDLSeatControlCapabilities.m | 8 ++++++++ SmartDeviceLink/SDLSeatControlData.h | 1 + SmartDeviceLink/SDLSupportedSeat.h | 2 +- 19 files changed, 120 insertions(+), 1 deletion(-) diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.h b/SmartDeviceLink/SDLAudioControlCapabilities.h index b7f29a01c..7e2033f00 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.h +++ b/SmartDeviceLink/SDLAudioControlCapabilities.h @@ -2,6 +2,7 @@ // #import "SDLRPCMessage.h" +#import "SDLModuleInfo.h" NS_ASSUME_NONNULL_BEGIN @@ -71,6 +72,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) NSNumber *equalizerMaxChannelId; +/** + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) SDLModuleInfo *moduleInfo; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.m b/SmartDeviceLink/SDLAudioControlCapabilities.m index ad204cc62..84a97059c 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.m +++ b/SmartDeviceLink/SDLAudioControlCapabilities.m @@ -83,6 +83,14 @@ - (void)setEqualizerMaxChannelId:(nullable NSNumber *)equalizerMaxChanne return [self.store sdl_objectForName:SDLRPCParameterNameEqualizerMaxChannelId ofClass:NSNumber.class error:nil]; } +- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { + [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; +} + +- (SDLModuleInfo *)moduleInfo { + return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLButtonCapabilities.h b/SmartDeviceLink/SDLButtonCapabilities.h index 35600f5b2..6d97df0c8 100644 --- a/SmartDeviceLink/SDLButtonCapabilities.h +++ b/SmartDeviceLink/SDLButtonCapabilities.h @@ -4,6 +4,7 @@ #import "SDLRPCMessage.h" #import "SDLButtonName.h" +#import "SDLModuleInfo.h" /** @@ -44,6 +45,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) NSNumber *upDownAvailable; +/** + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) SDLModuleInfo *moduleInfo; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLButtonCapabilities.m b/SmartDeviceLink/SDLButtonCapabilities.m index 12cd24847..dd0d13ea1 100644 --- a/SmartDeviceLink/SDLButtonCapabilities.m +++ b/SmartDeviceLink/SDLButtonCapabilities.m @@ -46,6 +46,14 @@ - (void)setUpDownAvailable:(NSNumber *)upDownAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameUpDownAvailable ofClass:NSNumber.class error:&error]; } +- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { + [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; +} + +- (SDLModuleInfo *)moduleInfo { + return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.m b/SmartDeviceLink/SDLClimateControlCapabilities.m index 199795974..05c83b32c 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.m +++ b/SmartDeviceLink/SDLClimateControlCapabilities.m @@ -177,6 +177,13 @@ - (void)setClimateEnableAvailable:(nullable NSNumber *)climateEnableAva - (nullable NSNumber *)climateEnableAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameClimateEnableAvailable ofClass:NSNumber.class error:nil]; + +- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { + [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; +} + +- (SDLModuleInfo *)moduleInfo { + return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; } @end diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h index da7d04310..a4c6ce8b2 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h @@ -2,6 +2,7 @@ // #import "SDLRPCMessage.h" +#import "SDLModuleInfo.h" NS_ASSUME_NONNULL_BEGIN @@ -57,6 +58,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) NSNumber *displayModeUnitAvailable; +/** + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) SDLModuleInfo *moduleInfo; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m index 82eff7c81..e44ef104d 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m @@ -66,6 +66,14 @@ - (void)setDisplayModeUnitAvailable:(nullable NSNumber *)displayModeUni return [self.store sdl_objectForName:SDLRPCParameterNameDisplayModeUnitAvailable ofClass:NSNumber.class error:nil]; } +- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { + [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; +} + +- (SDLModuleInfo *)moduleInfo { + return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLLightControlCapabilities.h b/SmartDeviceLink/SDLLightControlCapabilities.h index 26e675cea..72db659fe 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.h +++ b/SmartDeviceLink/SDLLightControlCapabilities.h @@ -2,6 +2,7 @@ // #import "SDLRPCMessage.h" +#import "SDLModuleInfo.h" @class SDLLightCapabilities; @@ -34,6 +35,12 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) NSArray *supportedLights; +/** + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLLightControlCapabilities.m b/SmartDeviceLink/SDLLightControlCapabilities.m index 88c38e437..ec55c81c2 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.m +++ b/SmartDeviceLink/SDLLightControlCapabilities.m @@ -41,6 +41,13 @@ - (void)setSupportedLights:(NSArray *)supportedLights { return [self.store sdl_objectsForName:SDLRPCParameterNameSupportedLights ofClass:SDLLightCapabilities.class error:&error]; } +- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { + [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; +} + +- (SDLModuleInfo *)moduleInfo { + return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; +} @end diff --git a/SmartDeviceLink/SDLModuleData.h b/SmartDeviceLink/SDLModuleData.h index cd652804c..208750e7a 100644 --- a/SmartDeviceLink/SDLModuleData.h +++ b/SmartDeviceLink/SDLModuleData.h @@ -77,6 +77,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) SDLModuleType moduleType; +/** + Id of a module, published by System Capability. + + Optional + */ +@property (strong, nonatomic) NSString *moduleId; + /** The radio control data diff --git a/SmartDeviceLink/SDLModuleData.m b/SmartDeviceLink/SDLModuleData.m index 09ae37864..c196be9c4 100644 --- a/SmartDeviceLink/SDLModuleData.m +++ b/SmartDeviceLink/SDLModuleData.m @@ -97,6 +97,15 @@ - (SDLModuleType)moduleType { return [self.store sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; } +- (void)setModuleId:(NSString *)moduleId { + [self.store sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; +} + +- (NSString *)moduleId { + NSError *error = nil; + return [self.store sdl_enumForName:SDLRPCParameterNameModuleId error:&error]; +} + - (void)setRadioControlData:(nullable SDLRadioControlData *)radioControlData { [self.store sdl_setObject:radioControlData forName:SDLRPCParameterNameRadioControlData]; } diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h index 2665123e7..caf07e023 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.h +++ b/SmartDeviceLink/SDLRPCParameterNames.h @@ -382,6 +382,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameMinutes; extern SDLRPCParameterName const SDLRPCParameterNameModel; extern SDLRPCParameterName const SDLRPCParameterNameModuleData; extern SDLRPCParameterName const SDLRPCParameterNameModuleId; +extern SDLRPCParameterName const SDLRPCParameterNameModuleInfo; extern SDLRPCParameterName const SDLRPCParameterNameModuleName; extern SDLRPCParameterName const SDLRPCParameterNameModuleType; extern SDLRPCParameterName const SDLRPCParameterNameModelYear; diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m index f37523a41..86006cd18 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.m +++ b/SmartDeviceLink/SDLRPCParameterNames.m @@ -376,6 +376,7 @@ SDLRPCParameterName const SDLRPCParameterNameModel = @"model"; SDLRPCParameterName const SDLRPCParameterNameModuleData = @"moduleData"; SDLRPCParameterName const SDLRPCParameterNameModuleId = @"moduleId"; +SDLRPCParameterName const SDLRPCParameterNameModuleInfo = @"moduleInfo"; SDLRPCParameterName const SDLRPCParameterNameModuleName = @"moduleName"; SDLRPCParameterName const SDLRPCParameterNameModuleType = @"moduleType"; SDLRPCParameterName const SDLRPCParameterNameModelYear = @"modelYear"; diff --git a/SmartDeviceLink/SDLRadioControlCapabilities.h b/SmartDeviceLink/SDLRadioControlCapabilities.h index 2552e406f..e9ea63bb0 100644 --- a/SmartDeviceLink/SDLRadioControlCapabilities.h +++ b/SmartDeviceLink/SDLRadioControlCapabilities.h @@ -3,6 +3,7 @@ // #import "SDLRPCMessage.h" +#import "SDLModuleInfo.h" NS_ASSUME_NONNULL_BEGIN @@ -191,6 +192,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) NSNumber *sisDataAvailable; +/** + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) SDLModuleInfo *moduleInfo; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLRadioControlCapabilities.m b/SmartDeviceLink/SDLRadioControlCapabilities.m index 7846ff267..a9340bf8c 100644 --- a/SmartDeviceLink/SDLRadioControlCapabilities.m +++ b/SmartDeviceLink/SDLRadioControlCapabilities.m @@ -173,6 +173,14 @@ - (void)setSisDataAvailable:(nullable NSNumber *)sisDataAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameSISDataAvailable ofClass:NSNumber.class error:nil]; } +- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { + [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; +} + +- (SDLModuleInfo *)moduleInfo { + return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.h b/SmartDeviceLink/SDLSeatControlCapabilities.h index de166d34d..1e472ec76 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.h +++ b/SmartDeviceLink/SDLSeatControlCapabilities.h @@ -3,6 +3,7 @@ #import "SDLRPCStruct.h" +#import "SDLModuleInfo.h" NS_ASSUME_NONNULL_BEGIN @@ -128,6 +129,12 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) NSNumber *memoryAvailable; +/** + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.m b/SmartDeviceLink/SDLSeatControlCapabilities.m index 7aa4c2b5d..ac0deac4c 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.m +++ b/SmartDeviceLink/SDLSeatControlCapabilities.m @@ -199,6 +199,14 @@ - (void)setMemoryAvailable:(nullable NSNumber *)memoryAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameMemoryAvailable ofClass:NSNumber.class error:nil]; } +- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { + [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; +} + +- (SDLModuleInfo *)moduleInfo { + return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSeatControlData.h b/SmartDeviceLink/SDLSeatControlData.h index e08492d28..3e3e9d905 100644 --- a/SmartDeviceLink/SDLSeatControlData.h +++ b/SmartDeviceLink/SDLSeatControlData.h @@ -50,6 +50,7 @@ NS_ASSUME_NONNULL_BEGIN /** * @abstract id of seat that is a remote controllable seat. + * @warning This should not be used to identify a seat, this is a deprecated parameter. * * Required */ diff --git a/SmartDeviceLink/SDLSupportedSeat.h b/SmartDeviceLink/SDLSupportedSeat.h index 7c7df2f9d..76330a961 100644 --- a/SmartDeviceLink/SDLSupportedSeat.h +++ b/SmartDeviceLink/SDLSupportedSeat.h @@ -5,7 +5,7 @@ /** * List possible seats that is a remote controllable seat. - * + * @warning This should not be used to supported seats, this is a deprecated parameter. */ typedef SDLEnum SDLSupportedSeat SDL_SWIFT_ENUM; From a2b7b1c66011ebf92d0460cc48901c90509519a4 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 11 Jul 2019 05:15:26 -0700 Subject: [PATCH 03/35] Create SeatLocation, SeatLocationCapability Parse moduleId params --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 16 ++++++ SmartDeviceLink/SDLButtonPress.h | 7 +++ SmartDeviceLink/SDLButtonPress.m | 9 ++++ SmartDeviceLink/SDLGetInteriorVehicleData.h | 13 ++++- SmartDeviceLink/SDLGetInteriorVehicleData.m | 9 ++++ SmartDeviceLink/SDLRPCParameterNames.h | 8 ++- SmartDeviceLink/SDLRPCParameterNames.m | 4 ++ SmartDeviceLink/SDLSeatLocation.h | 26 ++++++++++ SmartDeviceLink/SDLSeatLocation.m | 25 +++++++++ SmartDeviceLink/SDLSeatLocationCapability.h | 46 ++++++++++++++++ SmartDeviceLink/SDLSeatLocationCapability.m | 52 +++++++++++++++++++ SmartDeviceLink/SDLSystemCapabilityType.h | 5 ++ SmartDeviceLink/SDLSystemCapabilityType.m | 1 + 13 files changed, 217 insertions(+), 4 deletions(-) create mode 100644 SmartDeviceLink/SDLSeatLocation.h create mode 100644 SmartDeviceLink/SDLSeatLocation.m create mode 100644 SmartDeviceLink/SDLSeatLocationCapability.h create mode 100644 SmartDeviceLink/SDLSeatLocationCapability.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index a7647dd20..f98c4f1b5 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -11,6 +11,10 @@ 0055412722D40DAB003194D3 /* SDLModuleInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412522D40DAB003194D3 /* SDLModuleInfo.m */; }; 0055412A22D5DC0B003194D3 /* SDLGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412822D5DC0B003194D3 /* SDLGrid.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0055412B22D5DC0B003194D3 /* SDLGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412922D5DC0B003194D3 /* SDLGrid.m */; }; + 0055412E22D759BD003194D3 /* SDLSeatLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412C22D759BC003194D3 /* SDLSeatLocation.h */; }; + 0055412F22D759BD003194D3 /* SDLSeatLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412D22D759BC003194D3 /* SDLSeatLocation.m */; }; + 0055413222D75A7B003194D3 /* SDLSeatLocationCapability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055413022D75A7A003194D3 /* SDLSeatLocationCapability.h */; }; + 0055413322D75A7B003194D3 /* SDLSeatLocationCapability.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055413122D75A7B003194D3 /* SDLSeatLocationCapability.m */; }; 162E82CA1A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */; }; 162E82CB1A9BDE8A00906325 /* SDLAppHMITypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */; }; 162E82CC1A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */; }; @@ -1639,6 +1643,10 @@ 0055412522D40DAB003194D3 /* SDLModuleInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLModuleInfo.m; sourceTree = ""; }; 0055412822D5DC0B003194D3 /* SDLGrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGrid.h; sourceTree = ""; }; 0055412922D5DC0B003194D3 /* SDLGrid.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGrid.m; sourceTree = ""; }; + 0055412C22D759BC003194D3 /* SDLSeatLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLSeatLocation.h; sourceTree = ""; }; + 0055412D22D759BC003194D3 /* SDLSeatLocation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocation.m; sourceTree = ""; }; + 0055413022D75A7A003194D3 /* SDLSeatLocationCapability.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLSeatLocationCapability.h; sourceTree = ""; }; + 0055413122D75A7B003194D3 /* SDLSeatLocationCapability.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationCapability.m; sourceTree = ""; }; 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAmbientLightStatusSpec.m; sourceTree = ""; }; 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppHMITypeSpec.m; sourceTree = ""; }; 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppInterfaceUnregisteredReasonSpec.m; sourceTree = ""; }; @@ -4605,6 +4613,10 @@ 0055412522D40DAB003194D3 /* SDLModuleInfo.m */, 0055412822D5DC0B003194D3 /* SDLGrid.h */, 0055412922D5DC0B003194D3 /* SDLGrid.m */, + 0055412C22D759BC003194D3 /* SDLSeatLocation.h */, + 0055412D22D759BC003194D3 /* SDLSeatLocation.m */, + 0055413022D75A7A003194D3 /* SDLSeatLocationCapability.h */, + 0055413122D75A7B003194D3 /* SDLSeatLocationCapability.m */, ); name = Structs; sourceTree = ""; @@ -6252,6 +6264,7 @@ 1EB59CAF202D97AC00343A61 /* SDLMassageCushionFirmness.h in Headers */, 1EAA470B2032BAE5000FE74B /* SDLOnRCStatus.h in Headers */, 2BF2F84F20ED004000A26EF2 /* SDLAudioStreamingIndicator.h in Headers */, + 0055412E22D759BD003194D3 /* SDLSeatLocation.h in Headers */, 1EAA475120356CD2000FE74B /* SDLDistanceUnit.h in Headers */, 1EAA4755203583BC000FE74B /* SDLHMISettingsControlData.h in Headers */, 1EAA4731203442C0000FE74B /* SDLLightName.h in Headers */, @@ -6404,6 +6417,7 @@ 5D61FC451A84238C00846EE7 /* SDLAudioPassThruCapabilities.h in Headers */, 5D61FDC71A84238C00846EE7 /* SDLTextAlignment.h in Headers */, 5D61FD051A84238C00846EE7 /* SDLOnButtonPress.h in Headers */, + 0055413222D75A7B003194D3 /* SDLSeatLocationCapability.h in Headers */, 5DA150C72271FDC20032928D /* SDLSoftButtonTransitionOperation.h in Headers */, 5D61FCC51A84238C00846EE7 /* SDLHMIZoneCapabilities.h in Headers */, 884AF94F220B488900E22928 /* SDLOnSystemCapabilityUpdated.h in Headers */, @@ -7338,6 +7352,7 @@ 5D61FDDE1A84238C00846EE7 /* SDLTTSChunk.m in Sources */, 5D61FD9E1A84238C00846EE7 /* SDLSliderResponse.m in Sources */, 1EAA47462035623B000FE74B /* SDLLightControlData.m in Sources */, + 0055412F22D759BD003194D3 /* SDLSeatLocation.m in Sources */, 5D61FC5C1A84238C00846EE7 /* SDLChangeRegistration.m in Sources */, 5D1665C91CF8CA3D00CC4CA1 /* SDLPermissionFilter.m in Sources */, 5D61FDBA1A84238C00846EE7 /* SDLSyncPDataResponse.m in Sources */, @@ -7415,6 +7430,7 @@ E9C32B9F1AB20C5900F283AF /* EAAccessoryManager+SDLProtocols.m in Sources */, 756C62772289F11F008B57A2 /* SDLDynamicMenuUpdateRunScore.m in Sources */, 5D61FDA81A84238C00846EE7 /* SDLSpeakResponse.m in Sources */, + 0055413322D75A7B003194D3 /* SDLSeatLocationCapability.m in Sources */, 5DB92D331AC9C8BA00C15BB0 /* SDLRPCStruct.m in Sources */, 1EAA474220355FF3000FE74B /* SDLLightControlCapabilities.m in Sources */, 8B7B31A31F2F7FEA00BDC38D /* SDLVideoStreamingFormat.m in Sources */, diff --git a/SmartDeviceLink/SDLButtonPress.h b/SmartDeviceLink/SDLButtonPress.h index b019b4edd..14b9a1a62 100644 --- a/SmartDeviceLink/SDLButtonPress.h +++ b/SmartDeviceLink/SDLButtonPress.h @@ -23,6 +23,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic) SDLModuleType moduleType; +/** + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) NSString *moduleId; + /** * The name of supported RC climate or radio button. * diff --git a/SmartDeviceLink/SDLButtonPress.m b/SmartDeviceLink/SDLButtonPress.m index f79152830..8311eb235 100644 --- a/SmartDeviceLink/SDLButtonPress.m +++ b/SmartDeviceLink/SDLButtonPress.m @@ -59,5 +59,14 @@ - (SDLButtonPressMode)buttonPressMode { return [self.parameters sdl_enumForName:SDLRPCParameterNameButtonPressMode error:&error]; } +- (void)setModuleId:(NSString *)moduleId { + [self.store sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; +} + +- (NSString *)moduleId { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.h b/SmartDeviceLink/SDLGetInteriorVehicleData.h index 01d208f71..567327667 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.h +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.h @@ -4,6 +4,7 @@ #import "SDLRPCRequest.h" #import "SDLModuleType.h" +#import "SDLModuleInfo.h" /** * Reads the current status value of specified remote control module (type). @@ -30,8 +31,16 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic) SDLModuleType moduleType; /** - * If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType. - * If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType. + * Information about a RC module, including its id. + * + * SDLModuleInfo + */ +@property (strong, nonatomic) NSString *moduleId; + +/** + * If subscribe is true, the head unit will register OnInteriorVehicleData notifications for the requested module (moduleId and moduleType). + * If subscribe is false, the head unit will unregister OnInteriorVehicleData notifications for the requested module (moduleId and moduleType). + * If subscribe is not included, the subscription status of the app for the requested module (moduleId and moduleType) will remain unchanged. * * optional, Boolean, default Value = false */ diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.m b/SmartDeviceLink/SDLGetInteriorVehicleData.m index 4f283fb49..f3fe5726f 100755 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.m @@ -72,6 +72,15 @@ - (void)setSubscribe:(nullable NSNumber *)subscribe { return [self.parameters sdl_objectForName:SDLRPCParameterNameSubscribe ofClass:NSNumber.class error:nil]; } +- (void)setModuleId:(NSString *)moduleId { + [self.store sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; +} + +- (NSString *)moduleId { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h index caf07e023..291ea10f0 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.h +++ b/SmartDeviceLink/SDLRPCParameterNames.h @@ -84,6 +84,9 @@ extern SDLRPCParameterName const SDLRPCParameterNameButtonEventMode; extern SDLRPCParameterName const SDLRPCParameterNameButtonName; extern SDLRPCParameterName const SDLRPCParameterNameButtonPressMode; extern SDLRPCParameterName const SDLRPCParameterNameColor; +extern SDLRPCParameterName const SDLRPCParameterNameCol; +extern SDLRPCParameterName const SDLRPCParameterNameColSpan; +extern SDLRPCParameterName const SDLRPCParameterNameColumns; extern SDLRPCParameterName const SDLRPCParameterNameCoolingEnabled; extern SDLRPCParameterName const SDLRPCParameterNameCoolingEnabledAvailable; extern SDLRPCParameterName const SDLRPCParameterNameCoolingLevel; @@ -105,8 +108,6 @@ extern SDLRPCParameterName const SDLRPCParameterNameClimateControlCapabilities; extern SDLRPCParameterName const SDLRPCParameterNameCloudCover; extern SDLRPCParameterName const SDLRPCParameterNameClusterModes; extern SDLRPCParameterName const SDLRPCParameterNameClusterModeStatus; -extern SDLRPCParameterName const SDLRPCParameterNameCol; -extern SDLRPCParameterName const SDLRPCParameterNameColSpan; extern SDLRPCParameterName const SDLRPCParameterNameCommandIcon; extern SDLRPCParameterName const SDLRPCParameterNameCommandId; extern SDLRPCParameterName const SDLRPCParameterNameCompassDirection; @@ -217,6 +218,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameGPS; extern SDLRPCParameterName const SDLRPCParameterNameGraphic; extern SDLRPCParameterName const SDLRPCParameterNameGraphicSupported; extern SDLRPCParameterName const SDLRPCParameterNameGreen; +extern SDLRPCParameterName const SDLRPCParameterNameGrid; extern SDLRPCParameterName const SDLRPCParameterNameHandledRPCs; extern SDLRPCParameterName const SDLRPCParameterNameHapticRectData; extern SDLRPCParameterName const SDLRPCParameterNameHapticSpatialDataSupported; @@ -308,6 +310,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameLeftRow2BuckleBelted; extern SDLRPCParameterName const SDLRPCParameterNameLeftRow3BuckleBelted; extern SDLRPCParameterName const SDLRPCParameterNameLength; extern SDLRPCParameterName const SDLRPCParameterNameLevel; +extern SDLRPCParameterName const SDLRPCParameterNameLevels; extern SDLRPCParameterName const SDLRPCParameterNameLevelSpan; extern SDLRPCParameterName const SDLRPCParameterNameLightControlCapabilities; extern SDLRPCParameterName const SDLRPCParameterNameLightControlData; @@ -524,6 +527,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameSDLVersion; extern SDLRPCParameterName const SDLRPCParameterNameSearchAddress; extern SDLRPCParameterName const SDLRPCParameterNameSeatControlData; extern SDLRPCParameterName const SDLRPCParameterNameSeatControlCapabilities; +extern SDLRPCParameterName const SDLRPCParameterNameSeats; extern SDLRPCParameterName const SDLRPCParameterNameSecondaryColor; extern SDLRPCParameterName const SDLRPCParameterNameSecondaryGraphic; extern SDLRPCParameterName const SDLRPCParameterNameSecondaryImage; diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m index 86006cd18..03cec487e 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.m +++ b/SmartDeviceLink/SDLRPCParameterNames.m @@ -105,6 +105,7 @@ SDLRPCParameterName const SDLRPCParameterNameColor = @"color"; SDLRPCParameterName const SDLRPCParameterNameCol = @"col"; SDLRPCParameterName const SDLRPCParameterNameColSpan = @"colspan"; +SDLRPCParameterName const SDLRPCParameterNameColumns = @"columns"; SDLRPCParameterName const SDLRPCParameterNameCommandIcon = @"cmdIcon"; SDLRPCParameterName const SDLRPCParameterNameCommandId = @"cmdID"; SDLRPCParameterName const SDLRPCParameterNameCompassDirection = @"compassDirection"; @@ -214,6 +215,7 @@ SDLRPCParameterName const SDLRPCParameterNameGraphic = @"graphic"; SDLRPCParameterName const SDLRPCParameterNameGraphicSupported = @"graphicSupported"; SDLRPCParameterName const SDLRPCParameterNameGreen = @"green"; +SDLRPCParameterName const SDLRPCParameterNameGrid = @"grid"; SDLRPCParameterName const SDLRPCParameterNameHandledRPCs = @"handledRPCs"; SDLRPCParameterName const SDLRPCParameterNameHapticRectData = @"hapticRectData"; SDLRPCParameterName const SDLRPCParameterNameHapticSpatialDataSupported = @"hapticSpatialDataSupported"; @@ -306,6 +308,7 @@ SDLRPCParameterName const SDLRPCParameterNameLeftRow3BuckleBelted = @"leftRow3BuckleBelted"; SDLRPCParameterName const SDLRPCParameterNameLength = @"length"; SDLRPCParameterName const SDLRPCParameterNameLevel = @"level"; +SDLRPCParameterName const SDLRPCParameterNameLevels = @"levels"; SDLRPCParameterName const SDLRPCParameterNameLevelSpan = @"levelspan"; SDLRPCParameterName const SDLRPCParameterNameLightControlCapabilities = @"lightControlCapabilities"; SDLRPCParameterName const SDLRPCParameterNameLightControlData = @"lightControlData"; @@ -519,6 +522,7 @@ SDLRPCParameterName const SDLRPCParameterNameSearchAddress = @"searchAddress"; SDLRPCParameterName const SDLRPCParameterNameSeatControlData = @"seatControlData"; SDLRPCParameterName const SDLRPCParameterNameSeatControlCapabilities = @"seatControlCapabilities"; +SDLRPCParameterName const SDLRPCParameterNameSeats = @"seats"; SDLRPCParameterName const SDLRPCParameterNameSecondaryGraphic = @"secondaryGraphic"; SDLRPCParameterName const SDLRPCParameterNameSecondaryImage = @"secondaryImage"; SDLRPCParameterName const SDLRPCParameterNameSecondaryText = @"secondaryText"; diff --git a/SmartDeviceLink/SDLSeatLocation.h b/SmartDeviceLink/SDLSeatLocation.h new file mode 100644 index 000000000..072d2f61d --- /dev/null +++ b/SmartDeviceLink/SDLSeatLocation.h @@ -0,0 +1,26 @@ +// +// SDLSeatLocation.h +// SmartDeviceLink +// +// Created by standa1 on 7/11/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLRPCMessage.h" +#import "SDLGrid.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Describes the location of a seat + */ +@interface SDLSeatLocation : SDLRPCStruct + +/** + * Optional + */ +@property (strong, nonatomic) SDLGrid *grid; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSeatLocation.m b/SmartDeviceLink/SDLSeatLocation.m new file mode 100644 index 000000000..65ba86d1d --- /dev/null +++ b/SmartDeviceLink/SDLSeatLocation.m @@ -0,0 +1,25 @@ +// +// SDLSeatLocation.m +// SmartDeviceLink +// +// Created by standa1 on 7/11/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLSeatLocation.h" + +#import "NSMutableDictionary+Store.h" +#import "SDLRPCParameterNames.h" + +@implementation SDLSeatLocation + +- (void)setGrid:(SDLGrid *)grid { + [self.store sdl_setObject:grid forName:SDLRPCParameterNameGrid]; +} + +- (SDLGrid *)grid { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameGrid ofClass:SDLGrid.class error:&error]; +} + +@end diff --git a/SmartDeviceLink/SDLSeatLocationCapability.h b/SmartDeviceLink/SDLSeatLocationCapability.h new file mode 100644 index 000000000..bdd229dc7 --- /dev/null +++ b/SmartDeviceLink/SDLSeatLocationCapability.h @@ -0,0 +1,46 @@ +// +// SDLSeatLocationCapability.h +// SmartDeviceLink +// +// Created by standa1 on 7/11/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLRPCMessage.h" + +#import "SDLSeatLocation.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * Contains information about the locations of each seat. + */ +@interface SDLSeatLocationCapability : SDLRPCStruct + +/** + * + * Optional, Integer, 1 - 100 + */ +@property (strong, nonatomic) NSNumber *cols; + +/** + * + * Optional, Integer, 1 - 100 + */ +@property (strong, nonatomic) NSNumber *rows; + +/** + * + * Optional, Integer, 1 - 100 + */ +@property (strong, nonatomic) NSNumber *levels; + +/** + * Contains a list of SeatLocation in the vehicle, the first element is the driver's seat + * Optional + */ +@property (strong, nonatomic) SDLSeatLocation *seats; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSeatLocationCapability.m b/SmartDeviceLink/SDLSeatLocationCapability.m new file mode 100644 index 000000000..5a702d451 --- /dev/null +++ b/SmartDeviceLink/SDLSeatLocationCapability.m @@ -0,0 +1,52 @@ +// +// SDLSeatLocationCapability.m +// SmartDeviceLink +// +// Created by standa1 on 7/11/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLSeatLocationCapability.h" + +#import "NSMutableDictionary+Store.h" +#import "SDLRPCParameterNames.h" + +@implementation SDLSeatLocationCapability + +- (void)setCol:(NSNumber *)cols { + [self.store sdl_setObject:cols forName:SDLRPCParameterNameColumns]; +} + +- (NSNumber *)cols { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameColumns ofClass:NSNumber.class error:&error]; +} + +- (void)setRow:(NSNumber *)rows { + [self.store sdl_setObject:rows forName:SDLRPCParameterNameRows]; +} + +- (NSNumber *)rows { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameRows ofClass:NSNumber.class error:&error]; +} + +- (void)setLevel:(NSNumber *)levels { + [self.store sdl_setObject:levels forName:SDLRPCParameterNameLevels]; +} + +- (NSNumber *)levels { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameLevels ofClass:NSNumber.class error:&error]; +} + +- (void)setSeats:(SDLSeatLocation *)seats { + [self.store sdl_setObject:seats forName:SDLRPCParameterNameSeats]; +} + +- (SDLSeatLocation *)seats { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameSeats ofClass:SDLSeatLocation.class error:&error]; +} + +@end diff --git a/SmartDeviceLink/SDLSystemCapabilityType.h b/SmartDeviceLink/SDLSystemCapabilityType.h index 2625217dc..972a8888b 100755 --- a/SmartDeviceLink/SDLSystemCapabilityType.h +++ b/SmartDeviceLink/SDLSystemCapabilityType.h @@ -37,3 +37,8 @@ extern SDLSystemCapabilityType const SDLSystemCapabilityTypeVideoStreaming; The remote control capability */ extern SDLSystemCapabilityType const SDLSystemCapabilityTypeRemoteControl; + +/** + Contains information about the locations of each seat + */ +extern SDLSystemCapabilityType const SDLSystemCapabilityTypeSeatLocation; diff --git a/SmartDeviceLink/SDLSystemCapabilityType.m b/SmartDeviceLink/SDLSystemCapabilityType.m index 933a74418..c99e17dd1 100755 --- a/SmartDeviceLink/SDLSystemCapabilityType.m +++ b/SmartDeviceLink/SDLSystemCapabilityType.m @@ -13,3 +13,4 @@ SDLSystemCapabilityType const SDLSystemCapabilityTypePhoneCall = @"PHONE_CALL"; SDLSystemCapabilityType const SDLSystemCapabilityTypeVideoStreaming = @"VIDEO_STREAMING"; SDLSystemCapabilityType const SDLSystemCapabilityTypeRemoteControl = @"REMOTE_CONTROL"; +SDLSystemCapabilityType const SDLSystemCapabilityTypeSeatLocation = @"SEAT_LOCATION"; From a4318c3c2c23d165398481e8113a1299051be69d Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 25 Jul 2019 16:35:32 -0700 Subject: [PATCH 04/35] Add required properties --- SmartDeviceLink/SDLGlobalProperty.h | 5 +++++ SmartDeviceLink/SDLGlobalProperty.m | 1 + SmartDeviceLink/SDLRPCParameterNames.h | 2 ++ SmartDeviceLink/SDLRPCParameterNames.m | 2 ++ SmartDeviceLink/SDLSeatLocationCapability.h | 2 ++ SmartDeviceLink/SDLSeatLocationCapability.m | 14 ++++++++++++++ SmartDeviceLink/SDLSetGlobalProperties.h | 8 ++++++++ SmartDeviceLink/SDLSetGlobalProperties.m | 9 +++++++++ SmartDeviceLink/SDLSystemCapability.h | 8 ++++++++ SmartDeviceLink/SDLSystemCapability.m | 9 +++++++++ 10 files changed, 60 insertions(+) diff --git a/SmartDeviceLink/SDLGlobalProperty.h b/SmartDeviceLink/SDLGlobalProperty.h index e719cd45c..9175288cb 100644 --- a/SmartDeviceLink/SDLGlobalProperty.h +++ b/SmartDeviceLink/SDLGlobalProperty.h @@ -45,3 +45,8 @@ extern SDLGlobalProperty const SDLGlobalPropertyMenuIcon; * Property related to the keyboard */ extern SDLGlobalProperty const SDLGlobalPropertyKeyboard; + +/** + * Location of the user's seat of setGlobalProperties + */ +extern SDLGlobalProperty const SDLGlobalPropertyUserLocation; diff --git a/SmartDeviceLink/SDLGlobalProperty.m b/SmartDeviceLink/SDLGlobalProperty.m index 00537847b..410af9179 100644 --- a/SmartDeviceLink/SDLGlobalProperty.m +++ b/SmartDeviceLink/SDLGlobalProperty.m @@ -11,3 +11,4 @@ SDLGlobalProperty const SDLGlobalPropertyMenuName = @"MENUNAME"; SDLGlobalProperty const SDLGlobalPropertyMenuIcon = @"MENUICON"; SDLGlobalProperty const SDLGlobalPropertyKeyboard = @"KEYBOARDPROPERTIES"; +SDLGlobalProperty const SDLGlobalPropertyUserLocation = @"USER_LOCATION"; diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h index 291ea10f0..924ee4469 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.h +++ b/SmartDeviceLink/SDLRPCParameterNames.h @@ -527,6 +527,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameSDLVersion; extern SDLRPCParameterName const SDLRPCParameterNameSearchAddress; extern SDLRPCParameterName const SDLRPCParameterNameSeatControlData; extern SDLRPCParameterName const SDLRPCParameterNameSeatControlCapabilities; +extern SDLRPCParameterName const SDLRPCParameterNameSeatLocationCapability; extern SDLRPCParameterName const SDLRPCParameterNameSeats; extern SDLRPCParameterName const SDLRPCParameterNameSecondaryColor; extern SDLRPCParameterName const SDLRPCParameterNameSecondaryGraphic; @@ -649,6 +650,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameUpDownAvailable; extern SDLRPCParameterName const SDLRPCParameterNameURL; extern SDLRPCParameterName const SDLRPCParameterNameURLUppercase; extern SDLRPCParameterName const SDLRPCParameterNameUserDisallowed; +extern SDLRPCParameterName const SDLRPCParameterNameUserLocation; extern SDLRPCParameterName const SDLRPCParameterNameUserSelected; extern SDLRPCParameterName const SDLRPCParameterNameUTCDay; extern SDLRPCParameterName const SDLRPCParameterNameUTCHours; diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m index 03cec487e..afd2271a3 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.m +++ b/SmartDeviceLink/SDLRPCParameterNames.m @@ -522,6 +522,7 @@ SDLRPCParameterName const SDLRPCParameterNameSearchAddress = @"searchAddress"; SDLRPCParameterName const SDLRPCParameterNameSeatControlData = @"seatControlData"; SDLRPCParameterName const SDLRPCParameterNameSeatControlCapabilities = @"seatControlCapabilities"; +SDLRPCParameterName const SDLRPCParameterNameSeatLocationCapability = @"seatLocationCapability"; SDLRPCParameterName const SDLRPCParameterNameSeats = @"seats"; SDLRPCParameterName const SDLRPCParameterNameSecondaryGraphic = @"secondaryGraphic"; SDLRPCParameterName const SDLRPCParameterNameSecondaryImage = @"secondaryImage"; @@ -644,6 +645,7 @@ SDLRPCParameterName const SDLRPCParameterNameURL = @"url"; SDLRPCParameterName const SDLRPCParameterNameURLUppercase = @"URL"; SDLRPCParameterName const SDLRPCParameterNameUserDisallowed = @"userDisallowed"; +SDLRPCParameterName const SDLRPCParameterNameUserLocation = @"userLocation"; SDLRPCParameterName const SDLRPCParameterNameUserSelected = @"userSelected"; SDLRPCParameterName const SDLRPCParameterNameUTCDay = @"utcDay"; SDLRPCParameterName const SDLRPCParameterNameUTCHours = @"utcHours"; diff --git a/SmartDeviceLink/SDLSeatLocationCapability.h b/SmartDeviceLink/SDLSeatLocationCapability.h index bdd229dc7..0403ba9e3 100644 --- a/SmartDeviceLink/SDLSeatLocationCapability.h +++ b/SmartDeviceLink/SDLSeatLocationCapability.h @@ -17,6 +17,8 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSeatLocationCapability : SDLRPCStruct +- (instancetype)initWithSeats:(SDLSeatLocation *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels; + /** * * Optional, Integer, 1 - 100 diff --git a/SmartDeviceLink/SDLSeatLocationCapability.m b/SmartDeviceLink/SDLSeatLocationCapability.m index 5a702d451..13d83be89 100644 --- a/SmartDeviceLink/SDLSeatLocationCapability.m +++ b/SmartDeviceLink/SDLSeatLocationCapability.m @@ -13,6 +13,20 @@ @implementation SDLSeatLocationCapability +- (instancetype)initWithSeats:(SDLSeatLocation *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels { + self = [self init]; + if (!self) { + return self; + } + + self.seats = seats; + self.cols = cols; + self.rows = rows; + self.levels = levels; + + return self; +} + - (void)setCol:(NSNumber *)cols { [self.store sdl_setObject:cols forName:SDLRPCParameterNameColumns]; } diff --git a/SmartDeviceLink/SDLSetGlobalProperties.h b/SmartDeviceLink/SDLSetGlobalProperties.h index 7b3370d9b..a0a947757 100644 --- a/SmartDeviceLink/SDLSetGlobalProperties.h +++ b/SmartDeviceLink/SDLSetGlobalProperties.h @@ -7,6 +7,7 @@ @class SDLKeyboardProperties; @class SDLTTSChunk; @class SDLVRHelpItem; +@class SDLSeatLocation; NS_ASSUME_NONNULL_BEGIN @@ -104,6 +105,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic, nullable) SDLKeyboardProperties *keyboardProperties; +/** + Location of the user's seat. Default is driver's seat location if it is not set yet + + Optional + */ +@property (strong, nonatomic, nullable) SDLSeatLocation *userLocation; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSetGlobalProperties.m b/SmartDeviceLink/SDLSetGlobalProperties.m index 69f06d5d5..6dc337505 100644 --- a/SmartDeviceLink/SDLSetGlobalProperties.m +++ b/SmartDeviceLink/SDLSetGlobalProperties.m @@ -11,6 +11,7 @@ #import "SDLRPCFunctionNames.h" #import "SDLTTSChunk.h" #import "SDLVrHelpItem.h" +#import "SDLSeatLocation.h" NS_ASSUME_NONNULL_BEGIN @@ -106,6 +107,14 @@ - (nullable SDLKeyboardProperties *)keyboardProperties { return [self.parameters sdl_objectForName:SDLRPCParameterNameKeyboardProperties ofClass:SDLKeyboardProperties.class error:nil]; } +- (void)setUserLocation:(nullable SDLSeatLocation *)userLocation { + [self.parameters sdl_setObject:userLocation forName:SDLRPCParameterNameUserLocation]; +} + +- (nullable SDLSeatLocation *)userLocation { + return [self.parameters sdl_objectForName:SDLRPCParameterNameUserLocation ofClass:SDLSeatLocation.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSystemCapability.h b/SmartDeviceLink/SDLSystemCapability.h index 503f50f3e..fb69cc9eb 100755 --- a/SmartDeviceLink/SDLSystemCapability.h +++ b/SmartDeviceLink/SDLSystemCapability.h @@ -14,6 +14,7 @@ @class SDLNavigationCapability; @class SDLVideoStreamingCapability; @class SDLRemoteControlCapabilities; +@class SDLSeatLocationCapability; NS_ASSUME_NONNULL_BEGIN @@ -104,6 +105,13 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) SDLRemoteControlCapabilities *remoteControlCapability; +/** + * Contains information about the locations of each seat + * + * Optional + */ +@property (nullable, strong, nonatomic) SDLSeatLocationCapability *seatLocationCapability; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSystemCapability.m b/SmartDeviceLink/SDLSystemCapability.m index c9273df2c..59794c196 100755 --- a/SmartDeviceLink/SDLSystemCapability.m +++ b/SmartDeviceLink/SDLSystemCapability.m @@ -16,6 +16,7 @@ #import "SDLSystemCapabilityType.h" #import "SDLVideoStreamingCapability.h" #import "SDLRemoteControlCapabilities.h" +#import "SDLSeatLocationCapability.h" NS_ASSUME_NONNULL_BEGIN @@ -130,6 +131,14 @@ - (nullable SDLRemoteControlCapabilities *)remoteControlCapability { return [self.store sdl_objectForName:SDLRPCParameterNameRemoteControlCapability ofClass:SDLRemoteControlCapabilities.class error:nil]; } +- (void)setSeatLocationCapability:(nullable SDLSeatLocationCapability *)seatLocationCapability { + [self.store sdl_setObject:seatLocationCapability forName:SDLRPCParameterNameSeatLocationCapability]; +} + +- (nullable SDLSeatLocationCapability *)seatLocationCapability { + return [self.store sdl_objectForName:SDLRPCParameterNameSeatLocationCapability ofClass:SDLSeatLocationCapability.class error:nil]; +} + @end NS_ASSUME_NONNULL_END From 16ccfb081d9da0c44fe6dc312afab8a182e9cf3d Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 25 Jul 2019 17:22:27 -0700 Subject: [PATCH 05/35] Add SDLGetInteriorVehicleDataConsent Request --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 8 +++ .../SDLGetInteriorVehicleDataConsent.h | 34 ++++++++++++ .../SDLGetInteriorVehicleDataConsent.m | 54 +++++++++++++++++++ SmartDeviceLink/SDLRPCFunctionNames.h | 1 + SmartDeviceLink/SDLRPCFunctionNames.m | 1 + SmartDeviceLink/SDLRPCParameterNames.h | 1 + SmartDeviceLink/SDLRPCParameterNames.m | 1 + 7 files changed, 100 insertions(+) create mode 100644 SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h create mode 100644 SmartDeviceLink/SDLGetInteriorVehicleDataConsent.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index f98c4f1b5..c84b757d4 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -15,6 +15,8 @@ 0055412F22D759BD003194D3 /* SDLSeatLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412D22D759BC003194D3 /* SDLSeatLocation.m */; }; 0055413222D75A7B003194D3 /* SDLSeatLocationCapability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055413022D75A7A003194D3 /* SDLSeatLocationCapability.h */; }; 0055413322D75A7B003194D3 /* SDLSeatLocationCapability.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055413122D75A7B003194D3 /* SDLSeatLocationCapability.m */; }; + 008DB36122EA7482003F458C /* SDLGetInteriorVehicleDataConsent.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB35F22EA7481003F458C /* SDLGetInteriorVehicleDataConsent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 008DB36222EA7482003F458C /* SDLGetInteriorVehicleDataConsent.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */; }; 162E82CA1A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */; }; 162E82CB1A9BDE8A00906325 /* SDLAppHMITypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */; }; 162E82CC1A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */; }; @@ -1647,6 +1649,8 @@ 0055412D22D759BC003194D3 /* SDLSeatLocation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocation.m; sourceTree = ""; }; 0055413022D75A7A003194D3 /* SDLSeatLocationCapability.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLSeatLocationCapability.h; sourceTree = ""; }; 0055413122D75A7B003194D3 /* SDLSeatLocationCapability.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationCapability.m; sourceTree = ""; }; + 008DB35F22EA7481003F458C /* SDLGetInteriorVehicleDataConsent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGetInteriorVehicleDataConsent.h; sourceTree = ""; }; + 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsent.m; sourceTree = ""; }; 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAmbientLightStatusSpec.m; sourceTree = ""; }; 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppHMITypeSpec.m; sourceTree = ""; }; 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppInterfaceUnregisteredReasonSpec.m; sourceTree = ""; }; @@ -4283,6 +4287,8 @@ 5D61FC051A84238C00846EE7 /* SDLUpdateTurnList.m */, 8BA12B0F22DCCE1F00371E82 /* SDLUnpublishAppService.h */, 8BA12B1022DCCE1F00371E82 /* SDLUnpublishAppService.m */, + 008DB35F22EA7481003F458C /* SDLGetInteriorVehicleDataConsent.h */, + 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */, ); name = Requests; sourceTree = ""; @@ -6253,6 +6259,7 @@ 1EB59CBF202DA26000343A61 /* SDLSeatControlData.h in Headers */, 1EB59CB3202D9B5F00343A61 /* SDLSeatMemoryActionType.h in Headers */, 88665B73220B80F400D9DA77 /* SDLWeatherAlert.h in Headers */, + 008DB36122EA7482003F458C /* SDLGetInteriorVehicleDataConsent.h in Headers */, 1EB59CC3202DB40400343A61 /* SDLSeatControlCapabilities.h in Headers */, 1EB59CB7202D9C8100343A61 /* SDLSeatMemoryAction.h in Headers */, 1EB59CBB202DA1B400343A61 /* SDLSupportedSeat.h in Headers */, @@ -7341,6 +7348,7 @@ 5D61FD841A84238C00846EE7 /* SDLSetDisplayLayout.m in Sources */, DA9F7E701DCBFFDB00ACAE48 /* SDLGetWayPoints.m in Sources */, 1EAA4756203583BC000FE74B /* SDLHMISettingsControlData.m in Sources */, + 008DB36222EA7482003F458C /* SDLGetInteriorVehicleDataConsent.m in Sources */, 5D00AC741F151CFE004000D9 /* SDLGetSystemCapabilityResponse.m in Sources */, 5D61FE001A84238C00846EE7 /* SDLVehicleDataEventStatus.m in Sources */, 5D61FDC41A84238C00846EE7 /* SDLTBTState.m in Sources */, diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h b/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h new file mode 100644 index 000000000..7a7283ea7 --- /dev/null +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h @@ -0,0 +1,34 @@ +// +// SDLGetInteriorVehicleDataConsent.h +// SmartDeviceLink +// +// Created by standa1 on 7/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLRPCRequest.h" +#import "SDLModuleType.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface SDLGetInteriorVehicleDataConsent : SDLRPCRequest + +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleIds:(NSArray *)moduleIds; + +/** + * The module type that the app requests to control. + * + * Required + */ +@property (strong, nonatomic, nullable) SDLModuleType moduleType; + +/** + * Ids of a module of same type, published by System Capability. + * + * Required + */ +@property (strong, nonatomic, nullable) NSArray *moduleIds; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.m b/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.m new file mode 100644 index 000000000..4c7651db5 --- /dev/null +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.m @@ -0,0 +1,54 @@ +// +// SDLGetInteriorVehicleDataConsent.m +// SmartDeviceLink +// +// Created by standa1 on 7/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLGetInteriorVehicleDataConsent.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" +#import "NSMutableDictionary+Store.h" + +@implementation SDLGetInteriorVehicleDataConsent +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +- (instancetype)init { + if (self = [super initWithName:SDLRPCFunctionNameGetInteriorVehicleDataConsent]) { + } + return self; +} +#pragma clang diagnostic pop + +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleIds:(NSArray *)moduleIds { + self = [self init]; + if (!self) { + return nil; + } + + self.moduleType = moduleType; + self.moduleIds = moduleIds; + + return self; +} + +- (void)setModuleType:(SDLModuleType)moduleType { + [self.parameters sdl_setObject:moduleType forName:SDLRPCParameterNameModuleType]; +} + +- (SDLModuleType)moduleType { + NSError *error = nil; + return [self.parameters sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; +} + +- (void)setModuleIds:(NSArray *)moduleIds { + [self.parameters sdl_setObject:moduleIds forName:SDLRPCParameterNameModuleIds]; +} + +- (NSArray *)moduleIds { + NSError *error = nil; + return [self.parameters sdl_objectsForName:SDLRPCParameterNameModuleIds ofClass:NSString.class error:&error]; +} + +@end diff --git a/SmartDeviceLink/SDLRPCFunctionNames.h b/SmartDeviceLink/SDLRPCFunctionNames.h index f6aabf081..5a30c0822 100644 --- a/SmartDeviceLink/SDLRPCFunctionNames.h +++ b/SmartDeviceLink/SDLRPCFunctionNames.h @@ -35,6 +35,7 @@ extern SDLRPCFunctionName const SDLRPCFunctionNameGetDTCs; extern SDLRPCFunctionName const SDLRPCFunctionNameGetFile; extern SDLRPCFunctionName const SDLRPCFunctionNameGetCloudAppProperties; extern SDLRPCFunctionName const SDLRPCFunctionNameGetInteriorVehicleData; +extern SDLRPCFunctionName const SDLRPCFunctionNameGetInteriorVehicleDataConsent; extern SDLRPCFunctionName const SDLRPCFunctionNameGetSystemCapability; extern SDLRPCFunctionName const SDLRPCFunctionNameGetVehicleData; extern SDLRPCFunctionName const SDLRPCFunctionNameGetWayPoints; diff --git a/SmartDeviceLink/SDLRPCFunctionNames.m b/SmartDeviceLink/SDLRPCFunctionNames.m index 2ca574da0..4e8715128 100644 --- a/SmartDeviceLink/SDLRPCFunctionNames.m +++ b/SmartDeviceLink/SDLRPCFunctionNames.m @@ -30,6 +30,7 @@ SDLRPCFunctionName const SDLRPCFunctionNameGetFile = @"GetFile"; SDLRPCFunctionName const SDLRPCFunctionNameGetCloudAppProperties = @"GetCloudAppProperties"; SDLRPCFunctionName const SDLRPCFunctionNameGetInteriorVehicleData = @"GetInteriorVehicleData"; +SDLRPCFunctionName const SDLRPCFunctionNameGetInteriorVehicleDataConsent = @"GetInteriorVehicleDataConsentID"; SDLRPCFunctionName const SDLRPCFunctionNameGetSystemCapability = @"GetSystemCapability"; SDLRPCFunctionName const SDLRPCFunctionNameGetVehicleData = @"GetVehicleData"; SDLRPCFunctionName const SDLRPCFunctionNameGetWayPoints = @"GetWayPoints"; diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h index 924ee4469..ae3b83178 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.h +++ b/SmartDeviceLink/SDLRPCParameterNames.h @@ -385,6 +385,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameMinutes; extern SDLRPCParameterName const SDLRPCParameterNameModel; extern SDLRPCParameterName const SDLRPCParameterNameModuleData; extern SDLRPCParameterName const SDLRPCParameterNameModuleId; +extern SDLRPCParameterName const SDLRPCParameterNameModuleIds; extern SDLRPCParameterName const SDLRPCParameterNameModuleInfo; extern SDLRPCParameterName const SDLRPCParameterNameModuleName; extern SDLRPCParameterName const SDLRPCParameterNameModuleType; diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m index afd2271a3..49721f3c0 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.m +++ b/SmartDeviceLink/SDLRPCParameterNames.m @@ -379,6 +379,7 @@ SDLRPCParameterName const SDLRPCParameterNameModel = @"model"; SDLRPCParameterName const SDLRPCParameterNameModuleData = @"moduleData"; SDLRPCParameterName const SDLRPCParameterNameModuleId = @"moduleId"; +SDLRPCParameterName const SDLRPCParameterNameModuleIds = @"moduleIds"; SDLRPCParameterName const SDLRPCParameterNameModuleInfo = @"moduleInfo"; SDLRPCParameterName const SDLRPCParameterNameModuleName = @"moduleName"; SDLRPCParameterName const SDLRPCParameterNameModuleType = @"moduleType"; From b30e4e270bb02ce777fb431a18c48aaebbc78666 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 25 Jul 2019 17:33:00 -0700 Subject: [PATCH 06/35] Add SDLGetInteriorVehicleDataConsentResponse --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 8 +++++ ...SDLGetInteriorVehicleDataConsentResponse.h | 26 ++++++++++++++ ...SDLGetInteriorVehicleDataConsentResponse.m | 34 +++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h create mode 100644 SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index c84b757d4..de38782ee 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -17,6 +17,8 @@ 0055413322D75A7B003194D3 /* SDLSeatLocationCapability.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055413122D75A7B003194D3 /* SDLSeatLocationCapability.m */; }; 008DB36122EA7482003F458C /* SDLGetInteriorVehicleDataConsent.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB35F22EA7481003F458C /* SDLGetInteriorVehicleDataConsent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 008DB36222EA7482003F458C /* SDLGetInteriorVehicleDataConsent.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */; }; + 008DB36522EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36322EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 008DB36622EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */; }; 162E82CA1A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */; }; 162E82CB1A9BDE8A00906325 /* SDLAppHMITypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */; }; 162E82CC1A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */; }; @@ -1651,6 +1653,8 @@ 0055413122D75A7B003194D3 /* SDLSeatLocationCapability.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationCapability.m; sourceTree = ""; }; 008DB35F22EA7481003F458C /* SDLGetInteriorVehicleDataConsent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGetInteriorVehicleDataConsent.h; sourceTree = ""; }; 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsent.m; sourceTree = ""; }; + 008DB36322EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGetInteriorVehicleDataConsentResponse.h; sourceTree = ""; }; + 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsentResponse.m; sourceTree = ""; }; 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAmbientLightStatusSpec.m; sourceTree = ""; }; 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppHMITypeSpec.m; sourceTree = ""; }; 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppInterfaceUnregisteredReasonSpec.m; sourceTree = ""; }; @@ -4412,6 +4416,8 @@ 5D61FC071A84238C00846EE7 /* SDLUpdateTurnListResponse.m */, 8BA12B1322DCEACB00371E82 /* SDLUnpublishAppServiceResponse.h */, 8BA12B1422DCEACB00371E82 /* SDLUnpublishAppServiceResponse.m */, + 008DB36322EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h */, + 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */, ); name = Responses; sourceTree = ""; @@ -6282,6 +6288,7 @@ 1EAA4749203567FA000FE74B /* SDLHMISettingsControlCapabilities.h in Headers */, 1EAA47452035623B000FE74B /* SDLLightControlData.h in Headers */, 1EAA474120355FF3000FE74B /* SDLLightControlCapabilities.h in Headers */, + 008DB36522EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h in Headers */, 1EAA473920345B7A000FE74B /* SDLLightCapabilities.h in Headers */, 1EAA4725203416D3000FE74B /* SDLEqualizerSettings.h in Headers */, 1EAA47112033FE80000FE74B /* SDLStationIDNumber.h in Headers */, @@ -7229,6 +7236,7 @@ 5D61FC731A84238C00846EE7 /* SDLDeleteCommand.m in Sources */, 5D61FD2A1A84238C00846EE7 /* SDLPerformInteraction.m in Sources */, 5D61FC541A84238C00846EE7 /* SDLButtonEventMode.m in Sources */, + 008DB36622EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m in Sources */, 5D61FC8D1A84238C00846EE7 /* SDLDIDResult.m in Sources */, 5D61FC601A84238C00846EE7 /* SDLCharacterSet.m in Sources */, 5D07C02E2044AC9100D1ECDC /* SDLSequentialRPCRequestOperation.m in Sources */, diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h new file mode 100644 index 000000000..0d549c727 --- /dev/null +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h @@ -0,0 +1,26 @@ +// +// SDLGetInteriorVehicleDataConsentResponse.h +// SmartDeviceLink +// +// Created by standa1 on 7/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLRPCResponse.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface SDLGetInteriorVehicleDataConsentResponse : SDLRPCResponse + +/** + This array has the same size as "moduleIds" in the request; each element corresponding to one moduleId + "true" - if SDL grants the permission for the requested module + "false" - SDL denies the permission for the requested module. + + Required + */ +@property (strong, nonatomic) NSArray *> *allowed; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m new file mode 100644 index 000000000..5adb8f6a8 --- /dev/null +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m @@ -0,0 +1,34 @@ +// +// SDLGetInteriorVehicleDataConsentResponse.m +// SmartDeviceLink +// +// Created by standa1 on 7/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLGetInteriorVehicleDataConsentResponse.h" +#import "SDLRPCFunctionNames.h" +#import "NSMutableDictionary+Store.h" +#import "SDLRPCParameterNames.h" + +@implementation SDLGetInteriorVehicleDataConsentResponse + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +- (instancetype)init { + if (self = [super initWithName:SDLRPCFunctionNameGetInteriorVehicleDataConsent]) { + } + return self; +} +#pragma clang diagnostic pop + +- (void)setAllowed:(NSArray *> *)allowed { + [self.parameters sdl_setObject:allowed forName:SDLRPCParameterNameAllowed]; +} + +- (NSArray *> *)allowed { + NSError *error = nil; + return [self.parameters sdl_objectsForName:SDLRPCParameterNameAllowed ofClass:NSNumber.class error:&error]; +} + +@end From 9d110ff5b41344a45a7f50a131b24be6ada36ccc Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 25 Jul 2019 17:41:28 -0700 Subject: [PATCH 07/35] Add SDLReleaseInteriorVehicleDataModule Request --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 8 +++ .../SDLGetInteriorVehicleDataConsent.m | 1 + SmartDeviceLink/SDLRPCFunctionNames.h | 1 + SmartDeviceLink/SDLRPCFunctionNames.m | 1 + .../SDLReleaseInteriorVehicleDataModule.h | 34 +++++++++++ .../SDLReleaseInteriorVehicleDataModule.m | 56 +++++++++++++++++++ 6 files changed, 101 insertions(+) create mode 100644 SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h create mode 100644 SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index de38782ee..b244f8e81 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -19,6 +19,8 @@ 008DB36222EA7482003F458C /* SDLGetInteriorVehicleDataConsent.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */; }; 008DB36522EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36322EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 008DB36622EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */; }; + 008DB36922EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36722EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h */; }; + 008DB36A22EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36822EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m */; }; 162E82CA1A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */; }; 162E82CB1A9BDE8A00906325 /* SDLAppHMITypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */; }; 162E82CC1A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */; }; @@ -1655,6 +1657,8 @@ 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsent.m; sourceTree = ""; }; 008DB36322EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGetInteriorVehicleDataConsentResponse.h; sourceTree = ""; }; 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsentResponse.m; sourceTree = ""; }; + 008DB36722EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLReleaseInteriorVehicleDataModule.h; sourceTree = ""; }; + 008DB36822EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLReleaseInteriorVehicleDataModule.m; sourceTree = ""; }; 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAmbientLightStatusSpec.m; sourceTree = ""; }; 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppHMITypeSpec.m; sourceTree = ""; }; 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppInterfaceUnregisteredReasonSpec.m; sourceTree = ""; }; @@ -4293,6 +4297,8 @@ 8BA12B1022DCCE1F00371E82 /* SDLUnpublishAppService.m */, 008DB35F22EA7481003F458C /* SDLGetInteriorVehicleDataConsent.h */, 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */, + 008DB36722EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h */, + 008DB36822EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m */, ); name = Requests; sourceTree = ""; @@ -6365,6 +6371,7 @@ 5D4D67B41D30161600468B4A /* SDLLockScreenManager.h in Headers */, 5D00AC7B1F15287E004000D9 /* SDLPhoneCapability.h in Headers */, 5D61FE111A84238C00846EE7 /* SDLWarningLightStatus.h in Headers */, + 008DB36922EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h in Headers */, 5D61FC7A1A84238C00846EE7 /* SDLDeleteInteractionChoiceSet.h in Headers */, 5D61FC3B1A84238C00846EE7 /* SDLAlertManeuverResponse.h in Headers */, 5DB9964E1F26886C002D8795 /* SDLControlFramePayloadEndService.h in Headers */, @@ -7243,6 +7250,7 @@ 5DD67CB91E661C4A009CD394 /* SDLLogTargetFile.m in Sources */, 5D61FCBE1A84238C00846EE7 /* SDLHeadLampStatus.m in Sources */, 5D61FD921A84238C00846EE7 /* SDLShowConstantTBT.m in Sources */, + 008DB36A22EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m in Sources */, 88E6F1A8220E1588006156F9 /* SDLMediaType.m in Sources */, 5D61FC4E1A84238C00846EE7 /* SDLBitsPerSample.m in Sources */, 5D00AC701F1511B9004000D9 /* SDLGetSystemCapability.m in Sources */, diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.m b/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.m index 4c7651db5..88ed0d8e9 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.m @@ -12,6 +12,7 @@ #import "NSMutableDictionary+Store.h" @implementation SDLGetInteriorVehicleDataConsent + #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - (instancetype)init { diff --git a/SmartDeviceLink/SDLRPCFunctionNames.h b/SmartDeviceLink/SDLRPCFunctionNames.h index 5a30c0822..361da03d0 100644 --- a/SmartDeviceLink/SDLRPCFunctionNames.h +++ b/SmartDeviceLink/SDLRPCFunctionNames.h @@ -69,6 +69,7 @@ extern SDLRPCFunctionName const SDLRPCFunctionNamePerformInteraction; extern SDLRPCFunctionName const SDLRPCFunctionNamePublishAppService; extern SDLRPCFunctionName const SDLRPCFunctionNamePutFile; extern SDLRPCFunctionName const SDLRPCFunctionNameReadDID; +extern SDLRPCFunctionName const SDLRPCFunctionNameReleaseInteriorVehicleDataModule; extern SDLRPCFunctionName const SDLRPCFunctionNameRegisterAppInterface; extern SDLRPCFunctionName const SDLRPCFunctionNameReserved; extern SDLRPCFunctionName const SDLRPCFunctionNameResetGlobalProperties; diff --git a/SmartDeviceLink/SDLRPCFunctionNames.m b/SmartDeviceLink/SDLRPCFunctionNames.m index 4e8715128..c5caecb5b 100644 --- a/SmartDeviceLink/SDLRPCFunctionNames.m +++ b/SmartDeviceLink/SDLRPCFunctionNames.m @@ -64,6 +64,7 @@ SDLRPCFunctionName const SDLRPCFunctionNamePublishAppService = @"PublishAppService"; SDLRPCFunctionName const SDLRPCFunctionNamePutFile = @"PutFile"; SDLRPCFunctionName const SDLRPCFunctionNameReadDID = @"ReadDID"; +SDLRPCFunctionName const SDLRPCFunctionNameReleaseInteriorVehicleDataModule = @"ReleaseInteriorVehicleDataModuleID"; SDLRPCFunctionName const SDLRPCFunctionNameRegisterAppInterface = @"RegisterAppInterface"; SDLRPCFunctionName const SDLRPCFunctionNameReserved = @"reserved"; SDLRPCFunctionName const SDLRPCFunctionNameResetGlobalProperties = @"ResetGlobalProperties"; diff --git a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h new file mode 100644 index 000000000..3e6e51960 --- /dev/null +++ b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h @@ -0,0 +1,34 @@ +// +// SDLReleaseInteriorVehicleDataModule.h +// SmartDeviceLink +// +// Created by standa1 on 7/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLRPCRequest.h" +#import "SDLModuleType.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface SDLReleaseInteriorVehicleDataModule : SDLRPCRequest + +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSArray *)moduleId; + +/** + * The module type that the app requests to control. + * + * Required + */ +@property (strong, nonatomic, nullable) SDLModuleType moduleType; + +/** + * Id of a module, published by System Capability. + * + * Required + */ +@property (strong, nonatomic, nullable) NSString *moduleId; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m new file mode 100644 index 000000000..6664c6e6b --- /dev/null +++ b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m @@ -0,0 +1,56 @@ +// +// SDLReleaseInteriorVehicleDataModule.m +// SmartDeviceLink +// +// Created by standa1 on 7/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLReleaseInteriorVehicleDataModule.h" + +#import "NSMutableDictionary+Store.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +@implementation SDLReleaseInteriorVehicleDataModule + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +- (instancetype)init { + if (self = [super initWithName:SDLRPCFunctionNameReleaseInteriorVehicleDataModule]) { + } + return self; +} +#pragma clang diagnostic pop + +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId { + self = [self init]; + if (!self) { + return nil; + } + + self.moduleType = moduleType; + self.moduleId = moduleId; + + return self; +} + +- (void)setModuleType:(SDLModuleType)moduleType { + [self.parameters sdl_setObject:moduleType forName:SDLRPCParameterNameModuleType]; +} + +- (SDLModuleType)moduleType { + NSError *error = nil; + return [self.parameters sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; +} + +- (void)setModuleIds:(NSArray *)moduleIds { + [self.parameters sdl_setObject:moduleIds forName:SDLRPCParameterNameModuleId]; +} + +- (NSString *)moduleId { + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; +} + +@end From fd8e4334e8999bc4e0f6b3858cfe4a252e9aec2f Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 25 Jul 2019 17:43:48 -0700 Subject: [PATCH 08/35] Add SDLReleaseInteriorVehicleDataModuleResponse --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 8 +++++++ ...SDLGetInteriorVehicleDataConsentResponse.m | 2 +- ...ReleaseInteriorVehicleDataModuleResponse.h | 17 ++++++++++++++ ...ReleaseInteriorVehicleDataModuleResponse.m | 23 +++++++++++++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.h create mode 100644 SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index b244f8e81..b4147cce6 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -21,6 +21,8 @@ 008DB36622EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */; }; 008DB36922EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36722EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h */; }; 008DB36A22EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36822EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m */; }; + 008DB36D22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36B22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 008DB36E22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36C22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.m */; }; 162E82CA1A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */; }; 162E82CB1A9BDE8A00906325 /* SDLAppHMITypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */; }; 162E82CC1A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */; }; @@ -1659,6 +1661,8 @@ 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsentResponse.m; sourceTree = ""; }; 008DB36722EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLReleaseInteriorVehicleDataModule.h; sourceTree = ""; }; 008DB36822EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLReleaseInteriorVehicleDataModule.m; sourceTree = ""; }; + 008DB36B22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLReleaseInteriorVehicleDataModuleResponse.h; sourceTree = ""; }; + 008DB36C22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLReleaseInteriorVehicleDataModuleResponse.m; sourceTree = ""; }; 162E81E21A9BDE8A00906325 /* SDLAmbientLightStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAmbientLightStatusSpec.m; sourceTree = ""; }; 162E81E31A9BDE8A00906325 /* SDLAppHMITypeSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppHMITypeSpec.m; sourceTree = ""; }; 162E81E41A9BDE8A00906325 /* SDLAppInterfaceUnregisteredReasonSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLAppInterfaceUnregisteredReasonSpec.m; sourceTree = ""; }; @@ -4424,6 +4428,8 @@ 8BA12B1422DCEACB00371E82 /* SDLUnpublishAppServiceResponse.m */, 008DB36322EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h */, 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */, + 008DB36B22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.h */, + 008DB36C22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.m */, ); name = Responses; sourceTree = ""; @@ -6630,6 +6636,7 @@ 5D61FD0B1A84238C00846EE7 /* SDLOnEncodedSyncPData.h in Headers */, 5D61FC631A84238C00846EE7 /* SDLClusterModeStatus.h in Headers */, 5D61FD371A84238C00846EE7 /* SDLPredefinedLayout.h in Headers */, + 008DB36D22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.h in Headers */, 5D61FDE31A84238C00846EE7 /* SDLUnregisterAppInterface.h in Headers */, 5D61FD331A84238C00846EE7 /* SDLPowerModeQualificationStatus.h in Headers */, 5D92937020B5E0E500FCC775 /* SDLDeleteChoicesOperation.h in Headers */, @@ -7119,6 +7126,7 @@ 5D61FDD21A84238C00846EE7 /* SDLTouchCoord.m in Sources */, 5D61FCEF1A84238C00846EE7 /* SDLListFilesResponse.m in Sources */, 5D3E420B20EAAD6500D8C622 /* SDLTPMS.m in Sources */, + 008DB36E22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.m in Sources */, 5DD67CB11E65DDB7009CD394 /* SDLLogTargetAppleSystemLog.m in Sources */, 5D92935420B2F76500FCC775 /* SDLTemplateColorScheme.m in Sources */, 88D5EB38220CD95000EC3782 /* SDLWeatherServiceData.m in Sources */, diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m index 5adb8f6a8..9d3fbfed4 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m @@ -7,8 +7,8 @@ // #import "SDLGetInteriorVehicleDataConsentResponse.h" -#import "SDLRPCFunctionNames.h" #import "NSMutableDictionary+Store.h" +#import "SDLRPCFunctionNames.h" #import "SDLRPCParameterNames.h" @implementation SDLGetInteriorVehicleDataConsentResponse diff --git a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.h b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.h new file mode 100644 index 000000000..650f4b107 --- /dev/null +++ b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.h @@ -0,0 +1,17 @@ +// +// SDLReleaseInteriorVehicleDataModuleResponse.h +// SmartDeviceLink +// +// Created by standa1 on 7/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLRPCResponse.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface SDLReleaseInteriorVehicleDataModuleResponse : SDLRPCResponse + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.m b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.m new file mode 100644 index 000000000..9013d23c1 --- /dev/null +++ b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.m @@ -0,0 +1,23 @@ +// +// SDLReleaseInteriorVehicleDataModuleResponse.m +// SmartDeviceLink +// +// Created by standa1 on 7/25/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import "SDLReleaseInteriorVehicleDataModuleResponse.h" +#import "SDLRPCFunctionNames.h" + +@implementation SDLReleaseInteriorVehicleDataModuleResponse + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +- (instancetype)init { + if (self = [super initWithName:SDLRPCFunctionNameReleaseInteriorVehicleDataModule]) { + } + return self; +} +#pragma clang diagnostic pop + +@end From 9ff8f0cef54cc2e762a166779471f1125fe809eb Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Fri, 26 Jul 2019 14:25:09 -0700 Subject: [PATCH 09/35] Make Structs, Req, Responses public Fix errors --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 6 +++--- SmartDeviceLink/SDLSeatControlData.h | 3 +++ SmartDeviceLink/SDLSeatLocationCapability.h | 4 ++-- SmartDeviceLink/SDLSeatLocationCapability.m | 8 ++++---- SmartDeviceLink/SDLSupportedSeat.h | 3 +++ SmartDeviceLink/SmartDeviceLink.h | 6 ++++++ 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index b4147cce6..3dd550758 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -11,15 +11,15 @@ 0055412722D40DAB003194D3 /* SDLModuleInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412522D40DAB003194D3 /* SDLModuleInfo.m */; }; 0055412A22D5DC0B003194D3 /* SDLGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412822D5DC0B003194D3 /* SDLGrid.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0055412B22D5DC0B003194D3 /* SDLGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412922D5DC0B003194D3 /* SDLGrid.m */; }; - 0055412E22D759BD003194D3 /* SDLSeatLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412C22D759BC003194D3 /* SDLSeatLocation.h */; }; + 0055412E22D759BD003194D3 /* SDLSeatLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412C22D759BC003194D3 /* SDLSeatLocation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0055412F22D759BD003194D3 /* SDLSeatLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412D22D759BC003194D3 /* SDLSeatLocation.m */; }; - 0055413222D75A7B003194D3 /* SDLSeatLocationCapability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055413022D75A7A003194D3 /* SDLSeatLocationCapability.h */; }; + 0055413222D75A7B003194D3 /* SDLSeatLocationCapability.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055413022D75A7A003194D3 /* SDLSeatLocationCapability.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0055413322D75A7B003194D3 /* SDLSeatLocationCapability.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055413122D75A7B003194D3 /* SDLSeatLocationCapability.m */; }; 008DB36122EA7482003F458C /* SDLGetInteriorVehicleDataConsent.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB35F22EA7481003F458C /* SDLGetInteriorVehicleDataConsent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 008DB36222EA7482003F458C /* SDLGetInteriorVehicleDataConsent.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36022EA7481003F458C /* SDLGetInteriorVehicleDataConsent.m */; }; 008DB36522EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36322EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 008DB36622EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36422EA7F6F003F458C /* SDLGetInteriorVehicleDataConsentResponse.m */; }; - 008DB36922EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36722EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h */; }; + 008DB36922EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36722EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.h */; settings = {ATTRIBUTES = (Public, ); }; }; 008DB36A22EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36822EA8261003F458C /* SDLReleaseInteriorVehicleDataModule.m */; }; 008DB36D22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 008DB36B22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.h */; settings = {ATTRIBUTES = (Public, ); }; }; 008DB36E22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 008DB36C22EA83E4003F458C /* SDLReleaseInteriorVehicleDataModuleResponse.m */; }; diff --git a/SmartDeviceLink/SDLSeatControlData.h b/SmartDeviceLink/SDLSeatControlData.h index 3e3e9d905..44b776323 100644 --- a/SmartDeviceLink/SDLSeatControlData.h +++ b/SmartDeviceLink/SDLSeatControlData.h @@ -48,6 +48,8 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithId:(SDLSupportedSeat)supportedSeat heatingEnabled:(BOOL)heatingEnable coolingEnable:(BOOL)coolingEnable heatingLevel:(UInt8)heatingLevel coolingLevel:(UInt8)coolingLevel horizontalPostion:(UInt8)horizontal verticalPostion:(UInt8)vertical frontVerticalPostion:(UInt8)frontVertical backVerticalPostion:(UInt8)backVertical backTiltAngle:(UInt8)backAngle headSupportedHorizontalPostion:(UInt8)headSupportedHorizontal headSupportedVerticalPostion:(UInt8)headSupportedVertical massageEnabled:(BOOL)massageEnable massageMode:(NSArray *)massageMode massageCussionFirmness:(NSArray *)firmness memory:(SDLSeatMemoryAction *)memoryAction; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" /** * @abstract id of seat that is a remote controllable seat. * @warning This should not be used to identify a seat, this is a deprecated parameter. @@ -55,6 +57,7 @@ NS_ASSUME_NONNULL_BEGIN * Required */ @property (strong, nonatomic) SDLSupportedSeat id; +#pragma clang diagnostic pop /** * @abstract Whether or not heating is enabled. diff --git a/SmartDeviceLink/SDLSeatLocationCapability.h b/SmartDeviceLink/SDLSeatLocationCapability.h index 0403ba9e3..ae41df9a5 100644 --- a/SmartDeviceLink/SDLSeatLocationCapability.h +++ b/SmartDeviceLink/SDLSeatLocationCapability.h @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSeatLocationCapability : SDLRPCStruct -- (instancetype)initWithSeats:(SDLSeatLocation *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels; +- (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels; /** * @@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN * Contains a list of SeatLocation in the vehicle, the first element is the driver's seat * Optional */ -@property (strong, nonatomic) SDLSeatLocation *seats; +@property (strong, nonatomic) NSArray *seats; @end diff --git a/SmartDeviceLink/SDLSeatLocationCapability.m b/SmartDeviceLink/SDLSeatLocationCapability.m index 13d83be89..f1dc56ebd 100644 --- a/SmartDeviceLink/SDLSeatLocationCapability.m +++ b/SmartDeviceLink/SDLSeatLocationCapability.m @@ -13,7 +13,7 @@ @implementation SDLSeatLocationCapability -- (instancetype)initWithSeats:(SDLSeatLocation *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels { +- (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels { self = [self init]; if (!self) { return self; @@ -54,13 +54,13 @@ - (void)setLevel:(NSNumber *)levels { return [self.store sdl_objectForName:SDLRPCParameterNameLevels ofClass:NSNumber.class error:&error]; } -- (void)setSeats:(SDLSeatLocation *)seats { +- (void)setSeats:(NSArray *)seats { [self.store sdl_setObject:seats forName:SDLRPCParameterNameSeats]; } -- (SDLSeatLocation *)seats { +- (NSArray *)seats { NSError *error = nil; - return [self.store sdl_objectForName:SDLRPCParameterNameSeats ofClass:SDLSeatLocation.class error:&error]; + return [self.store sdl_objectsForName:SDLRPCParameterNameSeats ofClass:SDLSeatLocation.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLSupportedSeat.h b/SmartDeviceLink/SDLSupportedSeat.h index 76330a961..6eb6fefab 100644 --- a/SmartDeviceLink/SDLSupportedSeat.h +++ b/SmartDeviceLink/SDLSupportedSeat.h @@ -3,11 +3,14 @@ #import "SDLEnum.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" /** * List possible seats that is a remote controllable seat. * @warning This should not be used to supported seats, this is a deprecated parameter. */ typedef SDLEnum SDLSupportedSeat SDL_SWIFT_ENUM; +#pragma clang diagnostic pop /** * @abstract Save current seat postions and settings to seat memory. diff --git a/SmartDeviceLink/SmartDeviceLink.h b/SmartDeviceLink/SmartDeviceLink.h index 661e88fbe..fe9317789 100644 --- a/SmartDeviceLink/SmartDeviceLink.h +++ b/SmartDeviceLink/SmartDeviceLink.h @@ -40,6 +40,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLGetDTCs.h" #import "SDLGetFile.h" #import "SDLGetInteriorVehicleData.h" +#import "SDLGetInteriorVehicleDataConsent.h" #import "SDLGetSystemCapability.h" #import "SDLGetVehicleData.h" #import "SDLGetWayPoints.h" @@ -71,6 +72,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLSyncPData.h" #import "SDLSystemRequest.h" #import "SDLUnpublishAppService.h" +#import "SDLReleaseInteriorVehicleDataModule.h" #import "SDLUnregisterAppInterface.h" #import "SDLUnsubscribeButton.h" #import "SDLUnsubscribeVehicleData.h" @@ -99,6 +101,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLGetAppServiceDataResponse.h" #import "SDLGetDTCsResponse.h" #import "SDLGetFileResponse.h" +#import "SDLGetInteriorVehicleDataConsentResponse.h" #import "SDLGetInteriorVehicleDataResponse.h" #import "SDLGetSystemCapabilityResponse.h" #import "SDLGetVehicleDataResponse.h" @@ -130,6 +133,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLSubscribeWayPointsResponse.h" #import "SDLSyncPDataResponse.h" #import "SDLUnpublishAppServiceResponse.h" +#import "SDLReleaseInteriorVehicleDataModuleResponse.h" #import "SDLUnregisterAppInterfaceResponse.h" #import "SDLUnsubscribeButtonResponse.h" #import "SDLUnsubscribeVehicleDataResponse.h" @@ -233,6 +237,8 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLSeatControlCapabilities.h" #import "SDLSeatControlData.h" #import "SDLSeatMemoryAction.h" +#import "SDLSeatLocation.h" +#import "SDLSeatLocationCapability.h" #import "SDLSingleTireStatus.h" #import "SDLSISData.h" #import "SDLSoftButton.h" From 62d782d98bb34b9ac909fb14a85b65152ae02b06 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Fri, 26 Jul 2019 15:00:16 -0700 Subject: [PATCH 10/35] Add modueId to initalizer of SDLGetInteriorVehicleData --- SmartDeviceLink/SDLGetInteriorVehicleData.h | 15 ++++++++ SmartDeviceLink/SDLGetInteriorVehicleData.m | 38 +++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.h b/SmartDeviceLink/SDLGetInteriorVehicleData.h index 567327667..536c329ca 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.h +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.h @@ -18,11 +18,26 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLGetInteriorVehicleData : SDLRPCRequest +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; + +- (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; + +- (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (instancetype)initWithModuleType:(SDLModuleType)moduleType; +#pragma clang diagnostic pop +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType; +#pragma clang diagnostic pop +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType; +#pragma clang diagnostic pop /** * The type of a RC module to retrieve module data from the vehicle. diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.m b/SmartDeviceLink/SDLGetInteriorVehicleData.m index f3fe5726f..80fe6c590 100755 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.m @@ -20,6 +20,44 @@ - (instancetype)init { } #pragma clang diagnostic pop +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId { + self = [self init]; + if (!self) { + return nil; + } + + self.moduleType = moduleType; + self.moduleId = moduleId; + + return self; +} + +- (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId { + self = [self init]; + if (!self) { + return nil; + } + + self.moduleType = moduleType; + self.moduleId = moduleId; + self.subscribe = @(YES); + + return self; +} + +- (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId { + self = [self init]; + if (!self) { + return nil; + } + + self.moduleType = moduleType; + self.moduleId = moduleId; + self.subscribe = @(NO); + + return self; +} + - (instancetype)initWithModuleType:(SDLModuleType)moduleType; { self = [self init]; if (!self) { From 01b673edf8166eb87990a8c848ca413d89e09ca2 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Sun, 28 Jul 2019 19:40:11 -0700 Subject: [PATCH 11/35] Add Capability tests --- SmartDeviceLink/SDLAudioControlCapabilities.h | 26 ++++++- SmartDeviceLink/SDLAudioControlCapabilities.m | 30 ++++++++ .../SDLClimateControlCapabilities.m | 26 ++++++- .../SDLHMISettingsControlCapabilities.h | 27 ++++++- .../SDLHMISettingsControlCapabilities.m | 25 ++++++ SmartDeviceLink/SDLLightControlCapabilities.h | 13 +++- SmartDeviceLink/SDLLightControlCapabilities.m | 12 +++ SmartDeviceLink/SDLSeatControlCapabilities.h | 10 ++- SmartDeviceLink/SDLSeatControlCapabilities.m | 37 +++++++++ .../SDLAudioControlCapabilitiesSpec.m | 58 ++++++++++++++ .../StructSpecs/SDLButtonCapabilitiesSpec.m | 21 +++++ .../SDLClimateControlCapabilitiesSpec.m | 25 ++++++ .../SDLHMISettingsControlCapabilitiesSpec.m | 53 +++++++++++++ .../SDLLightControlCapabilitiesSpec.m | 35 +++++++++ .../SDLRadioControlCapabilitiesSpec.m | 48 +++++++++++- .../SDLSeatControlCapabilitiesSpec.m | 76 +++++++++++++++++++ 16 files changed, 513 insertions(+), 9 deletions(-) diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.h b/SmartDeviceLink/SDLAudioControlCapabilities.h index 7e2033f00..ceeab4a8b 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.h +++ b/SmartDeviceLink/SDLAudioControlCapabilities.h @@ -14,7 +14,16 @@ NS_ASSUME_NONNULL_BEGIN @param name The short friendly name of the audio control module. @return An instance of the SDLAudioControlCapabilities class. */ -- (instancetype)initWithModuleName:(NSString *)name; +- (instancetype)initWithModuleName:(NSString *)name __deprecated_msg("Use initWithModuleName:moduleInfo:"); + +/** + Constructs a newly allocated SDLAudioControlCapabilities object with audio control module name (max 100 chars) + + @param name The short friendly name of the audio control module. + @param moduleInfo Information about a RC module, including its id. + @return An instance of the SDLAudioControlCapabilities class. + */ +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(SDLModuleInfo *)moduleInfo; /** Constructs a newly allocated SDLAudioControlCapabilities object with given parameters @@ -26,7 +35,20 @@ NS_ASSUME_NONNULL_BEGIN @param equalizerMaxChannelID Equalizer channel ID (between 1-100). @return An instance of the SDLAudioControlCapabilities class. */ -- (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID; +- (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID __deprecated_msg("Use initWithModuleName:moduleInfo:sourceAvailable:keepContextAvailable:volumeAvailable:equalizerAvailable:equalizerMaxChannelID:"); + +/** + Constructs a newly allocated SDLAudioControlCapabilities object with given parameters + + @param name The short friendly name of the audio control module. + @param moduleInfo Information about a RC module, including its id. + @param sourceAvailable Availability of the control of audio source. + @param volumeAvailable Availability of the volume of audio source. + @param equalizerAvailable Availability of the equalizer of audio source. + @param equalizerMaxChannelID Equalizer channel ID (between 1-100). + @return An instance of the SDLAudioControlCapabilities class. + */ +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID; /** * @abstract The short friendly name of the audio control module. diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.m b/SmartDeviceLink/SDLAudioControlCapabilities.m index 84a97059c..d15552bd9 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.m +++ b/SmartDeviceLink/SDLAudioControlCapabilities.m @@ -19,6 +19,17 @@ - (instancetype)initWithModuleName:(NSString *)name { return self; } +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(SDLModuleInfo *)moduleInfo { + self = [self init]; + if (!self) { + return nil; + } + self.moduleName = name; + self.moduleInfo = moduleInfo; + + return self; +} + - (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID { self = [self init]; if (!self) { @@ -34,6 +45,25 @@ - (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NS return self; } +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID { + self = [self init]; + if (!self) { + return nil; + } + + self.moduleName = name; + self.moduleInfo = moduleInfo; + self.sourceAvailable = sourceAvailable; + self.keepContextAvailable = keepContextAvailable; + self.volumeAvailable = volumeAvailable; + self.equalizerAvailable = equalizerAvailable; + self.equalizerMaxChannelId = equalizerMaxChannelID; + + return self; + +} + + - (void)setModuleName:(NSString *)moduleName { [self.store sdl_setObject:moduleName forName:SDLRPCParameterNameModuleName]; } diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.m b/SmartDeviceLink/SDLClimateControlCapabilities.m index 05c83b32c..6280bef61 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.m +++ b/SmartDeviceLink/SDLClimateControlCapabilities.m @@ -23,7 +23,7 @@ - (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOO if (!self) { return nil; } - + self.moduleName = moduleName; self.fanSpeedAvailable = @(fanSpeedAvailable); self.desiredTemperatureAvailable = @(desiredTemperatureAvailable); @@ -42,6 +42,30 @@ - (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOO return self; } +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)heatedSteeringWheelAvailable heatedWindshieldAvailable:(BOOL)heatedWindshieldAvailable heatedRearWindowAvailable:(BOOL)heatedRearWindowAvailable heatedMirrorsAvailable:(BOOL)heatedMirrorsAvailable { + self = [self init]; + if (!self) { + return nil; + } + + self.moduleName = moduleName; + self.moduleInfo = moduleInfo; + self.fanSpeedAvailable = @(fanSpeedAvailable); + self.desiredTemperatureAvailable = @(desiredTemperatureAvailable); + self.acEnableAvailable = @(acEnableAvailable); + self.acMaxEnableAvailable = @(acMaxEnableAvailable); + self.circulateAirEnableAvailable = @(circulateAirEnableAvailable); + self.autoModeEnableAvailable = @(autoModeEnableAvailable); + self.dualModeEnableAvailable = @(dualModeEnableAvailable); + self.defrostZoneAvailable = @(defrostZoneAvailable); + self.ventilationModeAvailable = @(ventilationModeAvailable); + self.heatedSteeringWheelAvailable = @(heatedSteeringWheelAvailable); + self.heatedWindshieldAvailable = @(heatedWindshieldAvailable); + self.heatedRearWindowAvailable = @(heatedRearWindowAvailable); + self.heatedMirrorsAvailable = @(heatedMirrorsAvailable); + return self; +} + - (void)setModuleName:(NSString *)moduleName { [self.store sdl_setObject:moduleName forName:SDLRPCParameterNameModuleName]; } diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h index a4c6ce8b2..f42c95f88 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h @@ -15,7 +15,17 @@ NS_ASSUME_NONNULL_BEGIN @return An instance of the SDLHMISettingsControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName; +- (instancetype)initWithModuleName:(NSString *)moduleName __deprecated_msg("Use initWithModuleName:moduleInfo:"); + +/** + Constructs a newly allocated SDLHMISettingsControlCapabilities object with moduleName + + @param moduleName The short friendly name of the hmi setting module + @param moduleInfo Information about a RC module, including its id. + + @return An instance of the SDLHMISettingsControlCapabilities class + */ +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo; /** Constructs a newly allocated SDLHMISettingsControlCapabilities object with given parameters @@ -27,7 +37,20 @@ NS_ASSUME_NONNULL_BEGIN @return An instance of the SDLHMISettingsControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable; +- (instancetype)initWithModuleName:(NSString *)moduleName distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable __deprecated_msg("Use initWithModuleName:moduleInfo:distanceUnitAvailable:distanceUnitAvailable:temperatureUnitAvailable:displayModeUnitAvailable:"); + +/** + Constructs a newly allocated SDLHMISettingsControlCapabilities object with given parameters + + @param moduleName The short friendly name of the hmi setting module. + @param moduleInfo Information about a RC module, including its id. + @param distanceUnitAvailable Availability of the control of distance unit. + @param temperatureUnitAvailable Availability of the control of temperature unit. + @param displayModeUnitAvailable Availability of the control of displayMode unit. + + @return An instance of the SDLHMISettingsControlCapabilities class + */ +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable; /** * @abstract The short friendly name of the hmi setting module. diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m index e44ef104d..a9a76b3fe 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m @@ -19,6 +19,17 @@ - (instancetype)initWithModuleName:(NSString *)moduleName { return self; } +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo { + self = [self init]; + if(!self) { + return nil; + } + self.moduleName = moduleName; + self.moduleInfo = moduleInfo; + + return self; +} + - (instancetype)initWithModuleName:(NSString *)moduleName distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable { self = [self init]; if(!self) { @@ -32,6 +43,20 @@ - (instancetype)initWithModuleName:(NSString *)moduleName distanceUnitAvailable: return self; } +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable { + self = [self init]; + if(!self) { + return nil; + } + self.moduleName = moduleName; + self.moduleInfo = moduleInfo; + self.distanceUnitAvailable = @(distanceUnitAvailable); + self.temperatureUnitAvailable = @(temperatureUnitAvailable); + self.displayModeUnitAvailable = @(displayModeUnitAvailable); + + return self; +} + - (void)setModuleName:(NSString *)moduleName { [self.store sdl_setObject:moduleName forName:SDLRPCParameterNameModuleName]; } diff --git a/SmartDeviceLink/SDLLightControlCapabilities.h b/SmartDeviceLink/SDLLightControlCapabilities.h index 72db659fe..aebb7a14f 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.h +++ b/SmartDeviceLink/SDLLightControlCapabilities.h @@ -18,7 +18,18 @@ NS_ASSUME_NONNULL_BEGIN @param supportedLights array of available LightCapabilities @return An instance of the SDLLightControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName supportedLights:(NSArray *)supportedLights; +- (instancetype)initWithModuleName:(NSString *)moduleName supportedLights:(NSArray *)supportedLights __deprecated_msg("Use initWithModuleName:moduleInfo:supportedLights:"); + +/** + Constructs a newly allocated SDLLightControlCapabilities object with given parameters + + + @param moduleName friendly name of the light control module + @param moduleInfo information about a RC module, including its id + @param supportedLights array of available LightCapabilities + @return An instance of the SDLLightControlCapabilities class + */ +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights; /** * @abstract The short friendly name of the light control module. diff --git a/SmartDeviceLink/SDLLightControlCapabilities.m b/SmartDeviceLink/SDLLightControlCapabilities.m index ec55c81c2..7f261b2e3 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.m +++ b/SmartDeviceLink/SDLLightControlCapabilities.m @@ -22,6 +22,18 @@ - (instancetype)initWithModuleName:(NSString *)moduleName supportedLights:(NSArr return self; } +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights { + self = [self init]; + if(!self) { + return nil; + } + self.moduleName = moduleName; + self.moduleInfo = moduleInfo; + self.supportedLights = supportedLights; + + return self; +} + - (void)setModuleName:(NSString *)moduleName { [self.store sdl_setObject:moduleName forName:SDLRPCParameterNameModuleName]; } diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.h b/SmartDeviceLink/SDLSeatControlCapabilities.h index 1e472ec76..7806375f9 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.h +++ b/SmartDeviceLink/SDLSeatControlCapabilities.h @@ -12,10 +12,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface SDLSeatControlCapabilities : SDLRPCStruct -- (instancetype)initWithName:(NSString *)moduleName; +- (instancetype)initWithName:(NSString *)moduleName __deprecated_msg("Use initWithName:moduleInfo:"); + +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo; - (instancetype)initWithName:(NSString *)moduleName heatingEnabledAvailable:(BOOL)heatingEnabledAvail - coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail; + coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail __deprecated_msg("Use initWithName:moduleInfo:heatingEnabledAvailable:coolingEnabledAvailable:heatingLevelAvailable:coolingLevelAvailable:horizontalPositionAvailable:verticalPositionAvailable:frontVerticalPositionAvailable:backVerticalPositionAvailable:backTiltAngleAvailable:headSupportHorizontalPositionAvailable:headSupportVerticalPositionAvailable:massageEnabledAvailable:massageModeAvailable:massageCushionFirmnessAvailable:memoryAvailable:"); + +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(BOOL)heatingEnabledAvail + coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail; + /** * @abstract The short friendly name of the light control module. * It should not be used to identify a module by mobile application. diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.m b/SmartDeviceLink/SDLSeatControlCapabilities.m index ac0deac4c..eb1f3a002 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.m +++ b/SmartDeviceLink/SDLSeatControlCapabilities.m @@ -16,6 +16,14 @@ - (instancetype)initWithName:(NSString *)moduleName { return self; } +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo { + if (self = [super init]) { + self.moduleName = moduleName; + self.moduleInfo = moduleInfo; + } + return self; +} + - (instancetype)initWithName:(NSString *)moduleName heatingEnabledAvailable:(BOOL)heatingEnabledAvail coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail { self = [super init]; @@ -43,6 +51,35 @@ - (instancetype)initWithName:(NSString *)moduleName heatingEnabledAvailable:(BOO return self; } +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(BOOL)heatingEnabledAvail + coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail { + + self = [super init]; + if (!self) { + return nil; + } + + self.moduleName = moduleName; + self.moduleInfo = moduleInfo; + self.heatingEnabledAvailable = @(heatingEnabledAvail); + self.coolingEnabledAvailable = @(coolingEnabledAvail); + self.heatingLevelAvailable = @(heatingLevelAvail); + self.coolingLevelAvailable = @(coolingLevelAvail); + self.horizontalPositionAvailable = @(horizontalPositionAvail); + self.verticalPositionAvailable = @(verticalPositionAvail); + self.frontVerticalPositionAvailable = @(frontVerticalPositionAvail); + self.backVerticalPositionAvailable = @(backVerticalPositionAvail); + self.backTiltAngleAvailable = @(backTitlAngleAvail); + self.headSupportVerticalPositionAvailable = @(headSupportVerticalPositionAvail); + self.headSupportHorizontalPositionAvailable = @(headSupportHorizontalPositionAvail); + self.massageEnabledAvailable = @(massageEnabledAvail); + self.massageModeAvailable = @(massageModeAvail); + self.massageCushionFirmnessAvailable = @(massageCushionFirmnessAvail); + self.memoryAvailable = @(memoryAvail); + + return self; +} + - (void)setModuleName:(NSString *)moduleName { [self.store sdl_setObject:moduleName forName:SDLRPCParameterNameModuleName]; } diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m index d4ba87009..d23b64eba 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLAudioControlCapabilitiesSpec.m @@ -15,10 +15,28 @@ QuickSpecBegin( SDLAudioControlCapabilitiesSpec) describe(@"Getter/Setter Tests", ^ { + __block SDLModuleInfo *testModuleInfo = nil; + __block SDLGrid *testGird = nil; + + beforeEach(^{ + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + testModuleInfo = [[SDLModuleInfo alloc] init]; + testModuleInfo.moduleId = @"123"; + testModuleInfo.allowMultipleAccess = @YES; + testModuleInfo.serviceArea = testGird; + testModuleInfo.location = testGird; + }); + it(@"Should set and get correctly", ^ { SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] init]; testStruct.moduleName = @"module"; + testStruct.moduleInfo = testModuleInfo; testStruct.sourceAvailable = @(YES); testStruct.keepContextAvailable = @YES; testStruct.volumeAvailable = @(NO); @@ -26,6 +44,7 @@ testStruct.equalizerMaxChannelId = @56; expect(testStruct.moduleName).to(equal(@"module")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.keepContextAvailable).to(equal(@YES)); expect(testStruct.sourceAvailable).to(equal(@(YES))); expect(testStruct.volumeAvailable).to(equal(@(NO))); @@ -34,9 +53,13 @@ }); it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] initWithModuleName:@"module"]; +#pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"module")); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.sourceAvailable).to(beNil()); expect(testStruct.keepContextAvailable).to(beNil()); expect(testStruct.volumeAvailable).to(beNil()); @@ -45,9 +68,40 @@ }); it(@"Should set and get correctly", ^ { + SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] initWithModuleName:@"module" moduleInfo:testModuleInfo]; + + expect(testStruct.moduleName).to(equal(@"module")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); + expect(testStruct.sourceAvailable).to(beNil()); + expect(testStruct.keepContextAvailable).to(beNil()); + expect(testStruct.volumeAvailable).to(beNil()); + expect(testStruct.equalizerAvailable).to(beNil()); + expect(testStruct.equalizerMaxChannelId).to(beNil()); + }); + + it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] initWithModuleName:@"module" sourceAvailable:@NO keepContextAvailable:@NO volumeAvailable:@YES equalizerAvailable:@NO equalizerMaxChannelID:@34]; +#pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"module")); + expect(testStruct.moduleInfo).to(beNil()); + expect(testStruct.sourceAvailable).to(equal(@(NO))); + expect(testStruct.keepContextAvailable).to(equal(@NO)); + expect(testStruct.volumeAvailable).to(equal(@(YES))); + expect(testStruct.equalizerAvailable).to(equal(@(NO))); + expect(testStruct.equalizerMaxChannelId).to(equal(@34)); + }); + + it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] initWithModuleName:@"module" moduleInfo:testModuleInfo sourceAvailable:@NO keepContextAvailable:@NO volumeAvailable:@YES equalizerAvailable:@NO equalizerMaxChannelID:@34]; +#pragma clang diagnostic pop + + expect(testStruct.moduleName).to(equal(@"module")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.sourceAvailable).to(equal(@(NO))); expect(testStruct.keepContextAvailable).to(equal(@NO)); expect(testStruct.volumeAvailable).to(equal(@(YES))); @@ -55,8 +109,10 @@ expect(testStruct.equalizerMaxChannelId).to(equal(@34)); }); + it(@"Should get correctly when initialized", ^ { NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName:@"module", + SDLRPCParameterNameModuleInfo:testModuleInfo, SDLRPCParameterNameSourceAvailable:@(NO), SDLRPCParameterNameKeepContextAvailable: @YES, SDLRPCParameterNameVolumeAvailable:@(YES), @@ -69,6 +125,7 @@ #pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"module")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.sourceAvailable).to(equal(@(NO))); expect(testStruct.keepContextAvailable).to(equal(@YES)); expect(testStruct.volumeAvailable).to(equal(@(YES))); @@ -81,6 +138,7 @@ SDLAudioControlCapabilities* testStruct = [[SDLAudioControlCapabilities alloc] init]; expect(testStruct.moduleName).to(beNil()); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.sourceAvailable).to(beNil()); expect(testStruct.keepContextAvailable).to(beNil()); expect(testStruct.volumeAvailable).to(beNil()); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLButtonCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLButtonCapabilitiesSpec.m index f60e67998..eb3f8eea5 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLButtonCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLButtonCapabilitiesSpec.m @@ -16,6 +16,23 @@ QuickSpecBegin(SDLButtonCapabilitiesSpec) describe(@"Getter/Setter Tests", ^ { + __block SDLModuleInfo *testModuleInfo = nil; + __block SDLGrid *testGird = nil; + + beforeEach(^{ + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + testModuleInfo = [[SDLModuleInfo alloc] init]; + testModuleInfo.moduleId = @"123"; + testModuleInfo.allowMultipleAccess = @YES; + testModuleInfo.serviceArea = testGird; + testModuleInfo.location = testGird; + }); + it(@"Should set and get correctly", ^ { SDLButtonCapabilities* testStruct = [[SDLButtonCapabilities alloc] init]; @@ -25,6 +42,7 @@ testStruct.upDownAvailable = @NO; expect(testStruct.name).to(equal(SDLButtonNameTuneUp)); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.shortPressAvailable).to(equal(@YES)); expect(testStruct.longPressAvailable).to(equal(@YES)); expect(testStruct.upDownAvailable).to(equal(@NO)); @@ -32,6 +50,7 @@ it(@"Should get correctly when initialized", ^ { NSMutableDictionary* dict = [@{SDLRPCParameterNameName:SDLButtonNameCustomButton, + SDLRPCParameterNameModuleInfo:testModuleInfo, SDLRPCParameterNameShortPressAvailable:@YES, SDLRPCParameterNameLongPressAvailable:@YES, SDLRPCParameterNameUpDownAvailable:@NO} mutableCopy]; @@ -41,6 +60,7 @@ #pragma clang diagnostic pop expect(testStruct.name).to(equal(SDLButtonNameCustomButton)); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.shortPressAvailable).to(equal(@YES)); expect(testStruct.longPressAvailable).to(equal(@YES)); expect(testStruct.upDownAvailable).to(equal(@NO)); @@ -50,6 +70,7 @@ SDLButtonCapabilities* testStruct = [[SDLButtonCapabilities alloc] init]; expect(testStruct.name).to(beNil()); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.shortPressAvailable).to(beNil()); expect(testStruct.longPressAvailable).to(beNil()); expect(testStruct.upDownAvailable).to(beNil()); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlCapabilitiesSpec.m index 41b919542..ce3b93301 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLClimateControlCapabilitiesSpec.m @@ -17,10 +17,28 @@ QuickSpecBegin(SDLClimateControlCapabilitiesSpec) describe(@"Getter/Setter Tests", ^ { + __block SDLModuleInfo *testModuleInfo = nil; + __block SDLGrid *testGird = nil; + + beforeEach(^{ + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + testModuleInfo = [[SDLModuleInfo alloc] init]; + testModuleInfo.moduleId = @"123"; + testModuleInfo.allowMultipleAccess = @YES; + testModuleInfo.serviceArea = testGird; + testModuleInfo.location = testGird; + }); + it(@"Should set and get correctly", ^ { SDLClimateControlCapabilities* testStruct = [[SDLClimateControlCapabilities alloc] init]; testStruct.moduleName = @"Name"; + testStruct.moduleInfo = testModuleInfo; testStruct.fanSpeedAvailable = @YES; testStruct.desiredTemperatureAvailable = @NO; testStruct.acEnableAvailable = @NO; @@ -39,6 +57,7 @@ testStruct.climateEnableAvailable = @(NO); expect(testStruct.moduleName).to(equal(@"Name")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.fanSpeedAvailable).to(equal(@YES)); expect(testStruct.desiredTemperatureAvailable).to(equal(@NO)); expect(testStruct.acEnableAvailable).to(equal(@NO)); @@ -60,6 +79,7 @@ it(@"Should get correctly when initialized", ^ { NSMutableDictionary *dict = [@{SDLRPCParameterNameModuleName:@"Name", + SDLRPCParameterNameModuleInfo:testModuleInfo, SDLRPCParameterNameFanSpeedAvailable:@YES, SDLRPCParameterNameDesiredTemperatureAvailable:@NO, SDLRPCParameterNameACEnableAvailable:@NO, @@ -83,6 +103,7 @@ #pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"Name")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.fanSpeedAvailable).to(equal(@YES)); expect(testStruct.desiredTemperatureAvailable).to(equal(@NO)); expect(testStruct.acEnableAvailable).to(equal(@NO)); @@ -107,6 +128,7 @@ SDLClimateControlCapabilities* testStruct = [[SDLClimateControlCapabilities alloc] initWithModuleName:@"Name" fanSpeedAvailable:YES desiredTemperatureAvailable:NO acEnableAvailable:NO acMaxEnableAvailable:YES circulateAirAvailable:NO autoModeEnableAvailable:NO dualModeEnableAvailable:NO defrostZoneAvailable:YES ventilationModeAvailable:YES]; expect(testStruct.moduleName).to(equal(@"Name")); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.fanSpeedAvailable).to(equal(@YES)); expect(testStruct.desiredTemperatureAvailable).to(equal(@NO)); expect(testStruct.acEnableAvailable).to(equal(@NO)); @@ -128,8 +150,10 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLClimateControlCapabilities* testStruct = [[SDLClimateControlCapabilities alloc] initWithModuleName:@"Name" fanSpeedAvailable:YES desiredTemperatureAvailable:NO acEnableAvailable:NO acMaxEnableAvailable:YES circulateAirAvailable:NO autoModeEnableAvailable:NO dualModeEnableAvailable:NO defrostZoneAvailable:YES ventilationModeAvailable:YES heatedSteeringWheelAvailable:YES heatedWindshieldAvailable:NO heatedRearWindowAvailable:YES heatedMirrorsAvailable:NO]; +#pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"Name")); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.fanSpeedAvailable).to(equal(@YES)); expect(testStruct.desiredTemperatureAvailable).to(equal(@NO)); expect(testStruct.acEnableAvailable).to(equal(@NO)); @@ -170,6 +194,7 @@ SDLClimateControlCapabilities* testStruct = [[SDLClimateControlCapabilities alloc] init]; expect(testStruct.moduleName).to(beNil()); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.fanSpeedAvailable).to(beNil()); expect(testStruct.desiredTemperatureAvailable).to(beNil()); expect(testStruct.acEnableAvailable).to(beNil()); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlCapabilitiesSpec.m index 7b766f176..9906477d4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLHMISettingsControlCapabilitiesSpec.m @@ -15,33 +15,83 @@ QuickSpecBegin(SDLHMISettingsControlCapabilitiesSpec) describe(@"Getter/Setter Tests", ^ { + __block SDLModuleInfo *testModuleInfo = nil; + __block SDLGrid *testGird = nil; + + beforeEach(^{ + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + testModuleInfo = [[SDLModuleInfo alloc] init]; + testModuleInfo.moduleId = @"123"; + testModuleInfo.allowMultipleAccess = @YES; + testModuleInfo.serviceArea = testGird; + testModuleInfo.location = testGird; + }); + it(@"Should set and get correctly", ^ { SDLHMISettingsControlCapabilities* testStruct = [[SDLHMISettingsControlCapabilities alloc] init]; testStruct.moduleName = @"displayMode"; + testStruct.moduleInfo = testModuleInfo; testStruct.distanceUnitAvailable = @(NO); testStruct.temperatureUnitAvailable = @(NO); testStruct.displayModeUnitAvailable = @(YES); expect(testStruct.moduleName).to(equal(@"displayMode")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.distanceUnitAvailable).to(equal(@(NO))); expect(testStruct.temperatureUnitAvailable).to(equal(@(NO))); expect(testStruct.displayModeUnitAvailable).to(equal(@(YES))); }); it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLHMISettingsControlCapabilities* testStruct = [[SDLHMISettingsControlCapabilities alloc] initWithModuleName:@"displayMode"]; +#pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"displayMode")); + expect(testStruct.moduleInfo).to(beNil()); + expect(testStruct.distanceUnitAvailable).to(beNil()); + expect(testStruct.temperatureUnitAvailable).to(beNil()); + expect(testStruct.displayModeUnitAvailable).to(beNil()); + }); + + it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLHMISettingsControlCapabilities* testStruct = [[SDLHMISettingsControlCapabilities alloc] initWithModuleName:@"displayMode" moduleInfo:testModuleInfo]; +#pragma clang diagnostic pop + + expect(testStruct.moduleName).to(equal(@"displayMode")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.distanceUnitAvailable).to(beNil()); expect(testStruct.temperatureUnitAvailable).to(beNil()); expect(testStruct.displayModeUnitAvailable).to(beNil()); }); it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLHMISettingsControlCapabilities* testStruct = [[SDLHMISettingsControlCapabilities alloc] initWithModuleName:@"displayMode" distanceUnitAvailable:NO temperatureUnitAvailable:YES displayModeUnitAvailable:NO]; +#pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"displayMode")); + expect(testStruct.moduleInfo).to(beNil()); + expect(testStruct.distanceUnitAvailable).to(equal(@(NO))); + expect(testStruct.temperatureUnitAvailable).to(equal(@(YES))); + expect(testStruct.displayModeUnitAvailable).to(equal(@(NO))); + }); + + it(@"Should set and get correctly", ^ { + SDLHMISettingsControlCapabilities* testStruct = [[SDLHMISettingsControlCapabilities alloc] initWithModuleName:@"displayMode" moduleInfo:testModuleInfo distanceUnitAvailable:NO temperatureUnitAvailable:YES displayModeUnitAvailable:NO]; + + expect(testStruct.moduleName).to(equal(@"displayMode")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.distanceUnitAvailable).to(equal(@(NO))); expect(testStruct.temperatureUnitAvailable).to(equal(@(YES))); expect(testStruct.displayModeUnitAvailable).to(equal(@(NO))); @@ -49,6 +99,7 @@ it(@"Should get correctly when initialized", ^ { NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName:@"temperatureUnit", + SDLRPCParameterNameModuleInfo:testModuleInfo, SDLRPCParameterNameTemperatureUnitAvailable:@(YES), SDLRPCParameterNameDistanceUnitAvailable:@(YES), SDLRPCParameterNameDisplayModeUnitAvailable:@(NO) @@ -59,6 +110,7 @@ #pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"temperatureUnit")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.distanceUnitAvailable).to(equal(@(YES))); expect(testStruct.temperatureUnitAvailable).to(equal(@(YES))); expect(testStruct.displayModeUnitAvailable).to(equal(@(NO))); @@ -69,6 +121,7 @@ SDLHMISettingsControlCapabilities* testStruct = [[SDLHMISettingsControlCapabilities alloc] init]; expect(testStruct.moduleName).to(beNil()); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.distanceUnitAvailable).to(beNil()); expect(testStruct.temperatureUnitAvailable).to(beNil()); expect(testStruct.displayModeUnitAvailable).to(beNil()); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlCapabilitiesSpec.m index 7531a4813..404dc2aeb 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLLightControlCapabilitiesSpec.m @@ -17,27 +17,60 @@ SDLLightCapabilities* somelightCapabilities = [[SDLLightCapabilities alloc] init]; describe(@"Getter/Setter Tests", ^ { + __block SDLModuleInfo *testModuleInfo = nil; + __block SDLGrid *testGird = nil; + + beforeEach(^{ + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + testModuleInfo = [[SDLModuleInfo alloc] init]; + testModuleInfo.moduleId = @"123"; + testModuleInfo.allowMultipleAccess = @YES; + testModuleInfo.serviceArea = testGird; + testModuleInfo.location = testGird; + }); + it(@"Should set and get correctly", ^ { SDLLightControlCapabilities* testStruct = [[SDLLightControlCapabilities alloc] init]; testStruct.moduleName = @"moduleName"; + testStruct.moduleInfo = testModuleInfo; testStruct.supportedLights = [@[somelightCapabilities] copy]; expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.supportedLights).to(equal([@[somelightCapabilities] copy])); }); it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLLightControlCapabilities* testStruct = [[SDLLightControlCapabilities alloc] initWithModuleName:@"moduleName" supportedLights:[@[somelightCapabilities] copy]]; +#pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.supportedLights).to(equal([@[somelightCapabilities] copy])); }); + it(@"Should set and get correctly", ^ { + SDLLightControlCapabilities* testStruct = [[SDLLightControlCapabilities alloc] initWithModuleName:@"moduleName" moduleInfo:testModuleInfo supportedLights:[@[somelightCapabilities] copy]]; + + expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); + expect(testStruct.supportedLights).to(equal([@[somelightCapabilities] copy])); + + }); + it(@"Should get correctly when initialized", ^ { NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName:@"moduleName", + SDLRPCParameterNameModuleInfo:testModuleInfo, SDLRPCParameterNameSupportedLights:[@[somelightCapabilities] copy] } mutableCopy]; #pragma clang diagnostic push @@ -46,6 +79,7 @@ #pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.supportedLights).to(equal([@[somelightCapabilities] copy])); }); @@ -53,6 +87,7 @@ SDLLightControlCapabilities* testStruct = [[SDLLightControlCapabilities alloc] init]; expect(testStruct.moduleName).to(beNil()); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.supportedLights).to(beNil()); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m index e68ee0af2..be3e81380 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m @@ -14,11 +14,28 @@ QuickSpecBegin(SDLRadioControlCapabilitiesSpec) describe(@"Initialization tests", ^{ + __block SDLModuleInfo *testModuleInfo = nil; + __block SDLGrid *testGird = nil; + beforeEach(^{ + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + testModuleInfo = [[SDLModuleInfo alloc] init]; + testModuleInfo.moduleId = @"123"; + testModuleInfo.allowMultipleAccess = @YES; + testModuleInfo.serviceArea = testGird; + testModuleInfo.location = testGird; + }); + it(@"should properly initialize init", ^{ SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] init]; expect(testStruct.moduleName).to(beNil()); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.radioEnableAvailable).to(beNil()); expect(testStruct.radioBandAvailable).to(beNil()); expect(testStruct.radioFrequencyAvailable).to(beNil()); @@ -43,6 +60,7 @@ it(@"should properly initialize initWithDictionary", ^{ NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName : @"someName", + SDLRPCParameterNameModuleInfo: testModuleInfo, SDLRPCParameterNameRadioEnableAvailable : @YES, SDLRPCParameterNameRadioBandAvailable : @YES, SDLRPCParameterNameRadioFrequencyAvailable : @YES, @@ -55,7 +73,7 @@ SDLRPCParameterNameSignalChangeThresholdAvailable : @NO, SDLRPCParameterNameHDRadioEnableAvailable : @YES, SDLRPCParameterNameSiriusXMRadioAvailable : @NO, - SDLRPCParameterNameSISDataAvailable:@YES + SDLRPCParameterNameSISDataAvailable: @YES } mutableCopy]; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -63,6 +81,7 @@ #pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"someName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.radioEnableAvailable).to(equal(@YES)); expect(testStruct.radioBandAvailable).to(equal(@YES)); expect(testStruct.radioFrequencyAvailable).to(equal(@YES)); @@ -88,6 +107,7 @@ SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] init]; testStruct.moduleName = @"someName"; + testStruct.moduleInfo = testModuleInfo; testStruct.radioEnableAvailable = @YES; testStruct.radioBandAvailable = @YES; testStruct.radioFrequencyAvailable = @YES; @@ -108,6 +128,7 @@ testStruct.sisDataAvailable = @YES; expect(testStruct.moduleName).to(equal(@"someName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.radioEnableAvailable).to(equal(@YES)); expect(testStruct.radioBandAvailable).to(equal(@YES)); expect(testStruct.radioFrequencyAvailable).to(equal(@YES)); @@ -154,6 +175,7 @@ SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] initWithModuleName:@"someName" radioEnableAvailable:YES radioBandAvailable:NO radioFrequencyAvailable:YES hdChannelAvailable:NO rdsDataAvailable:NO availableHDsAvailable:NO stateAvailable:YES signalStrengthAvailable:YES signalChangeThresholdAvailable:NO]; expect(testStruct.moduleName).to(equal(@"someName")); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.radioEnableAvailable).to(equal(@YES)); expect(testStruct.radioBandAvailable).to(equal(@NO)); expect(testStruct.radioFrequencyAvailable).to(equal(@YES)); @@ -171,11 +193,14 @@ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" it(@"Should get correctly when initialized with Module Name and other radio control capabilite's parameters", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] initWithModuleName:@"someName" radioEnableAvailable:YES radioBandAvailable:NO radioFrequencyAvailable:YES hdChannelAvailable:NO rdsDataAvailable:NO availableHDsAvailable:NO stateAvailable:YES signalStrengthAvailable:YES signalChangeThresholdAvailable:NO hdRadioEnableAvailable:YES siriusXMRadioAvailable:YES sisDataAvailable:YES]; #pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"someName")); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.radioEnableAvailable).to(equal(@YES)); expect(testStruct.radioBandAvailable).to(equal(@NO)); expect(testStruct.radioFrequencyAvailable).to(equal(@YES)); @@ -195,6 +220,27 @@ expect(testStruct.sisDataAvailable).to(equal(@YES)); }); + + it(@"Should get correctly when initialized with Module Name and other radio control capabilite's parameters", ^ { + SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] initWithModuleName:@"someName" moduleInfo:testModuleInfo radioEnableAvailable:YES radioBandAvailable:NO radioFrequencyAvailable:YES hdChannelAvailable:NO rdsDataAvailable:NO availableHDsAvailable:NO stateAvailable:YES signalStrengthAvailable:YES signalChangeThresholdAvailable:NO hdRadioEnableAvailable:YES siriusXMRadioAvailable:YES sisDataAvailable:YES]; + + expect(testStruct.moduleName).to(equal(@"someName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); + expect(testStruct.radioEnableAvailable).to(equal(@YES)); + expect(testStruct.radioBandAvailable).to(equal(@NO)); + expect(testStruct.radioFrequencyAvailable).to(equal(@YES)); + expect(testStruct.hdChannelAvailable).to(equal(@NO)); + expect(testStruct.rdsDataAvailable).to(equal(@NO)); + expect(testStruct.availableHDsAvailable).to(equal(@NO)); + expect(testStruct.stateAvailable).to(equal(@YES)); + expect(testStruct.signalStrengthAvailable).to(equal(@YES)); + expect(testStruct.signalChangeThresholdAvailable).to(equal(@NO)); + expect(testStruct.hdRadioEnableAvailable).to(equal(YES)); + expect(testStruct.siriusXMRadioAvailable).to(equal(@YES)); + expect(testStruct.sisDataAvailable).to(equal(@YES)); + + }); + }); QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlCapabilitiesSpec.m index bb320be41..31912578d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatControlCapabilitiesSpec.m @@ -16,10 +16,28 @@ QuickSpecBegin(SDLSeatControlCapabilitiesSpec) describe(@"Getter/Setter Tests", ^ { + __block SDLModuleInfo *testModuleInfo = nil; + __block SDLGrid *testGird = nil; + + beforeEach(^{ + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + testModuleInfo = [[SDLModuleInfo alloc] init]; + testModuleInfo.moduleId = @"123"; + testModuleInfo.allowMultipleAccess = @YES; + testModuleInfo.serviceArea = testGird; + testModuleInfo.location = testGird; + }); + it(@"Should set and get correctly", ^ { SDLSeatControlCapabilities* testStruct = [[SDLSeatControlCapabilities alloc] init]; testStruct.moduleName = @"moduleName"; + testStruct.moduleInfo = testModuleInfo; testStruct.heatingEnabledAvailable = @YES; testStruct.coolingEnabledAvailable = @NO; testStruct.heatingLevelAvailable = @YES; @@ -37,6 +55,7 @@ testStruct.memoryAvailable = @NO; expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.heatingEnabledAvailable).to(equal(@YES)); expect(testStruct.coolingEnabledAvailable).to(equal(@NO)); expect(testStruct.heatingLevelAvailable).to(equal(@YES)); @@ -56,9 +75,13 @@ }); it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLSeatControlCapabilities* testStruct = [[SDLSeatControlCapabilities alloc] initWithName:@"moduleName" heatingEnabledAvailable:YES coolingEnabledAvailable:NO heatingLevelAvailable:YES coolingLevelAvailable:NO horizontalPositionAvailable:NO verticalPositionAvailable:NO frontVerticalPositionAvailable:NO backVerticalPositionAvailable:NO backTiltAngleAvailable:YES headSupportHorizontalPositionAvailable:NO headSupportVerticalPositionAvailable:YES massageEnabledAvailable:NO massageModeAvailable:YES massageCushionFirmnessAvailable:NO memoryAvailable:YES]; +#pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.heatingEnabledAvailable).to(equal(@YES)); expect(testStruct.coolingEnabledAvailable).to(equal(@NO)); expect(testStruct.heatingLevelAvailable).to(equal(@YES)); @@ -78,9 +101,13 @@ }); it(@"Should set and get correctly", ^ { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLSeatControlCapabilities* testStruct = [[SDLSeatControlCapabilities alloc] initWithName:@"moduleName"]; +#pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.heatingEnabledAvailable).to(beNil()); expect(testStruct.heatingEnabledAvailable).to(beNil()); expect(testStruct.heatingLevelAvailable).to(beNil()); @@ -98,9 +125,56 @@ expect(testStruct.memoryAvailable).to(beNil()); }); + + it(@"Should set and get correctly", ^ { + SDLSeatControlCapabilities* testStruct = [[SDLSeatControlCapabilities alloc] initWithName:@"moduleName" moduleInfo:testModuleInfo]; + + expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); + expect(testStruct.heatingEnabledAvailable).to(beNil()); + expect(testStruct.heatingEnabledAvailable).to(beNil()); + expect(testStruct.heatingLevelAvailable).to(beNil()); + expect(testStruct.coolingLevelAvailable).to(beNil()); + expect(testStruct.horizontalPositionAvailable).to(beNil()); + expect(testStruct.verticalPositionAvailable).to(beNil()); + expect(testStruct.frontVerticalPositionAvailable).to(beNil()); + expect(testStruct.backVerticalPositionAvailable).to(beNil()); + expect(testStruct.backTiltAngleAvailable).to(beNil()); + expect(testStruct.headSupportHorizontalPositionAvailable).to(beNil()); + expect(testStruct.headSupportVerticalPositionAvailable).to(beNil()); + expect(testStruct.massageEnabledAvailable).to(beNil()); + expect(testStruct.massageModeAvailable).to(beNil()); + expect(testStruct.massageCushionFirmnessAvailable).to(beNil()); + expect(testStruct.memoryAvailable).to(beNil()); + + }); + + it(@"Should set and get correctly", ^ { + SDLSeatControlCapabilities* testStruct = [[SDLSeatControlCapabilities alloc] initWithName:@"moduleName" moduleInfo:testModuleInfo heatingEnabledAvailable:YES coolingEnabledAvailable:NO heatingLevelAvailable:YES coolingLevelAvailable:NO horizontalPositionAvailable:NO verticalPositionAvailable:NO frontVerticalPositionAvailable:NO backVerticalPositionAvailable:NO backTiltAngleAvailable:YES headSupportHorizontalPositionAvailable:NO headSupportVerticalPositionAvailable:YES massageEnabledAvailable:NO massageModeAvailable:YES massageCushionFirmnessAvailable:NO memoryAvailable:YES]; + + expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); + expect(testStruct.heatingEnabledAvailable).to(equal(@YES)); + expect(testStruct.coolingEnabledAvailable).to(equal(@NO)); + expect(testStruct.heatingLevelAvailable).to(equal(@YES)); + expect(testStruct.coolingLevelAvailable).to(equal(@NO)); + expect(testStruct.horizontalPositionAvailable).to(equal(@NO)); + expect(testStruct.verticalPositionAvailable).to(equal(@NO)); + expect(testStruct.frontVerticalPositionAvailable).to(equal(@NO)); + expect(testStruct.backVerticalPositionAvailable).to(equal(@NO)); + expect(testStruct.backTiltAngleAvailable).to(equal(@YES)); + expect(testStruct.headSupportHorizontalPositionAvailable).to(equal(@NO)); + expect(testStruct.headSupportVerticalPositionAvailable).to(equal(@YES)); + expect(testStruct.massageEnabledAvailable).to(equal(@NO)); + expect(testStruct.massageModeAvailable).to(equal(@YES)); + expect(testStruct.massageCushionFirmnessAvailable).to(equal(@NO)); + expect(testStruct.memoryAvailable).to(equal(@YES)); + + }); it(@"Should get correctly when initialized", ^ { NSMutableDictionary* dict = [@{SDLRPCParameterNameModuleName:@"moduleName", + SDLRPCParameterNameModuleInfo:testModuleInfo, SDLRPCParameterNameHeatingEnabledAvailable:(@YES), SDLRPCParameterNameCoolingEnabledAvailable:@YES, SDLRPCParameterNameHeatingLevelAvailable:@YES, @@ -123,6 +197,7 @@ #pragma clang diagnostic pop expect(testStruct.moduleName).to(equal(@"moduleName")); + expect(testStruct.moduleInfo).to(equal(testModuleInfo)); expect(testStruct.heatingEnabledAvailable).to(equal(@YES)); expect(testStruct.coolingEnabledAvailable).to(equal(@YES)); expect(testStruct.heatingLevelAvailable).to(equal(@YES)); @@ -144,6 +219,7 @@ SDLSeatControlCapabilities* testStruct = [[SDLSeatControlCapabilities alloc] init]; expect(testStruct.moduleName).to(beNil()); + expect(testStruct.moduleInfo).to(beNil()); expect(testStruct.heatingEnabledAvailable).to(beNil()); expect(testStruct.heatingEnabledAvailable).to(beNil()); expect(testStruct.heatingLevelAvailable).to(beNil()); From 252fbb398e994d69de56ec739755c670df84118a Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Sun, 28 Jul 2019 23:53:37 -0700 Subject: [PATCH 12/35] Properly decreate enum Fix SDL warning --- Example Apps/Example ObjC/VehicleDataManager.m | 4 ++++ SmartDeviceLink/SDLSeatControlData.h | 10 ++++++++-- SmartDeviceLink/SDLSupportedSeat.h | 11 +++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Example Apps/Example ObjC/VehicleDataManager.m b/Example Apps/Example ObjC/VehicleDataManager.m index cc2ee46fa..d6650eae9 100644 --- a/Example Apps/Example ObjC/VehicleDataManager.m +++ b/Example Apps/Example ObjC/VehicleDataManager.m @@ -142,7 +142,11 @@ + (void)getAllVehicleDataWithManager:(SDLManager *)manager triggerSource:(SDLTri } SDLLogD(@"App has permission to access vehicle data. Requesting vehicle data..."); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLGetVehicleData *getAllVehicleData = [[SDLGetVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES electronicParkBrakeStatus:YES emergencyEvent:YES engineOilLife:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES fuelRange:YES gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES turnSignal:YES vin:YES wiperStatus:YES]; +#pragma clang diagnostic pop [manager sendRequest:getAllVehicleData withResponseHandler:^(__kindof SDLRPCRequest * _Nullable request, __kindof SDLRPCResponse * _Nullable response, NSError * _Nullable error) { if (error || ![response isKindOfClass:SDLGetVehicleDataResponse.class]) { diff --git a/SmartDeviceLink/SDLSeatControlData.h b/SmartDeviceLink/SDLSeatControlData.h index 44b776323..73cd8a6e0 100644 --- a/SmartDeviceLink/SDLSeatControlData.h +++ b/SmartDeviceLink/SDLSeatControlData.h @@ -23,7 +23,10 @@ NS_ASSUME_NONNULL_BEGIN @param supportedSeat id of remote controllable seat. @return An instance of the SDLSeatControlData class */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (instancetype)initWithId:(SDLSupportedSeat)supportedSeat; +#pragma clang diagnostic pop /** Constructs a newly allocated SDLSeatControlData object with cushion and firmness @@ -46,16 +49,19 @@ NS_ASSUME_NONNULL_BEGIN @param memoryAction type of action to be performed. @return An instance of the SDLSeatControlData class */ -- (instancetype)initWithId:(SDLSupportedSeat)supportedSeat heatingEnabled:(BOOL)heatingEnable coolingEnable:(BOOL)coolingEnable heatingLevel:(UInt8)heatingLevel coolingLevel:(UInt8)coolingLevel horizontalPostion:(UInt8)horizontal verticalPostion:(UInt8)vertical frontVerticalPostion:(UInt8)frontVertical backVerticalPostion:(UInt8)backVertical backTiltAngle:(UInt8)backAngle headSupportedHorizontalPostion:(UInt8)headSupportedHorizontal headSupportedVerticalPostion:(UInt8)headSupportedVertical massageEnabled:(BOOL)massageEnable massageMode:(NSArray *)massageMode massageCussionFirmness:(NSArray *)firmness memory:(SDLSeatMemoryAction *)memoryAction; - #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" +- (instancetype)initWithId:(SDLSupportedSeat)supportedSeat heatingEnabled:(BOOL)heatingEnable coolingEnable:(BOOL)coolingEnable heatingLevel:(UInt8)heatingLevel coolingLevel:(UInt8)coolingLevel horizontalPostion:(UInt8)horizontal verticalPostion:(UInt8)vertical frontVerticalPostion:(UInt8)frontVertical backVerticalPostion:(UInt8)backVertical backTiltAngle:(UInt8)backAngle headSupportedHorizontalPostion:(UInt8)headSupportedHorizontal headSupportedVerticalPostion:(UInt8)headSupportedVertical massageEnabled:(BOOL)massageEnable massageMode:(NSArray *)massageMode massageCussionFirmness:(NSArray *)firmness memory:(SDLSeatMemoryAction *)memoryAction; +#pragma clang diagnostic pop + /** * @abstract id of seat that is a remote controllable seat. * @warning This should not be used to identify a seat, this is a deprecated parameter. * * Required */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" @property (strong, nonatomic) SDLSupportedSeat id; #pragma clang diagnostic pop diff --git a/SmartDeviceLink/SDLSupportedSeat.h b/SmartDeviceLink/SDLSupportedSeat.h index 6eb6fefab..63badc582 100644 --- a/SmartDeviceLink/SDLSupportedSeat.h +++ b/SmartDeviceLink/SDLSupportedSeat.h @@ -3,21 +3,24 @@ #import "SDLEnum.h" -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" /** * List possible seats that is a remote controllable seat. * @warning This should not be used to supported seats, this is a deprecated parameter. */ -typedef SDLEnum SDLSupportedSeat SDL_SWIFT_ENUM; -#pragma clang diagnostic pop +typedef SDLEnum SDLSupportedSeat SDL_SWIFT_ENUM __deprecated; /** * @abstract Save current seat postions and settings to seat memory. */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" extern SDLSupportedSeat const SDLSupportedSeatDriver; +#pragma clang diagnostic pop /** * @abstract Restore / apply the seat memory settings to the current seat. */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" extern SDLSupportedSeat const SDLSupportedSeatFrontPassenger; +#pragma clang diagnostic pop From 26db52e8d763e1dc5fe5ce23fbedee9797446c89 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 29 Jul 2019 02:41:11 -0700 Subject: [PATCH 13/35] Add Tests Fix logic errors --- SmartDeviceLink/SDLButtonPress.m | 4 +-- SmartDeviceLink/SDLGetInteriorVehicleData.m | 4 +-- SmartDeviceLink/SDLSystemCapability.h | 10 ++++++- SmartDeviceLink/SDLSystemCapability.m | 12 +++++++++ .../RPCSpecs/EnumSpecs/SDLGlobalProperySpec.m | 1 + .../RequestSpecs/SDLButtonPressSpec.m | 9 ++++++- .../SDLGetInteriorVehicleDataSpec.m | 8 ++++++ .../RequestSpecs/SDLSetGlobalPropertiesSpec.m | 7 +++++ .../RPCSpecs/StructSpecs/SDLModuleDataSpec.m | 16 ++++++++--- .../StructSpecs/SDLSystemCapabilitySpec.m | 27 ++++++++++++++++++- 10 files changed, 88 insertions(+), 10 deletions(-) diff --git a/SmartDeviceLink/SDLButtonPress.m b/SmartDeviceLink/SDLButtonPress.m index 8311eb235..fd441899f 100644 --- a/SmartDeviceLink/SDLButtonPress.m +++ b/SmartDeviceLink/SDLButtonPress.m @@ -60,12 +60,12 @@ - (SDLButtonPressMode)buttonPressMode { } - (void)setModuleId:(NSString *)moduleId { - [self.store sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; + [self.parameters sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; } - (NSString *)moduleId { NSError *error = nil; - return [self.store sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.m b/SmartDeviceLink/SDLGetInteriorVehicleData.m index 80fe6c590..4b37e0418 100755 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.m @@ -111,12 +111,12 @@ - (void)setSubscribe:(nullable NSNumber *)subscribe { } - (void)setModuleId:(NSString *)moduleId { - [self.store sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; + [self.parameters sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; } - (NSString *)moduleId { NSError *error = nil; - return [self.store sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; } @end diff --git a/SmartDeviceLink/SDLSystemCapability.h b/SmartDeviceLink/SDLSystemCapability.h index fb69cc9eb..b72478312 100755 --- a/SmartDeviceLink/SDLSystemCapability.h +++ b/SmartDeviceLink/SDLSystemCapability.h @@ -65,6 +65,14 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithRemoteControlCapability:(SDLRemoteControlCapabilities *)capability; +/** + * Convenience init for a Remote Control Capability + * + * @param capability Describes information about the locations of each seat + * @return A SDLSystemCapability object + */ +- (instancetype)initWithSeatLocationCapability:(SDLSeatLocationCapability *)capability; + /** * Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other parameter included. */ @@ -106,7 +114,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nullable, strong, nonatomic) SDLRemoteControlCapabilities *remoteControlCapability; /** - * Contains information about the locations of each seat + * Describes information about the locations of each seat * * Optional */ diff --git a/SmartDeviceLink/SDLSystemCapability.m b/SmartDeviceLink/SDLSystemCapability.m index 59794c196..75f79d17e 100755 --- a/SmartDeviceLink/SDLSystemCapability.m +++ b/SmartDeviceLink/SDLSystemCapability.m @@ -82,6 +82,18 @@ - (instancetype)initWithRemoteControlCapability:(SDLRemoteControlCapabilities *) return self; } +- (instancetype)initWithSeatLocationCapability:(SDLSeatLocationCapability *)capability { + self = [self init]; + if (!self) { + return nil; + } + + self.systemCapabilityType = SDLSystemCapabilityTypeSeatLocation; + self.seatLocationCapability = capability; + + return self; +} + - (void)setSystemCapabilityType:(SDLSystemCapabilityType)type { [self.store sdl_setObject:type forName:SDLRPCParameterNameSystemCapabilityType]; } diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLGlobalProperySpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLGlobalProperySpec.m index 34d2c4fb6..ecdf7bece 100644 --- a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLGlobalProperySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLGlobalProperySpec.m @@ -21,6 +21,7 @@ expect(SDLGlobalPropertyMenuName).to(equal(@"MENUNAME")); expect(SDLGlobalPropertyMenuIcon).to(equal(@"MENUICON")); expect(SDLGlobalPropertyKeyboard).to(equal(@"KEYBOARDPROPERTIES")); + expect(SDLGlobalPropertyUserLocation).to(equal(@"USER_LOCATION")); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLButtonPressSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLButtonPressSpec.m index 648d4cbc9..f4c4c8a75 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLButtonPressSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLButtonPressSpec.m @@ -22,10 +22,12 @@ SDLButtonPress* testRequest = [[SDLButtonPress alloc] init]; testRequest.moduleType = SDLModuleTypeClimate; + testRequest.moduleId = @"123"; testRequest.buttonName = SDLButtonNameAC; testRequest.buttonPressMode = SDLButtonPressModeShort; expect(testRequest.moduleType).to(equal(SDLModuleTypeClimate)); + expect(testRequest.moduleId).to(equal(@"123")); expect(testRequest.buttonName).to(equal(SDLButtonNameAC)); expect(testRequest.buttonPressMode).to(equal(SDLButtonPressModeShort)); @@ -36,7 +38,9 @@ @{SDLRPCParameterNameParameters: @{SDLRPCParameterNameModuleType : SDLModuleTypeClimate, SDLRPCParameterNameButtonName : SDLButtonNameAC, - SDLRPCParameterNameButtonPressMode : SDLButtonPressModeShort}, + SDLRPCParameterNameButtonPressMode : SDLButtonPressModeShort, + SDLRPCParameterNameModuleId:@"123" + }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameButtonPress}} mutableCopy]; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -44,6 +48,7 @@ #pragma clang diagnostic pop expect(testRequest.moduleType).to(equal(SDLModuleTypeClimate)); + expect(testRequest.moduleId).to(equal(@"123")); expect(testRequest.buttonName).to(equal(SDLButtonNameAC)); expect(testRequest.buttonPressMode).to(equal(SDLButtonPressModeShort)); }); @@ -53,12 +58,14 @@ expect(testRequest.buttonName).to(equal(SDLButtonNameAC)); expect(testRequest.moduleType).to(equal(SDLModuleTypeClimate)); + expect(testRequest.moduleId).to(beNil()); }); it(@"Should return nil if not set", ^ { SDLButtonPress* testRequest = [[SDLButtonPress alloc] init]; expect(testRequest.moduleType).to(beNil()); + expect(testRequest.moduleId).to(beNil()); expect(testRequest.buttonName).to(beNil()); expect(testRequest.buttonPressMode).to(beNil()); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataSpec.m index d3ed4c409..9801a0e1d 100755 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataSpec.m @@ -20,15 +20,18 @@ SDLGetInteriorVehicleData* testRequest = [[SDLGetInteriorVehicleData alloc] init]; testRequest.moduleType = SDLModuleTypeRadio; testRequest.subscribe = @YES; + testRequest.moduleId = @"123"; expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); expect(testRequest.subscribe).to(equal(@YES)); + expect(testRequest.moduleId).to(equal(@"123")); }); it(@"Should get correctly when initialized with a dictionary", ^ { NSMutableDictionary *dict = [@{SDLRPCParameterNameRequest: @{SDLRPCParameterNameParameters: @{SDLRPCParameterNameModuleType : SDLModuleTypeRadio, + SDLRPCParameterNameModuleId: @"123", SDLRPCParameterNameSubscribe : @YES}, SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetInteriorVehicleData}} mutableCopy]; #pragma clang diagnostic push @@ -38,12 +41,14 @@ expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); expect(testRequest.subscribe).to(equal(@YES)); + expect(testRequest.moduleId).to(equal(@"123")); }); it(@"Should get correctly when initialized with module type", ^ { SDLGetInteriorVehicleData* testRequest = [[SDLGetInteriorVehicleData alloc] initWithModuleType:SDLModuleTypeRadio]; expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); + expect(testRequest.moduleId).to(beNil()); }); it(@"Should get correctly when initialized with module type and subscribe", ^ { @@ -51,6 +56,7 @@ expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); expect(testRequest.subscribe).to(equal(@YES)); + expect(testRequest.moduleId).to(beNil()); }); it(@"Should get correctly when initialized with module type and unsubscribe", ^ { @@ -58,6 +64,7 @@ expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); expect(testRequest.subscribe).to(equal(@NO)); + expect(testRequest.moduleId).to(beNil()); }); @@ -66,6 +73,7 @@ expect(testRequest.moduleType).to(beNil()); expect(testRequest.subscribe).to(beNil()); + expect(testRequest.moduleId).to(beNil()); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetGlobalPropertiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetGlobalPropertiesSpec.m index b12672582..e875e411c 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetGlobalPropertiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetGlobalPropertiesSpec.m @@ -15,6 +15,7 @@ #import "SDLSetGlobalProperties.h" #import "SDLTTSChunk.h" #import "SDLVrHelpItem.h" +#import "SDLSeatLocation.h" QuickSpecBegin(SDLSetGlobalPropertiesSpec) @@ -24,6 +25,7 @@ SDLVRHelpItem* help = [[SDLVRHelpItem alloc] init]; SDLImage* image = [[SDLImage alloc] init]; SDLKeyboardProperties* keyboard = [[SDLKeyboardProperties alloc] init]; +SDLSeatLocation *seatLocation = [[SDLSeatLocation alloc] init]; describe(@"Getter/Setter Tests", ^ { it(@"Should set and get correctly", ^ { @@ -36,6 +38,7 @@ testRequest.menuTitle = @"TheNewMenu"; testRequest.menuIcon = image; testRequest.keyboardProperties = keyboard; + testRequest.userLocation = seatLocation; expect(testRequest.helpPrompt).to(equal([@[chunk1] mutableCopy])); expect(testRequest.timeoutPrompt).to(equal([@[chunk2] mutableCopy])); @@ -44,6 +47,7 @@ expect(testRequest.menuTitle).to(equal(@"TheNewMenu")); expect(testRequest.menuIcon).to(equal(image)); expect(testRequest.keyboardProperties).to(equal(keyboard)); + expect(testRequest.userLocation).to(equal(seatLocation)); }); it(@"Should get correctly when initialized", ^ { @@ -54,6 +58,7 @@ SDLRPCParameterNameVRHelpTitle:@"vr", SDLRPCParameterNameVRHelp:[@[help] mutableCopy], SDLRPCParameterNameMenuTitle:@"TheNewMenu", + SDLRPCParameterNameUserLocation: seatLocation, SDLRPCParameterNameMenuIcon:image, SDLRPCParameterNameKeyboardProperties:keyboard}, SDLRPCParameterNameOperationName:SDLRPCFunctionNameSetGlobalProperties}} mutableCopy]; @@ -69,6 +74,7 @@ expect(testRequest.menuTitle).to(equal(@"TheNewMenu")); expect(testRequest.menuIcon).to(equal(image)); expect(testRequest.keyboardProperties).to(equal(keyboard)); + expect(testRequest.userLocation).to(equal(seatLocation)); }); it(@"Should return nil if not set", ^ { @@ -81,6 +87,7 @@ expect(testRequest.menuTitle).to(beNil()); expect(testRequest.menuIcon).to(beNil()); expect(testRequest.keyboardProperties).to(beNil()); + expect(testRequest.userLocation).to(beNil()); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLModuleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLModuleDataSpec.m index 10789bd9c..5a4ce340f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLModuleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLModuleDataSpec.m @@ -27,6 +27,7 @@ __block SDLLightControlData* someLightData = [[SDLLightControlData alloc] init]; __block SDLHMISettingsControlData* someHMISettingsData = [[SDLHMISettingsControlData alloc] init]; __block SDLSeatControlData* someSeatData = [[SDLSeatControlData alloc] init]; + __block NSString *someModuleId = @"123"; it(@"should properly initialize init", ^{ SDLModuleData* testStruct = [[SDLModuleData alloc] init]; @@ -38,7 +39,7 @@ expect(testStruct.audioControlData).to(beNil()); expect(testStruct.hmiSettingsControlData).to(beNil()); expect(testStruct.lightControlData).to(beNil()); - + expect(testStruct.moduleId).to(beNil()); }); it(@"should properly initialize initWithDictionary", ^{ @@ -49,7 +50,8 @@ SDLRPCParameterNameSeatControlData:someSeatData, SDLRPCParameterNameAudioControlData:someAudioData, SDLRPCParameterNameLightControlData:someLightData, - SDLRPCParameterNameHmiSettingsControlData:someHMISettingsData} mutableCopy]; + SDLRPCParameterNameHmiSettingsControlData:someHMISettingsData, + SDLRPCParameterNameModuleId:someModuleId} mutableCopy]; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLModuleData* testStruct = [[SDLModuleData alloc] initWithDictionary:dict]; @@ -62,7 +64,7 @@ expect(testStruct.audioControlData).to(equal(someAudioData)); expect(testStruct.hmiSettingsControlData).to(equal(someHMISettingsData)); expect(testStruct.lightControlData).to(equal(someLightData)); - + expect(testStruct.moduleId).to(equal(someModuleId)); }); it(@"Should set and get correctly", ^{ @@ -74,6 +76,7 @@ testStruct.audioControlData = someAudioData; testStruct.lightControlData = someLightData; testStruct.hmiSettingsControlData = someHMISettingsData; + testStruct.moduleId = someModuleId; expect(testStruct.moduleType).to(equal(SDLModuleTypeRadio)); expect(testStruct.seatControlData).to(equal(someSeatData)); @@ -82,6 +85,7 @@ expect(testStruct.audioControlData).to(equal(someAudioData)); expect(testStruct.hmiSettingsControlData).to(equal(someHMISettingsData)); expect(testStruct.lightControlData).to(equal(someLightData)); + expect(testStruct.moduleId).to(equal(someModuleId)); }); it(@"Should get correctly when initialized with RadioControlData", ^ { @@ -91,6 +95,7 @@ expect(testStruct.radioControlData).to(equal(someRadioData)); expect(testStruct.climateControlData).to(beNil()); expect(testStruct.seatControlData).to(beNil()); + expect(testStruct.moduleId).to(beNil()); }); it(@"Should get correctly when initialized with ClimateControlData", ^ { @@ -100,6 +105,7 @@ expect(testStruct.climateControlData).to(equal(someClimateData)); expect(testStruct.radioControlData).to(beNil()); expect(testStruct.seatControlData).to(beNil()); + expect(testStruct.moduleId).to(beNil()); }); it(@"Should get correctly when initialized with ClimateControlData", ^ { @@ -109,6 +115,7 @@ expect(testStruct.seatControlData).to(equal(someSeatData)); expect(testStruct.radioControlData).to(beNil()); expect(testStruct.climateControlData).to(beNil()); + expect(testStruct.moduleId).to(beNil()); }); it(@"Should get correctly when initialized with ClimateControlData", ^ { @@ -120,6 +127,7 @@ expect(testStruct.audioControlData).to(beNil()); expect(testStruct.lightControlData).to(beNil()); expect(testStruct.hmiSettingsControlData).to(equal(someHMISettingsData)); + expect(testStruct.moduleId).to(beNil()); }); it(@"Should get correctly when initialized with ClimateControlData", ^ { @@ -131,6 +139,7 @@ expect(testStruct.audioControlData).to(beNil()); expect(testStruct.lightControlData).to(equal(someLightData)); expect(testStruct.hmiSettingsControlData).to(beNil()); + expect(testStruct.moduleId).to(beNil()); }); it(@"Should get correctly when initialized with ClimateControlData", ^ { @@ -142,6 +151,7 @@ expect(testStruct.audioControlData).to(equal(someAudioData)); expect(testStruct.lightControlData).to(beNil()); expect(testStruct.hmiSettingsControlData).to(beNil()); + expect(testStruct.moduleId).to(beNil()); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m index 42286b97b..b937eb3e1 100755 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m @@ -16,6 +16,7 @@ #import "SDLVideoStreamingCodec.h" #import "SDLVideoStreamingFormat.h" #import "SDLVideoStreamingProtocol.h" +#import "SDLSeatLocationCapability.h" #import "SDLRPCParameterNames.h" @@ -27,6 +28,7 @@ __block SDLPhoneCapability *testPhoneCapability = nil; __block SDLRemoteControlCapabilities *testRemoteControlCapabilities = nil; __block SDLVideoStreamingCapability *testVideoStreamingCapability = nil; + __block SDLSeatLocationCapability *testSeatLocationCapability = nil; beforeEach(^{ testAppServicesCapabilities = [[SDLAppServicesCapabilities alloc] initWithAppServices:nil]; @@ -34,6 +36,7 @@ testPhoneCapability = [[SDLPhoneCapability alloc] initWithDialNumber:YES]; testRemoteControlCapabilities = [[SDLRemoteControlCapabilities alloc] initWithClimateControlCapabilities:nil radioControlCapabilities:nil buttonCapabilities:nil seatControlCapabilities:nil audioControlCapabilities:nil hmiSettingsControlCapabilities:nil lightControlCapabilities:nil]; testVideoStreamingCapability = [[SDLVideoStreamingCapability alloc] initWithPreferredResolution:[[SDLImageResolution alloc] initWithWidth:50 height:50] maxBitrate:5 supportedFormats:@[] hapticDataSupported:false]; + testSeatLocationCapability = [[SDLSeatLocationCapability alloc] init]; }); it(@"Should set and get correctly", ^ { @@ -44,6 +47,7 @@ testStruct.phoneCapability = testPhoneCapability; testStruct.videoStreamingCapability = testVideoStreamingCapability; testStruct.remoteControlCapability = testRemoteControlCapabilities; + testStruct.seatLocationCapability = testSeatLocationCapability; expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeNavigation)); expect(testStruct.appServicesCapabilities).to(equal(testAppServicesCapabilities)); @@ -51,6 +55,7 @@ expect(testStruct.phoneCapability).to(equal(testPhoneCapability)); expect(testStruct.videoStreamingCapability).to(equal(testVideoStreamingCapability)); expect(testStruct.remoteControlCapability).to(equal(testRemoteControlCapabilities)); + expect(testStruct.seatLocationCapability).to(equal(testSeatLocationCapability)); }); it(@"Should get correctly when initialized with a dictionary", ^ { @@ -60,7 +65,8 @@ SDLRPCParameterNameNavigationCapability:testNavigationCapability, SDLRPCParameterNamePhoneCapability:testPhoneCapability, SDLRPCParameterNameRemoteControlCapability:testRemoteControlCapabilities, - SDLRPCParameterNameVideoStreamingCapability:testVideoStreamingCapability + SDLRPCParameterNameVideoStreamingCapability:testVideoStreamingCapability, + SDLRPCParameterNameSeatLocationCapability:testSeatLocationCapability }; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -73,6 +79,7 @@ expect(testStruct.phoneCapability).to(equal(testPhoneCapability)); expect(testStruct.remoteControlCapability).to(equal(testRemoteControlCapabilities)); expect(testStruct.videoStreamingCapability).to(equal(testVideoStreamingCapability)); + expect(testStruct.seatLocationCapability).to(equal(testSeatLocationCapability)); }); it(@"Should return nil if not set", ^ { @@ -84,6 +91,7 @@ expect(testStruct.phoneCapability).to(beNil()); expect(testStruct.videoStreamingCapability).to(beNil()); expect(testStruct.remoteControlCapability).to(beNil()); + expect(testStruct.seatLocationCapability).to(beNil()); }); it(@"should initialize correctly with initWithAppServicesCapabilities:", ^{ @@ -95,6 +103,7 @@ expect(testStruct.phoneCapability).to(beNil()); expect(testStruct.remoteControlCapability).to(beNil()); expect(testStruct.videoStreamingCapability).to(beNil()); + expect(testStruct.seatLocationCapability).to(beNil()); }); it(@"should initialize correctly with initWithPhoneCapability:", ^{ @@ -107,6 +116,7 @@ expect(testStruct.phoneCapability).to(equal(testPhoneStruct)); expect(testStruct.remoteControlCapability).to(beNil()); expect(testStruct.videoStreamingCapability).to(beNil()); + expect(testStruct.seatLocationCapability).to(beNil()); }); it(@"should initialize correctly with initWithNavigationCapability:", ^{ @@ -119,6 +129,7 @@ expect(testStruct.phoneCapability).to(beNil()); expect(testStruct.remoteControlCapability).to(beNil()); expect(testStruct.videoStreamingCapability).to(beNil()); + expect(testStruct.seatLocationCapability).to(beNil()); }); it(@"should initialize correctly with initWithVideoStreamingCapability:", ^{ @@ -148,6 +159,7 @@ expect(testStruct.phoneCapability).to(beNil()); expect(testStruct.remoteControlCapability).to(beNil()); expect(testStruct.videoStreamingCapability).to(equal(testVidStruct)); + expect(testStruct.seatLocationCapability).to(beNil()); }); it(@"should initialize correctly with initWithRemoteControlCapability:", ^{ @@ -159,6 +171,19 @@ expect(testStruct.phoneCapability).to(beNil()); expect(testStruct.remoteControlCapability).to(equal(testRemoteControlCapabilities)); expect(testStruct.videoStreamingCapability).to(beNil()); + expect(testStruct.seatLocationCapability).to(beNil()); + }); + + it(@"should initialize correctly with initWithSeatLocationCapability:", ^{ + SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithSeatLocationCapability:testSeatLocationCapability]; + + expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeSeatLocation)); + expect(testStruct.appServicesCapabilities).to(beNil()); + expect(testStruct.navigationCapability).to(beNil()); + expect(testStruct.phoneCapability).to(beNil()); + expect(testStruct.remoteControlCapability).to(beNil()); + expect(testStruct.videoStreamingCapability).to(beNil()); + expect(testStruct.seatLocationCapability).to(equal(testSeatLocationCapability)); }); }); From 293a6f984b82a358989b80873f5d65b2650a0a29 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 29 Jul 2019 03:27:45 -0700 Subject: [PATCH 14/35] Add SDLSeatLocationCapabilitySpec --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 4 + SmartDeviceLink/SDLSeatLocationCapability.m | 10 ++- .../SDLSeatLocationCapabilitySpec.m | 88 +++++++++++++++++++ 3 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatLocationCapabilitySpec.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 3dd550758..4dc13f9e7 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 000DD56C22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */; }; 0055412622D40DAB003194D3 /* SDLModuleInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412422D40DAB003194D3 /* SDLModuleInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0055412722D40DAB003194D3 /* SDLModuleInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412522D40DAB003194D3 /* SDLModuleInfo.m */; }; 0055412A22D5DC0B003194D3 /* SDLGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412822D5DC0B003194D3 /* SDLGrid.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1647,6 +1648,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationCapabilitySpec.m; sourceTree = ""; }; 0055412422D40DAB003194D3 /* SDLModuleInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLModuleInfo.h; sourceTree = ""; }; 0055412522D40DAB003194D3 /* SDLModuleInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLModuleInfo.m; sourceTree = ""; }; 0055412822D5DC0B003194D3 /* SDLGrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGrid.h; sourceTree = ""; }; @@ -3679,6 +3681,7 @@ 8855F9DF220C93B700A5C897 /* SDLWeatherDataSpec.m */, 880D2679220DDD1000B3F496 /* SDLWeatherServiceDataSpec.m */, 880D267F220E038800B3F496 /* SDLWeatherServiceManifestSpec.m */, + 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */, ); path = StructSpecs; sourceTree = ""; @@ -7600,6 +7603,7 @@ 162E82EA1A9BDE8B00906325 /* SDLLanguageSpec.m in Sources */, 5D76E3291D3D0A8800647CFA /* SDLFakeViewControllerPresenter.m in Sources */, 5DB2022A1F5F38B60061D189 /* SDLFakeStreamingManagerDataSource.m in Sources */, + 000DD56C22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m in Sources */, 5D92935020AF526200FCC775 /* SDLRGBColorSpec.m in Sources */, 162E83331A9BDE8B00906325 /* SDLPerformInteractionSpec.m in Sources */, 1EAA47622035B1AE000FE74B /* SDLDistanceUnitSpec.m in Sources */, diff --git a/SmartDeviceLink/SDLSeatLocationCapability.m b/SmartDeviceLink/SDLSeatLocationCapability.m index f1dc56ebd..94d085362 100644 --- a/SmartDeviceLink/SDLSeatLocationCapability.m +++ b/SmartDeviceLink/SDLSeatLocationCapability.m @@ -11,6 +11,8 @@ #import "NSMutableDictionary+Store.h" #import "SDLRPCParameterNames.h" +NS_ASSUME_NONNULL_BEGIN + @implementation SDLSeatLocationCapability - (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber *)cols rows:(NSNumber *)rows levels:(NSNumber *)levels { @@ -27,7 +29,7 @@ - (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber return self; } -- (void)setCol:(NSNumber *)cols { +- (void)setCols:(NSNumber *)cols { [self.store sdl_setObject:cols forName:SDLRPCParameterNameColumns]; } @@ -36,7 +38,7 @@ - (void)setCol:(NSNumber *)cols { return [self.store sdl_objectForName:SDLRPCParameterNameColumns ofClass:NSNumber.class error:&error]; } -- (void)setRow:(NSNumber *)rows { +- (void)setRows:(NSNumber *)rows { [self.store sdl_setObject:rows forName:SDLRPCParameterNameRows]; } @@ -45,7 +47,7 @@ - (void)setRow:(NSNumber *)rows { return [self.store sdl_objectForName:SDLRPCParameterNameRows ofClass:NSNumber.class error:&error]; } -- (void)setLevel:(NSNumber *)levels { +- (void)setLevels:(NSNumber *)levels { [self.store sdl_setObject:levels forName:SDLRPCParameterNameLevels]; } @@ -64,3 +66,5 @@ - (void)setSeats:(NSArray *)seats { } @end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatLocationCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatLocationCapabilitySpec.m new file mode 100644 index 000000000..e238c5737 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatLocationCapabilitySpec.m @@ -0,0 +1,88 @@ +// +// SDLSeatLocationCapabilitySpec.m +// SmartDeviceLinkTests +// +// Created by standa1 on 7/29/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import + +#import +#import + +#import "SDLSeatLocationCapability.h" +#import "SDLGrid.h" +#import "SDLRPCParameterNames.h" + + +QuickSpecBegin(SDLSeatLocationCapabilitySpec) + +describe(@"Getter/Setter Tests", ^ { + __block SDLGrid *testGird = nil; + __block SDLSeatLocation *driverSeat = nil; + + beforeEach(^{ + testGird = [[SDLGrid alloc] init]; + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + driverSeat = [[SDLSeatLocation alloc] init]; + driverSeat.grid = testGird; + }); + + it(@"Should set and get correctly", ^ { + SDLSeatLocationCapability *testStruct = [[SDLSeatLocationCapability alloc] init]; + + testStruct.cols = @3; + testStruct.rows = @2; + testStruct.levels = @1; + testStruct.seats = @[driverSeat]; + + expect(testStruct.cols).to(equal(@3)); + expect(testStruct.rows).to(equal(@2)); + expect(testStruct.levels).to(equal(@1)); + expect(testStruct.seats).to(equal(@[driverSeat])); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{ + SDLRPCParameterNameRows:@2, + SDLRPCParameterNameColumns:@3, + SDLRPCParameterNameLevels:@1, + SDLRPCParameterNameSeats:@[driverSeat]} mutableCopy]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLSeatLocationCapability *testStruct = [[SDLSeatLocationCapability alloc] initWithDictionary:dict]; +#pragma clang diagnostic pop + + expect(testStruct.cols).to(equal(@3)); + expect(testStruct.rows).to(equal(@2)); + expect(testStruct.levels).to(equal(@1)); + expect(testStruct.seats).to(equal(@[driverSeat])); + }); + + it(@"Should get correctly when initialized", ^ { + SDLSeatLocationCapability *testStruct = [[SDLSeatLocationCapability alloc] initWithSeats:@[driverSeat] cols:@3 rows:@2 levels:@1]; + + expect(testStruct.cols).to(equal(@3)); + expect(testStruct.rows).to(equal(@2)); + expect(testStruct.levels).to(equal(@1)); + expect(testStruct.seats).to(equal(@[driverSeat])); + }); + + + it(@"Should return nil if not set", ^ { + SDLSeatLocationCapability *testStruct = [[SDLSeatLocationCapability alloc] init]; + + expect(testStruct.cols).to(beNil()); + expect(testStruct.rows).to(beNil()); + expect(testStruct.levels).to(beNil()); + expect(testStruct.seats).to(beNil()); + }); +}); + +QuickSpecEnd From e4261091ee060f7934b245786e6c1baff4fc4659 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 29 Jul 2019 03:33:18 -0700 Subject: [PATCH 15/35] Add SDLSeatLocationSpec --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 4 ++ .../StructSpecs/SDLSeatLocationSpec.m | 58 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatLocationSpec.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 4dc13f9e7..8de928326 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 000DD56C22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */; }; + 000DD56E22EF01FC005AB7A7 /* SDLSeatLocationSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD56D22EF01FC005AB7A7 /* SDLSeatLocationSpec.m */; }; 0055412622D40DAB003194D3 /* SDLModuleInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412422D40DAB003194D3 /* SDLModuleInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0055412722D40DAB003194D3 /* SDLModuleInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412522D40DAB003194D3 /* SDLModuleInfo.m */; }; 0055412A22D5DC0B003194D3 /* SDLGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412822D5DC0B003194D3 /* SDLGrid.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1649,6 +1650,7 @@ /* Begin PBXFileReference section */ 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationCapabilitySpec.m; sourceTree = ""; }; + 000DD56D22EF01FC005AB7A7 /* SDLSeatLocationSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationSpec.m; sourceTree = ""; }; 0055412422D40DAB003194D3 /* SDLModuleInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLModuleInfo.h; sourceTree = ""; }; 0055412522D40DAB003194D3 /* SDLModuleInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLModuleInfo.m; sourceTree = ""; }; 0055412822D5DC0B003194D3 /* SDLGrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGrid.h; sourceTree = ""; }; @@ -3682,6 +3684,7 @@ 880D2679220DDD1000B3F496 /* SDLWeatherServiceDataSpec.m */, 880D267F220E038800B3F496 /* SDLWeatherServiceManifestSpec.m */, 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */, + 000DD56D22EF01FC005AB7A7 /* SDLSeatLocationSpec.m */, ); path = StructSpecs; sourceTree = ""; @@ -8005,6 +8008,7 @@ 162E83731A9BDE8B00906325 /* SDLBeltStatusSpec.m in Sources */, 162E83551A9BDE8B00906325 /* SDLEndAudioPassThruResponseSpec.m in Sources */, 8881AFC12225EB9300EA870B /* SDLGetCloudAppPropertiesResponseSpec.m in Sources */, + 000DD56E22EF01FC005AB7A7 /* SDLSeatLocationSpec.m in Sources */, 162E83251A9BDE8B00906325 /* SDLAlertSpec.m in Sources */, 2BF2F85220ED068200A26EF2 /* SDLAudioStreamingIndicatorSpec.m in Sources */, 5D6035D2202CD46200A429C9 /* SDLSpecUtilities.m in Sources */, diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatLocationSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatLocationSpec.m new file mode 100644 index 000000000..31234bbbe --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSeatLocationSpec.m @@ -0,0 +1,58 @@ +// +// SDLSeatLocationSpec.m +// SmartDeviceLinkTests +// +// Created by standa1 on 7/29/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import + +#import +#import + +#import "SDLSeatLocation.h" +#import "SDLRPCParameterNames.h" + + +QuickSpecBegin(SDLSeatLocationSpec) + +describe(@"Getter/Setter Tests", ^ { + __block SDLGrid *testGird = nil; + + beforeEach(^{ + testGird = [[SDLGrid alloc] init]; + testGird.col = @0; + testGird.row = @0; + testGird.level = @0; + testGird.rowspan = @2; + testGird.colspan = @3; + testGird.levelspan = @1; + }); + + it(@"Should set and get correctly", ^ { + SDLSeatLocation *testStruct = [[SDLSeatLocation alloc] init]; + + testStruct.grid = testGird; + + expect(testStruct.grid).to(equal(testGird)); + }); + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary* dict = [@{SDLRPCParameterNameGrid:testGird} mutableCopy]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLSeatLocation *testStruct = [[SDLSeatLocation alloc] initWithDictionary:dict]; +#pragma clang diagnostic pop + + expect(testStruct.grid).to(equal(testGird)); + }); + + it(@"Should return nil if not set", ^ { + SDLSeatLocation *testStruct = [[SDLSeatLocation alloc] init]; + + expect(testStruct.grid).to(beNil()); + }); +}); + +QuickSpecEnd From fcfb1bf199dc0e22e6a647044f51394d098e32fb Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 29 Jul 2019 03:53:09 -0700 Subject: [PATCH 16/35] Add SDLGetInteriorVehicleDataConsent Tests --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 8 +++ .../SDLGetInteriorVehicleDataConsentSpec.m | 61 +++++++++++++++++++ ...etInteriorVehicleDataConsentResponseSpec.m | 58 ++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataConsentSpec.m create mode 100644 SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetInteriorVehicleDataConsentResponseSpec.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 8de928326..06c7d2e24 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -9,6 +9,8 @@ /* Begin PBXBuildFile section */ 000DD56C22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */; }; 000DD56E22EF01FC005AB7A7 /* SDLSeatLocationSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD56D22EF01FC005AB7A7 /* SDLSeatLocationSpec.m */; }; + 000DD57022EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD56F22EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m */; }; + 000DD57222EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD57122EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m */; }; 0055412622D40DAB003194D3 /* SDLModuleInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412422D40DAB003194D3 /* SDLModuleInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0055412722D40DAB003194D3 /* SDLModuleInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412522D40DAB003194D3 /* SDLModuleInfo.m */; }; 0055412A22D5DC0B003194D3 /* SDLGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412822D5DC0B003194D3 /* SDLGrid.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1651,6 +1653,8 @@ /* Begin PBXFileReference section */ 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationCapabilitySpec.m; sourceTree = ""; }; 000DD56D22EF01FC005AB7A7 /* SDLSeatLocationSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationSpec.m; sourceTree = ""; }; + 000DD56F22EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsentSpec.m; sourceTree = ""; }; + 000DD57122EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsentResponseSpec.m; sourceTree = ""; }; 0055412422D40DAB003194D3 /* SDLModuleInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLModuleInfo.h; sourceTree = ""; }; 0055412522D40DAB003194D3 /* SDLModuleInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLModuleInfo.m; sourceTree = ""; }; 0055412822D5DC0B003194D3 /* SDLGrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGrid.h; sourceTree = ""; }; @@ -3514,6 +3518,7 @@ 1EE8C45E1F3884FF00FDC2CF /* SDLSetInteriorVehicleDataSpec.m */, 8877F5EA1F34A3BE00DC128A /* SDLSendHapticDataSpec.m */, 8B05F88822DD011300666CD8 /* SDLUnpublishAppServiceSpec.m */, + 000DD56F22EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m */, ); path = RequestSpecs; sourceTree = ""; @@ -3579,6 +3584,7 @@ 162E828D1A9BDE8A00906325 /* SDLUpdateTurnListResponseSpec.m */, 8877F5F01F34AA2D00DC128A /* SDLSendHapticDataResponseSpec.m */, 8BA12B1722DCF59700371E82 /* SDLUnpublishAppServiceResponseSpec.m */, + 000DD57122EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m */, ); path = ResponseSpecs; sourceTree = ""; @@ -7617,6 +7623,7 @@ 5DE35E4720CB0AB90034BE5A /* SDLChoiceSetSpec.m in Sources */, 162E83101A9BDE8B00906325 /* SDLOnAudioPassThruSpec.m in Sources */, DABB62171E4A900C0034C567 /* SDLH264VideoEncoderSpec.m in Sources */, + 000DD57022EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m in Sources */, 5DBEFA581F436132009EE295 /* SDLFakeSecurityManager.m in Sources */, 162E82D91A9BDE8A00906325 /* SDLDisplayTypeSpec.m in Sources */, 162E83871A9BDE8B00906325 /* SDLPermissionItemSpec.m in Sources */, @@ -7920,6 +7927,7 @@ 8816772922208B82001FACFF /* SDLNavigationInstructionSpec.m in Sources */, 5DC978261B7A38640012C2F1 /* SDLGlobalsSpec.m in Sources */, 162E82FF1A9BDE8B00906325 /* SDLTextAlignmentSpec.m in Sources */, + 000DD57222EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m in Sources */, 162E831F1A9BDE8B00906325 /* SDLOnTouchEventSpec.m in Sources */, 162E83921A9BDE8B00906325 /* SDLTouchEventCapabilitiesSpec.m in Sources */, 162E837F1A9BDE8B00906325 /* SDLHeadLampStatusSpec.m in Sources */, diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataConsentSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataConsentSpec.m new file mode 100644 index 000000000..bc9d19774 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetInteriorVehicleDataConsentSpec.m @@ -0,0 +1,61 @@ +// +// SDLGetInteriorVehicleDataConsentSpec.m +// SmartDeviceLinkTests +// +// Created by standa1 on 7/29/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import + +#import +#import + +#import "SDLGetInteriorVehicleDataConsent.h" +#import "SDLModuleType.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLGetInteriorVehicleDataConsentSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLGetInteriorVehicleDataConsent *testRequest = [[SDLGetInteriorVehicleDataConsent alloc] init]; + testRequest.moduleType = SDLModuleTypeRadio; + testRequest.moduleIds = @[@"123", @"456"]; + + expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); + expect(testRequest.moduleIds).to(equal(@[@"123", @"456"])); + }); + + it(@"Should get correctly when initialized with a dictionary", ^ { + NSMutableDictionary *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameModuleType : SDLModuleTypeRadio, + SDLRPCParameterNameModuleIds: @[@"123", @"456"]}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetInteriorVehicleData}} mutableCopy]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLGetInteriorVehicleDataConsent *testRequest = [[SDLGetInteriorVehicleDataConsent alloc] initWithDictionary:dict]; +#pragma clang diagnostic pop + + expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); + expect(testRequest.moduleIds).to(equal(@[@"123", @"456"])); + }); + + it(@"Should get correctly when initialized with module type and module ids", ^ { + SDLGetInteriorVehicleDataConsent *testRequest = [[SDLGetInteriorVehicleDataConsent alloc] initWithModuleType:SDLModuleTypeRadio moduleIds:@[@"123", @"456"]]; + + expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); + expect(testRequest.moduleIds).to(equal(@[@"123", @"456"])); + }); + + it(@"Should return nil if not set", ^ { + SDLGetInteriorVehicleDataConsent *testRequest = [[SDLGetInteriorVehicleDataConsent alloc] init]; + + expect(testRequest.moduleType).to(beNil()); + expect(testRequest.moduleIds).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetInteriorVehicleDataConsentResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetInteriorVehicleDataConsentResponseSpec.m new file mode 100644 index 000000000..479220441 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetInteriorVehicleDataConsentResponseSpec.m @@ -0,0 +1,58 @@ +// +// SDLGetInteriorVehicleDataConsent.m +// SmartDeviceLinkTests +// +// Created by standa1 on 7/29/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import + +#import +#import + +#import "SDLGetInteriorVehicleDataConsentResponse.h" +#import "SDLModuleData.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLGetInteriorVehicleDataConsentResponseSpec) + +describe(@"Getter/Setter Tests", ^ { + __block NSArray *> *allowed = nil; + + beforeEach(^{ + allowed = @[@YES, @NO]; + }); + + it(@"Should set and get correctly", ^ { + SDLGetInteriorVehicleDataConsentResponse *testResponse = [[SDLGetInteriorVehicleDataConsentResponse alloc] init]; + + testResponse.allowed = allowed; + + expect(testResponse.allowed).to(equal(allowed)); + }); + + + + it(@"Should get correctly when initialized", ^ { + NSMutableDictionary *dict = [@{SDLRPCParameterNameResponse: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameAllowed:allowed}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetInteriorVehicleData}} mutableCopy]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLGetInteriorVehicleDataConsentResponse *testResponse = [[SDLGetInteriorVehicleDataConsentResponse alloc] initWithDictionary:dict]; +#pragma clang diagnostic pop + + expect(testResponse.allowed).to(equal(allowed)); + }); + + it(@"Should return nil if not set", ^ { + SDLGetInteriorVehicleDataConsentResponse *testResponse = [[SDLGetInteriorVehicleDataConsentResponse alloc] init]; + + expect(testResponse.allowed).to(beNil()); + }); +}); + +QuickSpecEnd From 1a533e3f057ae3a566791fc1a8dc673f4c4d43ad Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 29 Jul 2019 04:19:02 -0700 Subject: [PATCH 17/35] Add SDLReleaseInteriorVehicleDataModule Tests --- SmartDeviceLink-iOS.xcodeproj/project.pbxproj | 8 +++ .../SDLReleaseInteriorVehicleDataModule.h | 2 +- .../SDLReleaseInteriorVehicleDataModule.m | 4 +- .../SDLReleaseInteriorVehicleDataModuleSpec.m | 61 +++++++++++++++++++ ...aseInteriorVehicleDataModuleResponseSpec.m | 19 ++++++ 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLReleaseInteriorVehicleDataModuleSpec.m create mode 100644 SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReleaseInteriorVehicleDataModuleResponseSpec.m diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index 06c7d2e24..44cbdcfd3 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -11,6 +11,8 @@ 000DD56E22EF01FC005AB7A7 /* SDLSeatLocationSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD56D22EF01FC005AB7A7 /* SDLSeatLocationSpec.m */; }; 000DD57022EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD56F22EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m */; }; 000DD57222EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD57122EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m */; }; + 000DD57422EF0957005AB7A7 /* SDLReleaseInteriorVehicleDataModuleSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD57322EF0957005AB7A7 /* SDLReleaseInteriorVehicleDataModuleSpec.m */; }; + 000DD57622EF0971005AB7A7 /* SDLReleaseInteriorVehicleDataModuleResponseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 000DD57522EF0971005AB7A7 /* SDLReleaseInteriorVehicleDataModuleResponseSpec.m */; }; 0055412622D40DAB003194D3 /* SDLModuleInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412422D40DAB003194D3 /* SDLModuleInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0055412722D40DAB003194D3 /* SDLModuleInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 0055412522D40DAB003194D3 /* SDLModuleInfo.m */; }; 0055412A22D5DC0B003194D3 /* SDLGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = 0055412822D5DC0B003194D3 /* SDLGrid.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1655,6 +1657,8 @@ 000DD56D22EF01FC005AB7A7 /* SDLSeatLocationSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSeatLocationSpec.m; sourceTree = ""; }; 000DD56F22EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsentSpec.m; sourceTree = ""; }; 000DD57122EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLGetInteriorVehicleDataConsentResponseSpec.m; sourceTree = ""; }; + 000DD57322EF0957005AB7A7 /* SDLReleaseInteriorVehicleDataModuleSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLReleaseInteriorVehicleDataModuleSpec.m; sourceTree = ""; }; + 000DD57522EF0971005AB7A7 /* SDLReleaseInteriorVehicleDataModuleResponseSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLReleaseInteriorVehicleDataModuleResponseSpec.m; sourceTree = ""; }; 0055412422D40DAB003194D3 /* SDLModuleInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLModuleInfo.h; sourceTree = ""; }; 0055412522D40DAB003194D3 /* SDLModuleInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLModuleInfo.m; sourceTree = ""; }; 0055412822D5DC0B003194D3 /* SDLGrid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLGrid.h; sourceTree = ""; }; @@ -3519,6 +3523,7 @@ 8877F5EA1F34A3BE00DC128A /* SDLSendHapticDataSpec.m */, 8B05F88822DD011300666CD8 /* SDLUnpublishAppServiceSpec.m */, 000DD56F22EF038C005AB7A7 /* SDLGetInteriorVehicleDataConsentSpec.m */, + 000DD57322EF0957005AB7A7 /* SDLReleaseInteriorVehicleDataModuleSpec.m */, ); path = RequestSpecs; sourceTree = ""; @@ -3585,6 +3590,7 @@ 8877F5F01F34AA2D00DC128A /* SDLSendHapticDataResponseSpec.m */, 8BA12B1722DCF59700371E82 /* SDLUnpublishAppServiceResponseSpec.m */, 000DD57122EF063F005AB7A7 /* SDLGetInteriorVehicleDataConsentResponseSpec.m */, + 000DD57522EF0971005AB7A7 /* SDLReleaseInteriorVehicleDataModuleResponseSpec.m */, ); path = ResponseSpecs; sourceTree = ""; @@ -7581,6 +7587,7 @@ 162E82EE1A9BDE8B00906325 /* SDLMediaClockFormatSpec.m in Sources */, 5DA026901AD44EE700019F86 /* SDLDialNumberResponseSpec.m in Sources */, 162E83901A9BDE8B00906325 /* SDLTireStatusSpec.m in Sources */, + 000DD57622EF0971005AB7A7 /* SDLReleaseInteriorVehicleDataModuleResponseSpec.m in Sources */, 162E82E01A9BDE8B00906325 /* SDLHMILevelSpec.m in Sources */, 88F65133220C6DC300CAF321 /* SDLWeatherAlertSpec.m in Sources */, 5DC09EDA1F2F7FEC00F4AB1D /* SDLControlFramePayloadNakSpec.m in Sources */, @@ -7848,6 +7855,7 @@ 88A4A0FA22242AB400C6F01D /* SDLNavigationServiceDataSpec.m in Sources */, 8831FA3D220207DA00B8FFB7 /* SDLServiceUpdateReasonSpec.m in Sources */, 162E831A1A9BDE8B00906325 /* SDLOnLockScreenStatusSpec.m in Sources */, + 000DD57422EF0957005AB7A7 /* SDLReleaseInteriorVehicleDataModuleSpec.m in Sources */, 162E83431A9BDE8B00906325 /* SDLSyncPDataSpec.m in Sources */, 167ED9461A9BCE5D00797BE5 /* SwiftSpec.swift in Sources */, 162E838B1A9BDE8B00906325 /* SDLSoftButtonCapabilitiesSpec.m in Sources */, diff --git a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h index 3e6e51960..9053c623a 100644 --- a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h +++ b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLReleaseInteriorVehicleDataModule : SDLRPCRequest -- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSArray *)moduleId; +- (instancetype)initWithModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; /** * The module type that the app requests to control. diff --git a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m index 6664c6e6b..40927a793 100644 --- a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m +++ b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m @@ -44,8 +44,8 @@ - (SDLModuleType)moduleType { return [self.parameters sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; } -- (void)setModuleIds:(NSArray *)moduleIds { - [self.parameters sdl_setObject:moduleIds forName:SDLRPCParameterNameModuleId]; +- (void)setModuleId:(NSArray *)moduleId { + [self.parameters sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; } - (NSString *)moduleId { diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLReleaseInteriorVehicleDataModuleSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLReleaseInteriorVehicleDataModuleSpec.m new file mode 100644 index 000000000..6f98c4f28 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLReleaseInteriorVehicleDataModuleSpec.m @@ -0,0 +1,61 @@ +// +// SDLReleaseInteriorVehicleDataModuleSpec.m +// SmartDeviceLinkTests +// +// Created by standa1 on 7/29/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// + +#import + +#import +#import + +#import "SDLReleaseInteriorVehicleDataModule.h" +#import "SDLModuleType.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLReleaseInteriorVehicleDataModuleSpec) + +describe(@"Getter/Setter Tests", ^ { + it(@"Should set and get correctly", ^ { + SDLReleaseInteriorVehicleDataModule *testRequest = [[SDLReleaseInteriorVehicleDataModule alloc] init]; + testRequest.moduleType = SDLModuleTypeRadio; + testRequest.moduleId = @"123"; + + expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); + expect(testRequest.moduleId).to(equal(@"123")); + }); + + it(@"Should get correctly when initialized with a dictionary", ^ { + NSMutableDictionary *dict = [@{SDLRPCParameterNameRequest: + @{SDLRPCParameterNameParameters: + @{SDLRPCParameterNameModuleType: SDLModuleTypeRadio, + SDLRPCParameterNameModuleId: @"123"}, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetInteriorVehicleData}} mutableCopy]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLReleaseInteriorVehicleDataModule *testRequest = [[SDLReleaseInteriorVehicleDataModule alloc] initWithDictionary:dict]; +#pragma clang diagnostic pop + + expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); + expect(testRequest.moduleId).to(equal(@"123")); + }); + + it(@"Should get correctly when initialized with module type and module ids", ^ { + SDLReleaseInteriorVehicleDataModule *testRequest = [[SDLReleaseInteriorVehicleDataModule alloc] initWithModuleType:SDLModuleTypeRadio moduleId:@"123"]; + + expect(testRequest.moduleType).to(equal(SDLModuleTypeRadio)); + expect(testRequest.moduleId).to(equal(@"123")); + }); + + it(@"Should return nil if not set", ^ { + SDLReleaseInteriorVehicleDataModule *testRequest = [[SDLReleaseInteriorVehicleDataModule alloc] init]; + + expect(testRequest.moduleType).to(beNil()); + expect(testRequest.moduleId).to(beNil()); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReleaseInteriorVehicleDataModuleResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReleaseInteriorVehicleDataModuleResponseSpec.m new file mode 100644 index 000000000..463f6c6fd --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLReleaseInteriorVehicleDataModuleResponseSpec.m @@ -0,0 +1,19 @@ +// +// SDLReleaseInteriorVehicleDataModuleResponseSpec.m +// SmartDeviceLinkTests +// +// Created by standa1 on 7/29/19. +// Copyright © 2019 smartdevicelink. All rights reserved. +// +#import + +#import +#import + +#import "SDLReleaseInteriorVehicleDataModuleResponse.h" +#import "SDLRPCParameterNames.h" + +QuickSpecBegin(SDLReleaseInteriorVehicleDataModuleResponseSpec) + +QuickSpecEnd + From 70d39f8329c8de366fe21ada43160dd48db17b62 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 29 Jul 2019 05:05:53 -0700 Subject: [PATCH 18/35] Fix merge conflicts --- .../SDLClimateControlCapabilities.m | 1 + .../SDLRadioControlCapabilitiesSpec.m | 20 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.m b/SmartDeviceLink/SDLClimateControlCapabilities.m index 6280bef61..f2d2a0240 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.m +++ b/SmartDeviceLink/SDLClimateControlCapabilities.m @@ -201,6 +201,7 @@ - (void)setClimateEnableAvailable:(nullable NSNumber *)climateEnableAva - (nullable NSNumber *)climateEnableAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameClimateEnableAvailable ofClass:NSNumber.class error:nil]; +} - (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m index be3e81380..3ec5b48c7 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLRadioControlCapabilitiesSpec.m @@ -221,26 +221,6 @@ }); - it(@"Should get correctly when initialized with Module Name and other radio control capabilite's parameters", ^ { - SDLRadioControlCapabilities* testStruct = [[SDLRadioControlCapabilities alloc] initWithModuleName:@"someName" moduleInfo:testModuleInfo radioEnableAvailable:YES radioBandAvailable:NO radioFrequencyAvailable:YES hdChannelAvailable:NO rdsDataAvailable:NO availableHDsAvailable:NO stateAvailable:YES signalStrengthAvailable:YES signalChangeThresholdAvailable:NO hdRadioEnableAvailable:YES siriusXMRadioAvailable:YES sisDataAvailable:YES]; - - expect(testStruct.moduleName).to(equal(@"someName")); - expect(testStruct.moduleInfo).to(equal(testModuleInfo)); - expect(testStruct.radioEnableAvailable).to(equal(@YES)); - expect(testStruct.radioBandAvailable).to(equal(@NO)); - expect(testStruct.radioFrequencyAvailable).to(equal(@YES)); - expect(testStruct.hdChannelAvailable).to(equal(@NO)); - expect(testStruct.rdsDataAvailable).to(equal(@NO)); - expect(testStruct.availableHDsAvailable).to(equal(@NO)); - expect(testStruct.stateAvailable).to(equal(@YES)); - expect(testStruct.signalStrengthAvailable).to(equal(@YES)); - expect(testStruct.signalChangeThresholdAvailable).to(equal(@NO)); - expect(testStruct.hdRadioEnableAvailable).to(equal(YES)); - expect(testStruct.siriusXMRadioAvailable).to(equal(@YES)); - expect(testStruct.sisDataAvailable).to(equal(@YES)); - - }); - }); QuickSpecEnd From f09d2553a42027d1158823f745560d01de293954 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 5 Aug 2019 15:55:41 -0700 Subject: [PATCH 19/35] Silence warnings --- SmartDeviceLink/SDLSeatControlData.m | 12 ++++++++++++ SmartDeviceLink/SDLSupportedSeat.m | 3 +++ 2 files changed, 15 insertions(+) diff --git a/SmartDeviceLink/SDLSeatControlData.m b/SmartDeviceLink/SDLSeatControlData.m index 7fbebb67b..6054cb908 100644 --- a/SmartDeviceLink/SDLSeatControlData.m +++ b/SmartDeviceLink/SDLSeatControlData.m @@ -13,7 +13,10 @@ @implementation SDLSeatControlData +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (instancetype)initWithId:(SDLSupportedSeat)supportedSeat { +#pragma clang diagnostic pop self = [self init]; if (!self) { return nil; @@ -23,7 +26,10 @@ - (instancetype)initWithId:(SDLSupportedSeat)supportedSeat { return self; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (instancetype)initWithId:(SDLSupportedSeat)supportedSeat heatingEnabled:(BOOL)heatingEnable coolingEnable:(BOOL)coolingEnabled heatingLevel:(UInt8)heatingLevel coolingLevel:(UInt8)coolingLevel horizontalPostion:(UInt8)horizontal verticalPostion:(UInt8)vertical frontVerticalPostion:(UInt8)frontVertical backVerticalPostion:(UInt8)backVertical backTiltAngle:(UInt8)backAngle headSupportedHorizontalPostion:(UInt8)headSupportedHorizontal headSupportedVerticalPostion:(UInt8)headSupportedVertical massageEnabled:(BOOL)massageEnable massageMode:(NSArray *)massageMode massageCussionFirmness:(NSArray *)firmness memory:(SDLSeatMemoryAction *)memoryAction { +#pragma clang diagnostic pop self = [super init]; if (!self) { @@ -53,11 +59,17 @@ - (instancetype)initWithId:(SDLSupportedSeat)supportedSeat heatingEnabled:(BOOL) return self; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (void)setId:(SDLSupportedSeat)id { +#pragma clang diagnostic pop [self.store sdl_setObject:id forName:SDLRPCParameterNameId]; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (SDLSupportedSeat)id { +#pragma clang diagnostic pop NSError *error = nil; return [self.store sdl_enumForName:SDLRPCParameterNameId error:&error]; } diff --git a/SmartDeviceLink/SDLSupportedSeat.m b/SmartDeviceLink/SDLSupportedSeat.m index f97678bb1..1260ced9d 100644 --- a/SmartDeviceLink/SDLSupportedSeat.m +++ b/SmartDeviceLink/SDLSupportedSeat.m @@ -3,5 +3,8 @@ #import "SDLSupportedSeat.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLSupportedSeat const SDLSupportedSeatDriver = @"DRIVER"; SDLSupportedSeat const SDLSupportedSeatFrontPassenger = @"FRONT_PASSENGER"; +#pragma clang diagnostic pop From e7fc5a7c5a3983f64b8b3b13e43f9cf12ccb5f19 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 12 Aug 2019 13:51:24 -0700 Subject: [PATCH 20/35] Add missing public files to podspec and SDL header --- SmartDeviceLink.podspec | 8 ++++++++ SmartDeviceLink/SmartDeviceLink.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/SmartDeviceLink.podspec b/SmartDeviceLink.podspec index 06974750f..04395b61b 100644 --- a/SmartDeviceLink.podspec +++ b/SmartDeviceLink.podspec @@ -136,6 +136,8 @@ sdefault.public_header_files = [ 'SmartDeviceLink/SDLGetFile.h', 'SmartDeviceLink/SDLGetFileResponse.h', 'SmartDeviceLink/SDLGetInteriorVehicleData.h', +'SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h', +'SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h', 'SmartDeviceLink/SDLGetInteriorVehicleDataResponse.h', 'SmartDeviceLink/SDLGetSystemCapability.h', 'SmartDeviceLink/SDLGetSystemCapabilityResponse.h', @@ -145,6 +147,7 @@ sdefault.public_header_files = [ 'SmartDeviceLink/SDLGetWaypointsResponse.h', 'SmartDeviceLink/SDLGlobalProperty.h', 'SmartDeviceLink/SDLGPSData.h', +'SmartDeviceLink/SDLGrid.h', 'SmartDeviceLink/SDLHapticRect.h', 'SmartDeviceLink/SDLHeadLampStatus.h', 'SmartDeviceLink/SDLHMICapabilities.h', @@ -213,6 +216,7 @@ sdefault.public_header_files = [ 'SmartDeviceLink/SDLMetadataTags.h', 'SmartDeviceLink/SDLMetadataType.h', 'SmartDeviceLink/SDLModuleData.h', +'SmartDeviceLink/SDLModuleInfo.h', 'SmartDeviceLink/SDLModuleType.h', 'SmartDeviceLink/SDLMyKey.h', 'SmartDeviceLink/SDLNavigationAction.h', @@ -282,6 +286,8 @@ sdefault.public_header_files = [ 'SmartDeviceLink/SDLRegisterAppInterface.h', 'SmartDeviceLink/SDLRegisterAppInterfaceResponse.h', 'SmartDeviceLink/SDLRemoteControlCapabilities.h', +'SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h', +'SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.h', 'SmartDeviceLink/SDLRequestType.h', 'SmartDeviceLink/SDLResetGlobalProperties.h', 'SmartDeviceLink/SDLResetGlobalPropertiesResponse.h', @@ -304,6 +310,8 @@ sdefault.public_header_files = [ 'SmartDeviceLink/SDLScrollableMessageResponse.h', 'SmartDeviceLink/SDLSeatControlCapabilities.h', 'SmartDeviceLink/SDLSeatControlData.h', +'SmartDeviceLink/SDLSeatLocation.h', +'SmartDeviceLink/SDLSeatLocationCapability.h', 'SmartDeviceLink/SDLSeatMemoryAction.h', 'SmartDeviceLink/SDLSeatMemoryActionType.h', 'SmartDeviceLink/SDLSupportedSeat.h', diff --git a/SmartDeviceLink/SmartDeviceLink.h b/SmartDeviceLink/SmartDeviceLink.h index fe9317789..a68a1276a 100644 --- a/SmartDeviceLink/SmartDeviceLink.h +++ b/SmartDeviceLink/SmartDeviceLink.h @@ -194,6 +194,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLFuelRange.h" #import "SDLEqualizerSettings.h" #import "SDLGPSData.h" +#import "SDLGrid.h" #import "SDLHapticRect.h" #import "SDLHMICapabilities.h" #import "SDLHMIPermissions.h" @@ -217,6 +218,7 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLMenuParams.h" #import "SDLMetadataTags.h" #import "SDLModuleData.h" +#import "SDLModuleInfo.h" #import "SDLMyKey.h" #import "SDLNavigationCapability.h" #import "SDLNavigationInstruction.h" From d4ed17655f0f4f3e23a90d673317cd2999181168 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 12 Aug 2019 14:01:49 -0700 Subject: [PATCH 21/35] Update SDLGetInteriorVehicleData.h Deprecate properly --- SmartDeviceLink/SDLGetInteriorVehicleData.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.h b/SmartDeviceLink/SDLGetInteriorVehicleData.h index 536c329ca..ed418c1b0 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.h +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.h @@ -24,20 +24,11 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (instancetype)initWithModuleType:(SDLModuleType)moduleType; -#pragma clang diagnostic pop +- (instancetype)initWithModuleType:(SDLModuleType)moduleType __deprecated_msg("Use initWithModuleType:moduleId:"); -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType; -#pragma clang diagnostic pop +- (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType __deprecated_msg("Use initAndSubscribeToModuleType:moduleId:"); -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType; -#pragma clang diagnostic pop +- (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType __deprecated_msg("Use initAndUnsubscribeToModuleType:moduleId:"); /** * The type of a RC module to retrieve module data from the vehicle. From eb8c741dafa5f5735f5442567224e1fc6759fbed Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 12 Aug 2019 14:14:14 -0700 Subject: [PATCH 22/35] Remove unnecessary method Add deprecate message --- SmartDeviceLink/SDLAudioControlCapabilities.h | 4 ++-- .../SDLClimateControlCapabilities.m | 24 ------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.h b/SmartDeviceLink/SDLAudioControlCapabilities.h index ceeab4a8b..392f0fcfd 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.h +++ b/SmartDeviceLink/SDLAudioControlCapabilities.h @@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN @param name The short friendly name of the audio control module. @return An instance of the SDLAudioControlCapabilities class. */ -- (instancetype)initWithModuleName:(NSString *)name __deprecated_msg("Use initWithModuleName:moduleInfo:"); +- (instancetype)initWithModuleName:(NSString *)name __deprecated_msg("Use initWithModuleName:moduleInfo: instead"); /** Constructs a newly allocated SDLAudioControlCapabilities object with audio control module name (max 100 chars) @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN @param equalizerMaxChannelID Equalizer channel ID (between 1-100). @return An instance of the SDLAudioControlCapabilities class. */ -- (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID __deprecated_msg("Use initWithModuleName:moduleInfo:sourceAvailable:keepContextAvailable:volumeAvailable:equalizerAvailable:equalizerMaxChannelID:"); +- (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID __deprecated_msg("Use initWithModuleName:moduleInfo:sourceAvailable:keepContextAvailable:volumeAvailable:equalizerAvailable:equalizerMaxChannelID: instead"); /** Constructs a newly allocated SDLAudioControlCapabilities object with given parameters diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.m b/SmartDeviceLink/SDLClimateControlCapabilities.m index f2d2a0240..31226c1d4 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.m +++ b/SmartDeviceLink/SDLClimateControlCapabilities.m @@ -42,30 +42,6 @@ - (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOO return self; } -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)heatedSteeringWheelAvailable heatedWindshieldAvailable:(BOOL)heatedWindshieldAvailable heatedRearWindowAvailable:(BOOL)heatedRearWindowAvailable heatedMirrorsAvailable:(BOOL)heatedMirrorsAvailable { - self = [self init]; - if (!self) { - return nil; - } - - self.moduleName = moduleName; - self.moduleInfo = moduleInfo; - self.fanSpeedAvailable = @(fanSpeedAvailable); - self.desiredTemperatureAvailable = @(desiredTemperatureAvailable); - self.acEnableAvailable = @(acEnableAvailable); - self.acMaxEnableAvailable = @(acMaxEnableAvailable); - self.circulateAirEnableAvailable = @(circulateAirEnableAvailable); - self.autoModeEnableAvailable = @(autoModeEnableAvailable); - self.dualModeEnableAvailable = @(dualModeEnableAvailable); - self.defrostZoneAvailable = @(defrostZoneAvailable); - self.ventilationModeAvailable = @(ventilationModeAvailable); - self.heatedSteeringWheelAvailable = @(heatedSteeringWheelAvailable); - self.heatedWindshieldAvailable = @(heatedWindshieldAvailable); - self.heatedRearWindowAvailable = @(heatedRearWindowAvailable); - self.heatedMirrorsAvailable = @(heatedMirrorsAvailable); - return self; -} - - (void)setModuleName:(NSString *)moduleName { [self.store sdl_setObject:moduleName forName:SDLRPCParameterNameModuleName]; } From ca1d3bedc8c20ff85254202c5e07161734d31400 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 12 Aug 2019 14:16:01 -0700 Subject: [PATCH 23/35] Update SDLRPCFunctionNames.m Fix function names --- SmartDeviceLink/SDLRPCFunctionNames.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SmartDeviceLink/SDLRPCFunctionNames.m b/SmartDeviceLink/SDLRPCFunctionNames.m index c5caecb5b..d4b480bd7 100644 --- a/SmartDeviceLink/SDLRPCFunctionNames.m +++ b/SmartDeviceLink/SDLRPCFunctionNames.m @@ -30,7 +30,7 @@ SDLRPCFunctionName const SDLRPCFunctionNameGetFile = @"GetFile"; SDLRPCFunctionName const SDLRPCFunctionNameGetCloudAppProperties = @"GetCloudAppProperties"; SDLRPCFunctionName const SDLRPCFunctionNameGetInteriorVehicleData = @"GetInteriorVehicleData"; -SDLRPCFunctionName const SDLRPCFunctionNameGetInteriorVehicleDataConsent = @"GetInteriorVehicleDataConsentID"; +SDLRPCFunctionName const SDLRPCFunctionNameGetInteriorVehicleDataConsent = @"GetInteriorVehicleDataConsent"; SDLRPCFunctionName const SDLRPCFunctionNameGetSystemCapability = @"GetSystemCapability"; SDLRPCFunctionName const SDLRPCFunctionNameGetVehicleData = @"GetVehicleData"; SDLRPCFunctionName const SDLRPCFunctionNameGetWayPoints = @"GetWayPoints"; @@ -64,7 +64,7 @@ SDLRPCFunctionName const SDLRPCFunctionNamePublishAppService = @"PublishAppService"; SDLRPCFunctionName const SDLRPCFunctionNamePutFile = @"PutFile"; SDLRPCFunctionName const SDLRPCFunctionNameReadDID = @"ReadDID"; -SDLRPCFunctionName const SDLRPCFunctionNameReleaseInteriorVehicleDataModule = @"ReleaseInteriorVehicleDataModuleID"; +SDLRPCFunctionName const SDLRPCFunctionNameReleaseInteriorVehicleDataModule = @"ReleaseInteriorVehicleDataModule"; SDLRPCFunctionName const SDLRPCFunctionNameRegisterAppInterface = @"RegisterAppInterface"; SDLRPCFunctionName const SDLRPCFunctionNameReserved = @"reserved"; SDLRPCFunctionName const SDLRPCFunctionNameResetGlobalProperties = @"ResetGlobalProperties"; From 1de659b01df8ea5cff323662fb7db3d853146263 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 12 Aug 2019 15:39:48 -0700 Subject: [PATCH 24/35] Add RPCs to SDLNotificationConstants --- SmartDeviceLink/SDLNotificationConstants.h | 4 ++++ SmartDeviceLink/SDLNotificationConstants.m | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/SmartDeviceLink/SDLNotificationConstants.h b/SmartDeviceLink/SDLNotificationConstants.h index df651dfe9..2bcfaedd2 100644 --- a/SmartDeviceLink/SDLNotificationConstants.h +++ b/SmartDeviceLink/SDLNotificationConstants.h @@ -138,6 +138,7 @@ extern SDLNotificationName const SDLDidReceiveGetAppServiceDataResponse; extern SDLNotificationName const SDLDidReceiveGetDTCsResponse; extern SDLNotificationName const SDLDidReceiveGetFileResponse; extern SDLNotificationName const SDLDidReceiveGetInteriorVehicleDataResponse; +extern SDLNotificationName const SDLDidReceiveGetInteriorVehicleDataConsentResponse; extern SDLNotificationName const SDLDidReceiveGetSystemCapabilitiesResponse; extern SDLNotificationName const SDLDidReceiveGetVehicleDataResponse; extern SDLNotificationName const SDLDidReceiveGetWaypointsResponse; @@ -149,6 +150,7 @@ extern SDLNotificationName const SDLDidReceivePublishAppServiceResponse; extern SDLNotificationName const SDLDidReceivePutFileResponse; extern SDLNotificationName const SDLDidReceiveReadDIDResponse; extern SDLNotificationName const SDLDidReceiveRegisterAppInterfaceResponse; +extern SDLNotificationName const SDLDidReceiveReleaseInteriorVehicleDataModuleResponse; extern SDLNotificationName const SDLDidReceiveResetGlobalPropertiesResponse; extern SDLNotificationName const SDLDidReceiveScrollableMessageResponse; extern SDLNotificationName const SDLDidReceiveSendHapticDataResponse; @@ -199,6 +201,7 @@ extern SDLNotificationName const SDLDidReceiveGetCloudAppPropertiesRequest; extern SDLNotificationName const SDLDidReceiveGetDTCsRequest; extern SDLNotificationName const SDLDidReceiveGetFileRequest; extern SDLNotificationName const SDLDidReceiveGetInteriorVehicleDataRequest; +extern SDLNotificationName const SDLDidReceiveGetInteriorVehicleDataConsentRequest; extern SDLNotificationName const SDLDidReceiveGetSystemCapabilityRequest; extern SDLNotificationName const SDLDidReceiveGetVehicleDataRequest; extern SDLNotificationName const SDLDidReceiveGetWayPointsRequest; @@ -210,6 +213,7 @@ extern SDLNotificationName const SDLDidReceivePublishAppServiceRequest; extern SDLNotificationName const SDLDidReceivePutFileRequest; extern SDLNotificationName const SDLDidReceiveReadDIDRequest; extern SDLNotificationName const SDLDidReceiveRegisterAppInterfaceRequest; +extern SDLNotificationName const SDLDidReceiveReleaseInteriorVehicleDataModuleRequest; extern SDLNotificationName const SDLDidReceiveResetGlobalPropertiesRequest; extern SDLNotificationName const SDLDidReceiveScrollableMessageRequest; extern SDLNotificationName const SDLDidReceiveSendHapticDataRequest; diff --git a/SmartDeviceLink/SDLNotificationConstants.m b/SmartDeviceLink/SDLNotificationConstants.m index ff56baac0..63a648c56 100644 --- a/SmartDeviceLink/SDLNotificationConstants.m +++ b/SmartDeviceLink/SDLNotificationConstants.m @@ -46,6 +46,7 @@ SDLNotificationName const SDLDidReceiveGetDTCsResponse = @"com.sdl.response.getDTCs"; SDLNotificationName const SDLDidReceiveGetFileResponse = @"com.sdl.response.getFile"; SDLNotificationName const SDLDidReceiveGetInteriorVehicleDataResponse = @"com.sdl.response.getInteriorVehicleData"; +SDLNotificationName const SDLDidReceiveGetInteriorVehicleDataConsentResponse = @"com.sdl.response.getInteriorVehicleDataConsent"; SDLNotificationName const SDLDidReceiveGetSystemCapabilitiesResponse = @"com.sdl.response.getSystemCapabilities"; SDLNotificationName const SDLDidReceiveGetVehicleDataResponse = @"com.sdl.response.getVehicleData"; SDLNotificationName const SDLDidReceiveGetWaypointsResponse = @"com.sdl.response.getWaypoints"; @@ -57,6 +58,7 @@ SDLNotificationName const SDLDidReceivePutFileResponse = @"com.sdl.response.putFile"; SDLNotificationName const SDLDidReceiveReadDIDResponse = @"com.sdl.response.readDID"; SDLNotificationName const SDLDidReceiveRegisterAppInterfaceResponse = @"com.sdl.response.registerAppInterface"; +SDLNotificationName const SDLDidReceiveReleaseInteriorVehicleDataModuleResponse = @"com.sdl.response.releaseInteriorVehicleDataModule"; SDLNotificationName const SDLDidReceiveResetGlobalPropertiesResponse = @"com.sdl.response.resetGlobalProperties"; SDLNotificationName const SDLDidReceiveScrollableMessageResponse = @"com.sdl.response.scrollableMessage"; SDLNotificationName const SDLDidReceiveSendHapticDataResponse = @"com.sdl.response.sendHapticData"; @@ -104,6 +106,7 @@ SDLNotificationName const SDLDidReceiveGetDTCsRequest = @"com.sdl.request.getDTCs"; SDLNotificationName const SDLDidReceiveGetFileRequest = @"com.sdl.request.getFile"; SDLNotificationName const SDLDidReceiveGetInteriorVehicleDataRequest = @"com.sdl.request.getInteriorVehicleData"; +SDLNotificationName const SDLDidReceiveGetInteriorVehicleDataConsentRequest = @"com.sdl.request.getInteriorVehicleDataConsent"; SDLNotificationName const SDLDidReceiveGetSystemCapabilityRequest = @"com.sdl.request.getSystemCapability"; SDLNotificationName const SDLDidReceiveGetVehicleDataRequest = @"com.sdl.request.getVehicleData"; SDLNotificationName const SDLDidReceiveGetWayPointsRequest = @"com.sdl.request.getWayPoints"; @@ -115,6 +118,7 @@ SDLNotificationName const SDLDidReceivePutFileRequest = @"com.sdl.request.putFile"; SDLNotificationName const SDLDidReceiveReadDIDRequest = @"com.sdl.request.readDID"; SDLNotificationName const SDLDidReceiveRegisterAppInterfaceRequest = @"com.sdl.request.registerAppInterface"; +SDLNotificationName const SDLDidReceiveReleaseInteriorVehicleDataModuleRequest = @"com.sdl.request.releaseInteriorVehicleDataModule"; SDLNotificationName const SDLDidReceiveResetGlobalPropertiesRequest = @"com.sdl.request.resetGlobalProperties"; SDLNotificationName const SDLDidReceiveScrollableMessageRequest = @"com.sdl.request.scrollableMessage"; SDLNotificationName const SDLDidReceiveSendHapticDataRequest = @"com.sdl.request.sendHapticData"; From f38997afdf33533e5a4ee6e8c87e598599654a25 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 12 Aug 2019 15:57:09 -0700 Subject: [PATCH 25/35] Update SDLNotificationDispatcher.m Add new RPCs --- SmartDeviceLink/SDLNotificationDispatcher.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/SmartDeviceLink/SDLNotificationDispatcher.m b/SmartDeviceLink/SDLNotificationDispatcher.m index 4bf552e17..8e601c5fc 100644 --- a/SmartDeviceLink/SDLNotificationDispatcher.m +++ b/SmartDeviceLink/SDLNotificationDispatcher.m @@ -183,6 +183,10 @@ - (void)onGetInteriorVehicleDataResponse:(SDLGetInteriorVehicleDataResponse *)re [self postRPCResponseNotification:SDLDidReceiveGetInteriorVehicleDataResponse response:response]; } +- (void)onGetInteriorVehicleDataConsentResponse:(SDLGetInteriorVehicleDataConsentResponse *)response { + [self postRPCResponseNotification:SDLDidReceiveGetInteriorVehicleDataConsentResponse response:response]; +} + - (void)onGetSystemCapabilityResponse:(SDLGetSystemCapabilityResponse *)response { [self postRPCResponseNotification:SDLDidReceiveGetSystemCapabilitiesResponse response:response]; } @@ -227,6 +231,10 @@ - (void)onRegisterAppInterfaceResponse:(SDLRegisterAppInterfaceResponse *)respon [self postRPCResponseNotification:SDLDidReceiveRegisterAppInterfaceResponse response:response]; } +- (void)onReleaseInteriorVehicleDataModuleResponse:(SDLReleaseInteriorVehicleDataModuleResponse *)response { + [self postRPCResponseNotification:SDLDidReceiveReleaseInteriorVehicleDataModuleResponse response:response]; +} + - (void)onResetGlobalPropertiesResponse:(SDLResetGlobalPropertiesResponse *)response { [self postRPCResponseNotification:SDLDidReceiveResetGlobalPropertiesResponse response:response]; } @@ -409,6 +417,10 @@ - (void)onGetInteriorVehicleData:(SDLGetInteriorVehicleData *)request { [self postRPCRequestNotification:SDLDidReceiveGetInteriorVehicleDataRequest request:request]; } +- (void)onGetInteriorVehicleDataConsent:(SDLGetInteriorVehicleDataConsent *)request { + [self postRPCRequestNotification:SDLDidReceiveGetInteriorVehicleDataConsentRequest request:request]; +} + - (void)onGetSystemCapability:(SDLGetSystemCapability *)request { [self postRPCRequestNotification:SDLDidReceiveGetSystemCapabilityRequest request:request]; } @@ -453,6 +465,10 @@ - (void)onRegisterAppInterface:(SDLRegisterAppInterface *)request { [self postRPCRequestNotification:SDLDidReceiveRegisterAppInterfaceRequest request:request]; } +- (void)onReleaseInteriorVehicleDataModule:(SDLReleaseInteriorVehicleDataModule *)request { + [self postRPCRequestNotification:SDLDidReceiveReleaseInteriorVehicleDataModuleRequest request:request]; +} + - (void)onResetGlobalProperties:(SDLResetGlobalProperties *)request { [self postRPCRequestNotification:SDLDidReceiveResetGlobalPropertiesRequest request:request]; } From 5204ad72db3f650b5e3e8b1e0fa6aa82c3a99a18 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 12 Aug 2019 16:14:27 -0700 Subject: [PATCH 26/35] Update SDLProxyListener.h Add new RPCs --- SmartDeviceLink/SDLProxyListener.h | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/SmartDeviceLink/SDLProxyListener.h b/SmartDeviceLink/SDLProxyListener.h index f0c9b7a90..254935a7b 100644 --- a/SmartDeviceLink/SDLProxyListener.h +++ b/SmartDeviceLink/SDLProxyListener.h @@ -46,6 +46,8 @@ @class SDLGetFileResponse; @class SDLGetInteriorVehicleData; @class SDLGetInteriorVehicleDataResponse; +@class SDLGetInteriorVehicleDataConsent; +@class SDLGetInteriorVehicleDataConsentResponse; @class SDLGetSystemCapability; @class SDLGetSystemCapabilityResponse; @class SDLGetVehicleData; @@ -91,6 +93,8 @@ @class SDLReadDIDResponse; @class SDLRegisterAppInterface; @class SDLRegisterAppInterfaceResponse; +@class SDLReleaseInteriorVehicleDataModule; +@class SDLReleaseInteriorVehicleDataModuleResponse; @class SDLResetGlobalProperties; @class SDLResetGlobalPropertiesResponse; @class SDLScrollableMessage; @@ -327,6 +331,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)onGetInteriorVehicleDataResponse:(SDLGetInteriorVehicleDataResponse *)response; +/** + * Called when a Get Interior Vehicle Data Consent Response is received from Core + * + * @param response A SDLGetInteriorVehicleDataConsentResponse object + */ +- (void)onGetInteriorVehicleDataConsentResponse:(SDLGetInteriorVehicleDataConsentResponse *)response; + /** * Called when a Get System Capability Response is received from Core * @@ -411,6 +422,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)onRegisterAppInterfaceResponse:(SDLRegisterAppInterfaceResponse *)response; +/** + * Called when a Release Interior Vehicle Data Module Response is received from Core + * + * @param response A SDLReleaseInteriorVehicleDataModuleResponse object + */ +- (void)onReleaseInteriorVehicleDataModuleResponse:(SDLReleaseInteriorVehicleDataModuleResponse *)response; + /** * Called when a Reset Global Properties Response is received from Core * @@ -728,6 +746,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)onGetInteriorVehicleData:(SDLGetInteriorVehicleData *)request; +/** + * Called when a `GetInteriorVehicleDataConsent` request is received from Core + * + * @param request A SDLGetInteriorVehicleDataConsent object + */ +- (void)onGetInteriorVehicleConsentData:(SDLGetInteriorVehicleDataConsent *)request; + /** * Called when a `GetSystemCapability` request is received from Core * @@ -805,6 +830,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)onRegisterAppInterface:(SDLRegisterAppInterface *)request; +/** + * Called when a `ReleaseInteriorVehicleDataModule` request is received from Core + * + * @param request A SDLReleaseInteriorVehicleDataModule object + */ +- (void)onReleaseInteriorVehicleDataModule:(SDLReleaseInteriorVehicleDataModule *)request; + /** * Called when a `ResetGlobalProperties` request is received from Core * From 0da37e5714863b506dc49a97a1ec19d54eabd144 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 12 Aug 2019 17:12:09 -0700 Subject: [PATCH 27/35] Make properties nullable --- SmartDeviceLink/SDLAudioControlCapabilities.h | 2 +- SmartDeviceLink/SDLAudioControlCapabilities.m | 4 ++-- SmartDeviceLink/SDLButtonCapabilities.h | 2 +- SmartDeviceLink/SDLButtonCapabilities.m | 4 ++-- SmartDeviceLink/SDLButtonPress.h | 2 +- SmartDeviceLink/SDLButtonPress.m | 4 ++-- SmartDeviceLink/SDLClimateControlCapabilities.h | 2 +- SmartDeviceLink/SDLClimateControlCapabilities.m | 4 ++-- SmartDeviceLink/SDLGetInteriorVehicleData.h | 2 +- SmartDeviceLink/SDLGetInteriorVehicleData.m | 4 ++-- .../SDLGetInteriorVehicleDataConsent.h | 4 ++-- SmartDeviceLink/SDLGrid.h | 8 ++++---- SmartDeviceLink/SDLGrid.m | 16 ++++++++-------- .../SDLHMISettingsControlCapabilities.h | 2 +- .../SDLHMISettingsControlCapabilities.m | 4 ++-- SmartDeviceLink/SDLLightControlCapabilities.h | 2 +- SmartDeviceLink/SDLLightControlCapabilities.m | 4 ++-- SmartDeviceLink/SDLModuleData.h | 2 +- SmartDeviceLink/SDLModuleData.m | 4 ++-- SmartDeviceLink/SDLModuleInfo.h | 6 +++--- SmartDeviceLink/SDLModuleInfo.m | 12 ++++++------ SmartDeviceLink/SDLRadioControlCapabilities.h | 2 +- SmartDeviceLink/SDLRadioControlCapabilities.m | 4 ++-- .../SDLReleaseInteriorVehicleDataModule.h | 4 ++-- .../SDLReleaseInteriorVehicleDataModule.m | 4 ++-- SmartDeviceLink/SDLSeatControlCapabilities.h | 6 +++--- SmartDeviceLink/SDLSeatControlCapabilities.m | 4 ++-- SmartDeviceLink/SDLSeatLocation.h | 2 +- SmartDeviceLink/SDLSeatLocation.m | 4 ++-- SmartDeviceLink/SDLSeatLocationCapability.h | 8 ++++---- SmartDeviceLink/SDLSeatLocationCapability.m | 16 ++++++++-------- 31 files changed, 74 insertions(+), 74 deletions(-) diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.h b/SmartDeviceLink/SDLAudioControlCapabilities.h index 392f0fcfd..0429b7ab3 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.h +++ b/SmartDeviceLink/SDLAudioControlCapabilities.h @@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN * * SDLModuleInfo */ -@property (strong, nonatomic) SDLModuleInfo *moduleInfo; +@property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.m b/SmartDeviceLink/SDLAudioControlCapabilities.m index d15552bd9..514698180 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.m +++ b/SmartDeviceLink/SDLAudioControlCapabilities.m @@ -113,11 +113,11 @@ - (void)setEqualizerMaxChannelId:(nullable NSNumber *)equalizerMaxChanne return [self.store sdl_objectForName:SDLRPCParameterNameEqualizerMaxChannelId ofClass:NSNumber.class error:nil]; } -- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { +- (void)setModuleInfo:(nullable SDLModuleInfo *)moduleInfo { [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; } -- (SDLModuleInfo *)moduleInfo { +- (nullable SDLModuleInfo *)moduleInfo { return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; } diff --git a/SmartDeviceLink/SDLButtonCapabilities.h b/SmartDeviceLink/SDLButtonCapabilities.h index 6d97df0c8..91dbca733 100644 --- a/SmartDeviceLink/SDLButtonCapabilities.h +++ b/SmartDeviceLink/SDLButtonCapabilities.h @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN * * SDLModuleInfo */ -@property (strong, nonatomic) SDLModuleInfo *moduleInfo; +@property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLButtonCapabilities.m b/SmartDeviceLink/SDLButtonCapabilities.m index dd0d13ea1..1685d0907 100644 --- a/SmartDeviceLink/SDLButtonCapabilities.m +++ b/SmartDeviceLink/SDLButtonCapabilities.m @@ -46,11 +46,11 @@ - (void)setUpDownAvailable:(NSNumber *)upDownAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameUpDownAvailable ofClass:NSNumber.class error:&error]; } -- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { +- (void)setModuleInfo:(nullable SDLModuleInfo *)moduleInfo { [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; } -- (SDLModuleInfo *)moduleInfo { +- (nullable SDLModuleInfo *)moduleInfo { return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; } diff --git a/SmartDeviceLink/SDLButtonPress.h b/SmartDeviceLink/SDLButtonPress.h index 14b9a1a62..0331dce61 100644 --- a/SmartDeviceLink/SDLButtonPress.h +++ b/SmartDeviceLink/SDLButtonPress.h @@ -28,7 +28,7 @@ NS_ASSUME_NONNULL_BEGIN * * SDLModuleInfo */ -@property (strong, nonatomic) NSString *moduleId; +@property (nullable, strong, nonatomic) NSString *moduleId; /** * The name of supported RC climate or radio button. diff --git a/SmartDeviceLink/SDLButtonPress.m b/SmartDeviceLink/SDLButtonPress.m index fd441899f..1dbb355d7 100644 --- a/SmartDeviceLink/SDLButtonPress.m +++ b/SmartDeviceLink/SDLButtonPress.m @@ -59,11 +59,11 @@ - (SDLButtonPressMode)buttonPressMode { return [self.parameters sdl_enumForName:SDLRPCParameterNameButtonPressMode error:&error]; } -- (void)setModuleId:(NSString *)moduleId { +- (void)setModuleId:(nullable NSString *)moduleId { [self.parameters sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; } -- (NSString *)moduleId { +- (nullable NSString *)moduleId { NSError *error = nil; return [self.parameters sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; } diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.h b/SmartDeviceLink/SDLClimateControlCapabilities.h index 46ac24622..bd7b627d8 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.h +++ b/SmartDeviceLink/SDLClimateControlCapabilities.h @@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN * * SDLModuleInfo */ -@property (strong, nonatomic) SDLModuleInfo *moduleInfo; +@property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.m b/SmartDeviceLink/SDLClimateControlCapabilities.m index 31226c1d4..b98ffbab3 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.m +++ b/SmartDeviceLink/SDLClimateControlCapabilities.m @@ -179,11 +179,11 @@ - (void)setClimateEnableAvailable:(nullable NSNumber *)climateEnableAva return [self.store sdl_objectForName:SDLRPCParameterNameClimateEnableAvailable ofClass:NSNumber.class error:nil]; } -- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { +- (void)setModuleInfo:(nullable SDLModuleInfo *)moduleInfo { [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; } -- (SDLModuleInfo *)moduleInfo { +- (nullable SDLModuleInfo *)moduleInfo { return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; } diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.h b/SmartDeviceLink/SDLGetInteriorVehicleData.h index ed418c1b0..4ab481a9c 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.h +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.h @@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN * * SDLModuleInfo */ -@property (strong, nonatomic) NSString *moduleId; +@property (nullable, strong, nonatomic) NSString *moduleId; /** * If subscribe is true, the head unit will register OnInteriorVehicleData notifications for the requested module (moduleId and moduleType). diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.m b/SmartDeviceLink/SDLGetInteriorVehicleData.m index 4b37e0418..57f0aa833 100755 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.m @@ -110,11 +110,11 @@ - (void)setSubscribe:(nullable NSNumber *)subscribe { return [self.parameters sdl_objectForName:SDLRPCParameterNameSubscribe ofClass:NSNumber.class error:nil]; } -- (void)setModuleId:(NSString *)moduleId { +- (void)setModuleId:(nullable NSString *)moduleId { [self.parameters sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; } -- (NSString *)moduleId { +- (nullable NSString *)moduleId { NSError *error = nil; return [self.parameters sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; } diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h b/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h index 7a7283ea7..ff647fcde 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h @@ -20,14 +20,14 @@ NS_ASSUME_NONNULL_BEGIN * * Required */ -@property (strong, nonatomic, nullable) SDLModuleType moduleType; +@property (strong, nonatomic) SDLModuleType moduleType; /** * Ids of a module of same type, published by System Capability. * * Required */ -@property (strong, nonatomic, nullable) NSArray *moduleIds; +@property (strong, nonatomic) NSArray *moduleIds; @end diff --git a/SmartDeviceLink/SDLGrid.h b/SmartDeviceLink/SDLGrid.h index a89a44370..64ad01e2f 100644 --- a/SmartDeviceLink/SDLGrid.h +++ b/SmartDeviceLink/SDLGrid.h @@ -31,25 +31,25 @@ NS_ASSUME_NONNULL_BEGIN * * Optional, Integer, -1 - 100 */ -@property (strong, nonatomic) NSNumber *level; +@property (strong, nonatomic, nullable) NSNumber *level; /** * * Optional, Integer, 1 - 100 */ -@property (strong, nonatomic) NSNumber *colspan; +@property (strong, nonatomic, nullable) NSNumber *colspan; /** * * Optional, Integer, 1 - 100 */ -@property (strong, nonatomic) NSNumber *rowspan; +@property (strong, nonatomic, nullable) NSNumber *rowspan; /** * * Optional, Integer, 1 - 100 */ -@property (strong, nonatomic) NSNumber *levelspan; +@property (strong, nonatomic, nullable) NSNumber *levelspan; @end diff --git a/SmartDeviceLink/SDLGrid.m b/SmartDeviceLink/SDLGrid.m index b146ebaa6..f0e5d333d 100644 --- a/SmartDeviceLink/SDLGrid.m +++ b/SmartDeviceLink/SDLGrid.m @@ -31,38 +31,38 @@ - (void)setRow:(NSNumber *)row { return [self.store sdl_objectForName:SDLRPCParameterNameRow ofClass:NSNumber.class error:&error]; } -- (void)setLevel:(NSNumber *)level { +- (void)setLevel:(nullable NSNumber *)level { [self.store sdl_setObject:level forName:SDLRPCParameterNameLevel]; } -- (NSNumber *)level { +- (nullable NSNumber *)level { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameLevel ofClass:NSNumber.class error:&error]; } -- (void)setColspan:(NSNumber *)colspan { +- (void)setColspan:(nullable NSNumber *)colspan { [self.store sdl_setObject:colspan forName:SDLRPCParameterNameColSpan]; } -- (NSNumber *)colspan { +- (nullable NSNumber *)colspan { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameColSpan ofClass:NSNumber.class error:&error]; } -- (void)setRowspan:(NSNumber *)rowspan { +- (void)setRowspan:(nullable NSNumber *)rowspan { [self.store sdl_setObject:rowspan forName:SDLRPCParameterNameRowSpan]; } -- (NSNumber *)rowspan { +- (nullable NSNumber *)rowspan { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameRowSpan ofClass:NSNumber.class error:&error]; } -- (void)setLevelspan:(NSNumber *)levelspan { +- (void)setLevelspan:(nullable NSNumber *)levelspan { [self.store sdl_setObject:levelspan forName:SDLRPCParameterNameLevelSpan]; } -- (NSNumber *)levelspan { +- (nullable NSNumber *)levelspan { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameLevelSpan ofClass:NSNumber.class error:&error]; } diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h index f42c95f88..22bd271cf 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h @@ -86,7 +86,7 @@ NS_ASSUME_NONNULL_BEGIN * * SDLModuleInfo */ -@property (strong, nonatomic) SDLModuleInfo *moduleInfo; +@property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m index a9a76b3fe..76cdde011 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m @@ -91,11 +91,11 @@ - (void)setDisplayModeUnitAvailable:(nullable NSNumber *)displayModeUni return [self.store sdl_objectForName:SDLRPCParameterNameDisplayModeUnitAvailable ofClass:NSNumber.class error:nil]; } -- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { +- (void)setModuleInfo:(nullable SDLModuleInfo *)moduleInfo { [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; } -- (SDLModuleInfo *)moduleInfo { +- (nullable SDLModuleInfo *)moduleInfo { return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; } diff --git a/SmartDeviceLink/SDLLightControlCapabilities.h b/SmartDeviceLink/SDLLightControlCapabilities.h index aebb7a14f..c1af7e1c2 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.h +++ b/SmartDeviceLink/SDLLightControlCapabilities.h @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN * * SDLModuleInfo */ -@property (strong, nonatomic) SDLModuleInfo *moduleInfo; +@property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLLightControlCapabilities.m b/SmartDeviceLink/SDLLightControlCapabilities.m index 7f261b2e3..c866737f3 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.m +++ b/SmartDeviceLink/SDLLightControlCapabilities.m @@ -53,11 +53,11 @@ - (void)setSupportedLights:(NSArray *)supportedLights { return [self.store sdl_objectsForName:SDLRPCParameterNameSupportedLights ofClass:SDLLightCapabilities.class error:&error]; } -- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { +- (void)setModuleInfo:(nullable SDLModuleInfo *)moduleInfo { [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; } -- (SDLModuleInfo *)moduleInfo { +- (nullable SDLModuleInfo *)moduleInfo { return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; } diff --git a/SmartDeviceLink/SDLModuleData.h b/SmartDeviceLink/SDLModuleData.h index 208750e7a..3ed7bfd15 100644 --- a/SmartDeviceLink/SDLModuleData.h +++ b/SmartDeviceLink/SDLModuleData.h @@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN Optional */ -@property (strong, nonatomic) NSString *moduleId; +@property (nullable, strong, nonatomic) NSString *moduleId; /** The radio control data diff --git a/SmartDeviceLink/SDLModuleData.m b/SmartDeviceLink/SDLModuleData.m index c196be9c4..9595deb4c 100644 --- a/SmartDeviceLink/SDLModuleData.m +++ b/SmartDeviceLink/SDLModuleData.m @@ -97,11 +97,11 @@ - (SDLModuleType)moduleType { return [self.store sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; } -- (void)setModuleId:(NSString *)moduleId { +- (void)setModuleId:(nullable NSString *)moduleId { [self.store sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; } -- (NSString *)moduleId { +- (nullable NSString *)moduleId { NSError *error = nil; return [self.store sdl_enumForName:SDLRPCParameterNameModuleId error:&error]; } diff --git a/SmartDeviceLink/SDLModuleInfo.h b/SmartDeviceLink/SDLModuleInfo.h index 347624f4d..f8dabce60 100644 --- a/SmartDeviceLink/SDLModuleInfo.h +++ b/SmartDeviceLink/SDLModuleInfo.h @@ -23,19 +23,19 @@ NS_ASSUME_NONNULL_BEGIN Required */ -@property (strong, nonatomic) NSString *moduleId; +@property (nullable, strong, nonatomic) NSString *moduleId; /** * Location of a module. * Optional */ -@property (strong, nonatomic) SDLGrid *location; +@property (nullable, strong, nonatomic) SDLGrid *location; /** * Service area of a module. * Optional */ -@property (strong, nonatomic) SDLGrid *serviceArea; +@property (nullable, strong, nonatomic) SDLGrid *serviceArea; /** * Allow multiple users/apps to access the module or not diff --git a/SmartDeviceLink/SDLModuleInfo.m b/SmartDeviceLink/SDLModuleInfo.m index 7a566cfcc..46a95e697 100644 --- a/SmartDeviceLink/SDLModuleInfo.m +++ b/SmartDeviceLink/SDLModuleInfo.m @@ -22,29 +22,29 @@ - (NSString *)moduleId { return [self.store sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; } -- (void)setLocation:(SDLGrid *)location { +- (void)setLocation:(nullable SDLGrid *)location { [self.store sdl_setObject:location forName:SDLRPCParameterNameLocation]; } -- (SDLGrid *)location { +- (nullable SDLGrid *)location { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameLocation ofClass:SDLGrid.class error:&error]; } -- (void)setServiceArea:(SDLGrid *)serviceArea { +- (void)setServiceArea:(nullable SDLGrid *)serviceArea { [self.store sdl_setObject:serviceArea forName:SDLRPCParameterNameServiceArea]; } -- (SDLGrid *)serviceArea { +- (nullable SDLGrid *)serviceArea { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameServiceArea ofClass:SDLGrid.class error:&error]; } -- (void)setAllowMultipleAccess:(NSNumber *)allowMultipleAccess { +- (void)setAllowMultipleAccess:(nullable NSNumber *)allowMultipleAccess { [self.store sdl_setObject:allowMultipleAccess forName:SDLRPCParameterNameAllowMultipleAccess]; } -- (NSNumber *)allowMultipleAccess { +- (nullable NSNumber *)allowMultipleAccess { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameAllowMultipleAccess ofClass:NSNumber.class error:&error]; } diff --git a/SmartDeviceLink/SDLRadioControlCapabilities.h b/SmartDeviceLink/SDLRadioControlCapabilities.h index e9ea63bb0..c7ff5280e 100644 --- a/SmartDeviceLink/SDLRadioControlCapabilities.h +++ b/SmartDeviceLink/SDLRadioControlCapabilities.h @@ -197,7 +197,7 @@ NS_ASSUME_NONNULL_BEGIN * * SDLModuleInfo */ -@property (strong, nonatomic) SDLModuleInfo *moduleInfo; +@property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLRadioControlCapabilities.m b/SmartDeviceLink/SDLRadioControlCapabilities.m index a9340bf8c..52309f55a 100644 --- a/SmartDeviceLink/SDLRadioControlCapabilities.m +++ b/SmartDeviceLink/SDLRadioControlCapabilities.m @@ -173,11 +173,11 @@ - (void)setSisDataAvailable:(nullable NSNumber *)sisDataAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameSISDataAvailable ofClass:NSNumber.class error:nil]; } -- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { +- (void)setModuleInfo:(nullable SDLModuleInfo *)moduleInfo { [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; } -- (SDLModuleInfo *)moduleInfo { +- (nullable SDLModuleInfo *)moduleInfo { return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; } diff --git a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h index 9053c623a..e8d946244 100644 --- a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h +++ b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h @@ -20,12 +20,12 @@ NS_ASSUME_NONNULL_BEGIN * * Required */ -@property (strong, nonatomic, nullable) SDLModuleType moduleType; +@property (strong, nonatomic) SDLModuleType moduleType; /** * Id of a module, published by System Capability. * - * Required + * Optional */ @property (strong, nonatomic, nullable) NSString *moduleId; diff --git a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m index 40927a793..b28247963 100644 --- a/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m +++ b/SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.m @@ -44,11 +44,11 @@ - (SDLModuleType)moduleType { return [self.parameters sdl_enumForName:SDLRPCParameterNameModuleType error:&error]; } -- (void)setModuleId:(NSArray *)moduleId { +- (void)setModuleId:(nullable NSString *)moduleId { [self.parameters sdl_setObject:moduleId forName:SDLRPCParameterNameModuleId]; } -- (NSString *)moduleId { +- (nullable NSString *)moduleId { NSError *error = nil; return [self.parameters sdl_objectForName:SDLRPCParameterNameModuleId ofClass:NSString.class error:&error]; } diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.h b/SmartDeviceLink/SDLSeatControlCapabilities.h index 7806375f9..c2f9c8cde 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.h +++ b/SmartDeviceLink/SDLSeatControlCapabilities.h @@ -136,11 +136,11 @@ NS_ASSUME_NONNULL_BEGIN @property (nullable, strong, nonatomic) NSNumber *memoryAvailable; /** - * Information about a RC module, including its id. + * @abstract Information about a RC module, including its id. * - * SDLModuleInfo + * Optional */ -@property (strong, nonatomic) SDLModuleInfo *moduleInfo; +@property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; @end diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.m b/SmartDeviceLink/SDLSeatControlCapabilities.m index eb1f3a002..f606dd4f8 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.m +++ b/SmartDeviceLink/SDLSeatControlCapabilities.m @@ -236,11 +236,11 @@ - (void)setMemoryAvailable:(nullable NSNumber *)memoryAvailable { return [self.store sdl_objectForName:SDLRPCParameterNameMemoryAvailable ofClass:NSNumber.class error:nil]; } -- (void)setModuleInfo:(SDLModuleInfo *)moduleInfo { +- (void)setModuleInfo:(nullable SDLModuleInfo *)moduleInfo { [self.store sdl_setObject:moduleInfo forName:SDLRPCParameterNameModuleInfo]; } -- (SDLModuleInfo *)moduleInfo { +- (nullable SDLModuleInfo *)moduleInfo { return [self.store sdl_objectForName:SDLRPCParameterNameModuleInfo ofClass:SDLModuleInfo.class error:nil]; } diff --git a/SmartDeviceLink/SDLSeatLocation.h b/SmartDeviceLink/SDLSeatLocation.h index 072d2f61d..0c4d70597 100644 --- a/SmartDeviceLink/SDLSeatLocation.h +++ b/SmartDeviceLink/SDLSeatLocation.h @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Optional */ -@property (strong, nonatomic) SDLGrid *grid; +@property (strong, nonatomic, nullable) SDLGrid *grid; @end diff --git a/SmartDeviceLink/SDLSeatLocation.m b/SmartDeviceLink/SDLSeatLocation.m index 65ba86d1d..82fc28940 100644 --- a/SmartDeviceLink/SDLSeatLocation.m +++ b/SmartDeviceLink/SDLSeatLocation.m @@ -13,11 +13,11 @@ @implementation SDLSeatLocation -- (void)setGrid:(SDLGrid *)grid { +- (void)setGrid:(nullable SDLGrid *)grid { [self.store sdl_setObject:grid forName:SDLRPCParameterNameGrid]; } -- (SDLGrid *)grid { +- (nullable SDLGrid *)grid { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameGrid ofClass:SDLGrid.class error:&error]; } diff --git a/SmartDeviceLink/SDLSeatLocationCapability.h b/SmartDeviceLink/SDLSeatLocationCapability.h index ae41df9a5..9f7d6a15f 100644 --- a/SmartDeviceLink/SDLSeatLocationCapability.h +++ b/SmartDeviceLink/SDLSeatLocationCapability.h @@ -23,25 +23,25 @@ NS_ASSUME_NONNULL_BEGIN * * Optional, Integer, 1 - 100 */ -@property (strong, nonatomic) NSNumber *cols; +@property (strong, nonatomic, nullable) NSNumber *cols; /** * * Optional, Integer, 1 - 100 */ -@property (strong, nonatomic) NSNumber *rows; +@property (strong, nonatomic, nullable) NSNumber *rows; /** * * Optional, Integer, 1 - 100 */ -@property (strong, nonatomic) NSNumber *levels; +@property (strong, nonatomic, nullable) NSNumber *levels; /** * Contains a list of SeatLocation in the vehicle, the first element is the driver's seat * Optional */ -@property (strong, nonatomic) NSArray *seats; +@property (strong, nonatomic, nullable) NSArray *seats; @end diff --git a/SmartDeviceLink/SDLSeatLocationCapability.m b/SmartDeviceLink/SDLSeatLocationCapability.m index 94d085362..f6c59e58c 100644 --- a/SmartDeviceLink/SDLSeatLocationCapability.m +++ b/SmartDeviceLink/SDLSeatLocationCapability.m @@ -29,38 +29,38 @@ - (instancetype)initWithSeats:(NSArray *)seats cols:(NSNumber return self; } -- (void)setCols:(NSNumber *)cols { +- (void)setCols:(nullable NSNumber *)cols { [self.store sdl_setObject:cols forName:SDLRPCParameterNameColumns]; } -- (NSNumber *)cols { +- (nullable NSNumber *)cols { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameColumns ofClass:NSNumber.class error:&error]; } -- (void)setRows:(NSNumber *)rows { +- (void)setRows:(nullable NSNumber *)rows { [self.store sdl_setObject:rows forName:SDLRPCParameterNameRows]; } -- (NSNumber *)rows { +- (nullable NSNumber *)rows { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameRows ofClass:NSNumber.class error:&error]; } -- (void)setLevels:(NSNumber *)levels { +- (void)setLevels:(nullable NSNumber *)levels { [self.store sdl_setObject:levels forName:SDLRPCParameterNameLevels]; } -- (NSNumber *)levels { +- (nullable NSNumber *)levels { NSError *error = nil; return [self.store sdl_objectForName:SDLRPCParameterNameLevels ofClass:NSNumber.class error:&error]; } -- (void)setSeats:(NSArray *)seats { +- (void)setSeats:(nullable NSArray *)seats { [self.store sdl_setObject:seats forName:SDLRPCParameterNameSeats]; } -- (NSArray *)seats { +- (nullable NSArray *)seats { NSError *error = nil; return [self.store sdl_objectsForName:SDLRPCParameterNameSeats ofClass:SDLSeatLocation.class error:&error]; } From 525704fd396d9eda3c031f79ec4fe36838385798 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Tue, 13 Aug 2019 13:38:01 -0700 Subject: [PATCH 28/35] Update SDLFunctionID.m Add function ids --- SmartDeviceLink/SDLFunctionID.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SmartDeviceLink/SDLFunctionID.m b/SmartDeviceLink/SDLFunctionID.m index d1940883c..3147fde79 100644 --- a/SmartDeviceLink/SDLFunctionID.m +++ b/SmartDeviceLink/SDLFunctionID.m @@ -90,6 +90,8 @@ - (instancetype)init { @55: SDLRPCFunctionNamePerformAppServiceInteraction, @56: SDLRPCFunctionNameUnpublishAppService, @58: SDLRPCFunctionNameCloseApplication, + @62: SDLRPCFunctionNameGetInteriorVehicleDataConsent, + @63: SDLRPCFunctionNameReleaseInteriorVehicleDataModule, @32768: SDLRPCFunctionNameOnHMIStatus, @32769: SDLRPCFunctionNameOnAppInterfaceUnregistered, @32770: SDLRPCFunctionNameOnButtonEvent, From 87addfec0c8aa388dabbaf3d43aa435a46bf8c5f Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 22 Aug 2019 14:54:20 -0700 Subject: [PATCH 29/35] Fix documentation --- SmartDeviceLink/SDLAudioControlCapabilities.h | 2 +- SmartDeviceLink/SDLButtonCapabilities.h | 2 +- SmartDeviceLink/SDLButtonPress.h | 4 ++-- SmartDeviceLink/SDLClimateControlCapabilities.h | 2 +- SmartDeviceLink/SDLGetInteriorVehicleData.h | 8 ++++---- SmartDeviceLink/SDLHMISettingsControlCapabilities.h | 2 +- SmartDeviceLink/SDLLightControlCapabilities.h | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.h b/SmartDeviceLink/SDLAudioControlCapabilities.h index 0429b7ab3..7188af900 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.h +++ b/SmartDeviceLink/SDLAudioControlCapabilities.h @@ -97,7 +97,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Information about a RC module, including its id. * - * SDLModuleInfo + * Optional */ @property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; diff --git a/SmartDeviceLink/SDLButtonCapabilities.h b/SmartDeviceLink/SDLButtonCapabilities.h index 91dbca733..1333da2cf 100644 --- a/SmartDeviceLink/SDLButtonCapabilities.h +++ b/SmartDeviceLink/SDLButtonCapabilities.h @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Information about a RC module, including its id. * - * SDLModuleInfo + * Optional */ @property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; diff --git a/SmartDeviceLink/SDLButtonPress.h b/SmartDeviceLink/SDLButtonPress.h index 0331dce61..8b79c4adb 100644 --- a/SmartDeviceLink/SDLButtonPress.h +++ b/SmartDeviceLink/SDLButtonPress.h @@ -24,9 +24,9 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic) SDLModuleType moduleType; /** - * Information about a RC module, including its id. + * Id of a module, published by System Capability. * - * SDLModuleInfo + * Optional */ @property (nullable, strong, nonatomic) NSString *moduleId; diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.h b/SmartDeviceLink/SDLClimateControlCapabilities.h index bd7b627d8..d00a16023 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.h +++ b/SmartDeviceLink/SDLClimateControlCapabilities.h @@ -160,7 +160,7 @@ NS_ASSUME_NONNULL_BEGIN /* * Information about a RC module, including its id. * - * SDLModuleInfo + * Optional */ @property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; diff --git a/SmartDeviceLink/SDLGetInteriorVehicleData.h b/SmartDeviceLink/SDLGetInteriorVehicleData.h index 4ab481a9c..143a2468f 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleData.h +++ b/SmartDeviceLink/SDLGetInteriorVehicleData.h @@ -24,9 +24,9 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType moduleId:(NSString *)moduleId; -- (instancetype)initWithModuleType:(SDLModuleType)moduleType __deprecated_msg("Use initWithModuleType:moduleId:"); +- (instancetype)initWithModuleType:(SDLModuleType)moduleType __deprecated_msg("Use initWithModuleType:moduleId: instead"); -- (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType __deprecated_msg("Use initAndSubscribeToModuleType:moduleId:"); +- (instancetype)initAndSubscribeToModuleType:(SDLModuleType)moduleType __deprecated_msg("Use initAndSubscribeToModuleType:moduleId: instead"); - (instancetype)initAndUnsubscribeToModuleType:(SDLModuleType)moduleType __deprecated_msg("Use initAndUnsubscribeToModuleType:moduleId:"); @@ -37,9 +37,9 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic) SDLModuleType moduleType; /** - * Information about a RC module, including its id. + * Id of a module, published by System Capability. * - * SDLModuleInfo + * Optional */ @property (nullable, strong, nonatomic) NSString *moduleId; diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h index 22bd271cf..f7d1cce74 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h @@ -84,7 +84,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Information about a RC module, including its id. * - * SDLModuleInfo + * Optional */ @property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; diff --git a/SmartDeviceLink/SDLLightControlCapabilities.h b/SmartDeviceLink/SDLLightControlCapabilities.h index c1af7e1c2..fdbe222e3 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.h +++ b/SmartDeviceLink/SDLLightControlCapabilities.h @@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN /** * Information about a RC module, including its id. * - * SDLModuleInfo + * Optional */ @property (nullable, strong, nonatomic) SDLModuleInfo *moduleInfo; From f9d73d0f1ba4ff684a79f6d0e15cea9142a5dbc4 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 22 Aug 2019 15:29:46 -0700 Subject: [PATCH 30/35] Add new initializers and deprecate old ones --- SmartDeviceLink/SDLAudioControlCapabilities.h | 4 +-- SmartDeviceLink/SDLAudioControlCapabilities.m | 4 +-- SmartDeviceLink/SDLButtonPress.h | 4 ++- SmartDeviceLink/SDLButtonPress.m | 13 ++++++++ .../SDLClimateControlCapabilities.h | 6 ++-- .../SDLClimateControlCapabilities.m | 5 +++ .../SDLHMISettingsControlCapabilities.h | 4 +-- .../SDLHMISettingsControlCapabilities.m | 4 +-- SmartDeviceLink/SDLLightControlCapabilities.h | 2 +- SmartDeviceLink/SDLLightControlCapabilities.m | 2 +- SmartDeviceLink/SDLRadioControlCapabilities.h | 29 ++++++++++++++--- SmartDeviceLink/SDLRadioControlCapabilities.m | 32 ++++++++++++++++--- SmartDeviceLink/SDLSeatControlCapabilities.h | 4 +-- SmartDeviceLink/SDLSeatControlCapabilities.m | 4 +-- 14 files changed, 92 insertions(+), 25 deletions(-) diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.h b/SmartDeviceLink/SDLAudioControlCapabilities.h index 7188af900..d91bef2ef 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.h +++ b/SmartDeviceLink/SDLAudioControlCapabilities.h @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN @param moduleInfo Information about a RC module, including its id. @return An instance of the SDLAudioControlCapabilities class. */ -- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(SDLModuleInfo *)moduleInfo; +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo; /** Constructs a newly allocated SDLAudioControlCapabilities object with given parameters @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN @param equalizerMaxChannelID Equalizer channel ID (between 1-100). @return An instance of the SDLAudioControlCapabilities class. */ -- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID; +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID; /** * @abstract The short friendly name of the audio control module. diff --git a/SmartDeviceLink/SDLAudioControlCapabilities.m b/SmartDeviceLink/SDLAudioControlCapabilities.m index 514698180..bc7ff568d 100644 --- a/SmartDeviceLink/SDLAudioControlCapabilities.m +++ b/SmartDeviceLink/SDLAudioControlCapabilities.m @@ -19,7 +19,7 @@ - (instancetype)initWithModuleName:(NSString *)name { return self; } -- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(SDLModuleInfo *)moduleInfo { +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo { self = [self init]; if (!self) { return nil; @@ -45,7 +45,7 @@ - (instancetype)initWithModuleName:(NSString *)name sourceAvailable:(nullable NS return self; } -- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID { +- (instancetype)initWithModuleName:(NSString *)name moduleInfo:(nullable SDLModuleInfo *)moduleInfo sourceAvailable:(nullable NSNumber *)sourceAvailable keepContextAvailable:(nullable NSNumber *)keepContextAvailable volumeAvailable:(nullable NSNumber *)volumeAvailable equalizerAvailable:(nullable NSNumber *)equalizerAvailable equalizerMaxChannelID:(nullable NSNumber *)equalizerMaxChannelID { self = [self init]; if (!self) { return nil; diff --git a/SmartDeviceLink/SDLButtonPress.h b/SmartDeviceLink/SDLButtonPress.h index 8b79c4adb..c36481331 100644 --- a/SmartDeviceLink/SDLButtonPress.h +++ b/SmartDeviceLink/SDLButtonPress.h @@ -15,7 +15,9 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLButtonPress : SDLRPCRequest -- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType; +- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType __deprecated_msg(("Use initWithButtonName:moduleType:moduleId instead"));; + +- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType moduleId:(nullable NSString *)moduleId; /** * The module where the button should be pressed. diff --git a/SmartDeviceLink/SDLButtonPress.m b/SmartDeviceLink/SDLButtonPress.m index 1dbb355d7..e92cc559b 100644 --- a/SmartDeviceLink/SDLButtonPress.m +++ b/SmartDeviceLink/SDLButtonPress.m @@ -32,6 +32,19 @@ - (instancetype)initWithButtonName:(SDLButtonName) buttonName moduleType:(SDLMod return self; } +- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType moduleId:(nullable NSString *)moduleId { + self = [self init]; + if (!self) { + return nil; + } + + self.buttonName = buttonName; + self.moduleType = moduleType; + self.moduleId = moduleId; + + return self; +} + - (void)setModuleType:(SDLModuleType)moduleType { [self.parameters sdl_setObject:moduleType forName:SDLRPCParameterNameModuleType]; } diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.h b/SmartDeviceLink/SDLClimateControlCapabilities.h index d00a16023..99ad8fece 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.h +++ b/SmartDeviceLink/SDLClimateControlCapabilities.h @@ -18,7 +18,9 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)heatedSteeringWheelAvailable heatedWindshieldAvailable:(BOOL)heatedWindshieldAvailable heatedRearWindowAvailable:(BOOL)heatedRearWindowAvailable heatedMirrorsAvailable:(BOOL)heatedMirrorsAvailable __deprecated_msg("Use initWithModuleName:fanSpeedAvailable:desiredTemperatureAvailable:acEnableAvailable:acMaxEnableAvailable:circulateAirAvailable:autoModeEnableAvailable: dualModeEnableAvailable:defrostZoneAvailable:ventilationModeAvailable: heatedSteeringWheelAvailable:heatedWindshieldAvailable: heatedRearWindowAvailable:heatedMirrorsAvailable: climateEnableAvailable: instead"); -- (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)heatedSteeringWheelAvailable heatedWindshieldAvailable:(BOOL)heatedWindshieldAvailable heatedRearWindowAvailable:(BOOL)heatedRearWindowAvailable heatedMirrorsAvailable:(BOOL)heatedMirrorsAvailable climateEnableAvailable:(BOOL)climateEnableAvailable; +- (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)heatedSteeringWheelAvailable heatedWindshieldAvailable:(BOOL)heatedWindshieldAvailable heatedRearWindowAvailable:(BOOL)heatedRearWindowAvailable heatedMirrorsAvailable:(BOOL)heatedMirrorsAvailable climateEnableAvailable:(BOOL)climateEnableAvailable __deprecated_msg("Use initWithModuleName: moduleId:fanSpeedAvailable:desiredTemperatureAvailable:acEnableAvailable:acMaxEnableAvailable:circulateAirAvailable:autoModeEnableAvailable: dualModeEnableAvailable:defrostZoneAvailable:ventilationModeAvailable: heatedSteeringWheelAvailable:heatedWindshieldAvailable: heatedRearWindowAvailable:heatedMirrorsAvailable: climateEnableAvailable: instead"); + +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)heatedSteeringWheelAvailable heatedWindshieldAvailable:(BOOL)heatedWindshieldAvailable heatedRearWindowAvailable:(BOOL)heatedRearWindowAvailable heatedMirrorsAvailable:(BOOL)heatedMirrorsAvailable climateEnableAvailable:(BOOL)climateEnableAvailable; /** * The short friendly name of the climate control module. @@ -157,7 +159,7 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, strong, nonatomic) NSNumber *climateEnableAvailable; -/* +/** * Information about a RC module, including its id. * * Optional diff --git a/SmartDeviceLink/SDLClimateControlCapabilities.m b/SmartDeviceLink/SDLClimateControlCapabilities.m index b98ffbab3..5742cb82c 100644 --- a/SmartDeviceLink/SDLClimateControlCapabilities.m +++ b/SmartDeviceLink/SDLClimateControlCapabilities.m @@ -19,12 +19,17 @@ - (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOO } - (instancetype)initWithModuleName:(NSString *)moduleName fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)steeringWheelAvailable heatedWindshieldAvailable:(BOOL)windshieldAvailable heatedRearWindowAvailable:(BOOL)rearWindowAvailable heatedMirrorsAvailable:(BOOL)mirrorsAvailable climateEnableAvailable:(BOOL)climateEnableAvailable{ + return [self initWithModuleName:moduleName moduleInfo:nil fanSpeedAvailable:fanSpeedAvailable desiredTemperatureAvailable:desiredTemperatureAvailable acEnableAvailable:acEnableAvailable acMaxEnableAvailable:acMaxEnableAvailable circulateAirAvailable:circulateAirEnableAvailable autoModeEnableAvailable:autoModeEnableAvailable dualModeEnableAvailable:dualModeEnableAvailable defrostZoneAvailable:defrostZoneAvailable ventilationModeAvailable:ventilationModeAvailable heatedSteeringWheelAvailable:steeringWheelAvailable heatedWindshieldAvailable:windshieldAvailable heatedRearWindowAvailable:rearWindowAvailable heatedMirrorsAvailable:mirrorsAvailable climateEnableAvailable:NO]; +} + +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo fanSpeedAvailable:(BOOL)fanSpeedAvailable desiredTemperatureAvailable:(BOOL)desiredTemperatureAvailable acEnableAvailable:(BOOL)acEnableAvailable acMaxEnableAvailable:(BOOL)acMaxEnableAvailable circulateAirAvailable:(BOOL)circulateAirEnableAvailable autoModeEnableAvailable:(BOOL)autoModeEnableAvailable dualModeEnableAvailable:(BOOL)dualModeEnableAvailable defrostZoneAvailable:(BOOL)defrostZoneAvailable ventilationModeAvailable:(BOOL)ventilationModeAvailable heatedSteeringWheelAvailable:(BOOL)steeringWheelAvailable heatedWindshieldAvailable:(BOOL)windshieldAvailable heatedRearWindowAvailable:(BOOL)rearWindowAvailable heatedMirrorsAvailable:(BOOL)mirrorsAvailable climateEnableAvailable:(BOOL)climateEnableAvailable{ self = [self init]; if (!self) { return nil; } self.moduleName = moduleName; + self.moduleInfo = moduleInfo; self.fanSpeedAvailable = @(fanSpeedAvailable); self.desiredTemperatureAvailable = @(desiredTemperatureAvailable); self.acEnableAvailable = @(acEnableAvailable); diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h index f7d1cce74..4f0f0cf45 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.h +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.h @@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN @return An instance of the SDLHMISettingsControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo; +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo; /** Constructs a newly allocated SDLHMISettingsControlCapabilities object with given parameters @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN @return An instance of the SDLHMISettingsControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable; +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable; /** * @abstract The short friendly name of the hmi setting module. diff --git a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m index 76cdde011..d7dab5f6f 100644 --- a/SmartDeviceLink/SDLHMISettingsControlCapabilities.m +++ b/SmartDeviceLink/SDLHMISettingsControlCapabilities.m @@ -19,7 +19,7 @@ - (instancetype)initWithModuleName:(NSString *)moduleName { return self; } -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo { +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo { self = [self init]; if(!self) { return nil; @@ -43,7 +43,7 @@ - (instancetype)initWithModuleName:(NSString *)moduleName distanceUnitAvailable: return self; } -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable { +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo distanceUnitAvailable:(BOOL)distanceUnitAvailable temperatureUnitAvailable:(BOOL)temperatureUnitAvailable displayModeUnitAvailable:(BOOL)displayModeUnitAvailable { self = [self init]; if(!self) { return nil; diff --git a/SmartDeviceLink/SDLLightControlCapabilities.h b/SmartDeviceLink/SDLLightControlCapabilities.h index fdbe222e3..d50e14db9 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.h +++ b/SmartDeviceLink/SDLLightControlCapabilities.h @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN @param supportedLights array of available LightCapabilities @return An instance of the SDLLightControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights; +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights; /** * @abstract The short friendly name of the light control module. diff --git a/SmartDeviceLink/SDLLightControlCapabilities.m b/SmartDeviceLink/SDLLightControlCapabilities.m index c866737f3..4a899c2dd 100644 --- a/SmartDeviceLink/SDLLightControlCapabilities.m +++ b/SmartDeviceLink/SDLLightControlCapabilities.m @@ -22,7 +22,7 @@ - (instancetype)initWithModuleName:(NSString *)moduleName supportedLights:(NSArr return self; } -- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights { +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo supportedLights:(NSArray *)supportedLights { self = [self init]; if(!self) { return nil; diff --git a/SmartDeviceLink/SDLRadioControlCapabilities.h b/SmartDeviceLink/SDLRadioControlCapabilities.h index c7ff5280e..0c35df16f 100644 --- a/SmartDeviceLink/SDLRadioControlCapabilities.h +++ b/SmartDeviceLink/SDLRadioControlCapabilities.h @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN @param radioFrequencyAvailable Availability of the control of radio frequency. @param hdChannelAvailable Availability of the control of HD radio channel. @param rdsDataAvailable Availability of the getting Radio Data System (RDS) data. - @param availableHDChannelsAvailable Availability of the list of available HD sub-channel indexes. + @param availableHDsAvailable Availability of the getting the number of available HD channels. @param stateAvailable Availability of the getting the Radio state. @param signalStrengthAvailable Availability of the getting the signal strength. @param signalChangeThresholdAvailable Availability of the getting the signal Change Threshold. @@ -47,18 +47,39 @@ NS_ASSUME_NONNULL_BEGIN @param sisDataAvailable Availability of sis data. @return An instance of the SDLRadioControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDChannelsAvailable:(BOOL)availableHDChannelsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable; +- (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDsAvailable:(BOOL)availableHDsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable __deprecated_msg(("Use initWithModuleName:moduleName:radioEnableAvailable radioFrequencyAvailable:hdChannelAvailable:rdsDataAvailable:availableHDChannelsAvailable:stateAvailable:signalStrengthAvailable:signalChangeThresholdAvailable:hdRadioEnableAvailable:siriusXMRadioAvailable:sisDataAvailable: instead")); /** Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. + + @param moduleName The short friendly name of the radio control module. + @param radioEnableAvailable Availability of the control of enable/disable radio. + @param radioBandAvailable Availability of the control of radio band. + @param radioFrequencyAvailable Availability of the control of radio frequency. + @param hdChannelAvailable Availability of the control of HD radio channel. + @param rdsDataAvailable Availability of the getting Radio Data System (RDS) data. + @param availableHDChannelsAvailable Availability of the list of available HD sub-channel indexes. + @param stateAvailable Availability of the getting the Radio state. + @param signalStrengthAvailable Availability of the getting the signal strength. + @param signalChangeThresholdAvailable Availability of the getting the signal Change Threshold. + @param hdRadioEnableAvailable Availability of the control of enable/disable HD radio. + @param siriusXMRadioAvailable Availability of sirius XM radio. + @param sisDataAvailable Availability of sis data. + @return An instance of the SDLRadioControlCapabilities class + */ +- (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDChannelsAvailable:(BOOL)availableHDChannelsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable __deprecated_msg(("Use initWithModuleName:moduleName:moduleInfo:radioEnableAvailable radioFrequencyAvailable:hdChannelAvailable:rdsDataAvailable:availableHDChannelsAvailable:stateAvailable:signalStrengthAvailable:signalChangeThresholdAvailable:hdRadioEnableAvailable:siriusXMRadioAvailable:sisDataAvailable: instead")); +/** + Constructs a newly allocated SDLRadioControlCapabilities object with given parameters. + @param moduleName The short friendly name of the radio control module. + @param moduleInfo Information about a RC module, including its id. @param radioEnableAvailable Availability of the control of enable/disable radio. @param radioBandAvailable Availability of the control of radio band. @param radioFrequencyAvailable Availability of the control of radio frequency. @param hdChannelAvailable Availability of the control of HD radio channel. @param rdsDataAvailable Availability of the getting Radio Data System (RDS) data. - @param availableHDsAvailable Availability of the getting the number of available HD channels. + @param availableHDChannelsAvailable Availability of the list of available HD sub-channel indexes. @param stateAvailable Availability of the getting the Radio state. @param signalStrengthAvailable Availability of the getting the signal strength. @param signalChangeThresholdAvailable Availability of the getting the signal Change Threshold. @@ -67,7 +88,7 @@ NS_ASSUME_NONNULL_BEGIN @param sisDataAvailable Availability of sis data. @return An instance of the SDLRadioControlCapabilities class */ -- (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDsAvailable:(BOOL)availableHDsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable __deprecated_msg(("Use initWithModuleName:moduleName:radioEnableAvailable radioFrequencyAvailable:hdChannelAvailable:rdsDataAvailable:availableHDChannelsAvailable:stateAvailable:signalStrengthAvailable:signalChangeThresholdAvailable:hdRadioEnableAvailable:siriusXMRadioAvailable:sisDataAvailable: instead")); +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDChannelsAvailable:(BOOL)availableHDChannelsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable; /** * The short friendly name of the radio control module. diff --git a/SmartDeviceLink/SDLRadioControlCapabilities.m b/SmartDeviceLink/SDLRadioControlCapabilities.m index 52309f55a..921e2e651 100644 --- a/SmartDeviceLink/SDLRadioControlCapabilities.m +++ b/SmartDeviceLink/SDLRadioControlCapabilities.m @@ -14,6 +14,29 @@ - (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:( return [self initWithModuleName:moduleName radioEnableAvailable:radioEnableAvailable radioBandAvailable:radioBandAvailable radioFrequencyAvailable:radioFrequencyAvailable hdChannelAvailable:hdChannelAvailable rdsDataAvailable:rdsDataAvailable availableHDsAvailable:availableHDsAvailable stateAvailable:stateAvailable signalStrengthAvailable:signalStrengthAvailable signalChangeThresholdAvailable:signalChangeThresholdAvailable hdRadioEnableAvailable:NO siriusXMRadioAvailable:NO sisDataAvailable:NO]; } +- (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDsAvailable:(BOOL)availableHDsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable { + self = [self init]; + if(!self){ + return nil; + } + + self.moduleName = moduleName; + self.radioEnableAvailable = @(radioEnableAvailable); + self.radioBandAvailable = @(radioBandAvailable); + self.radioFrequencyAvailable = @(radioFrequencyAvailable); + self.hdChannelAvailable = @(hdChannelAvailable); + self.rdsDataAvailable = @(rdsDataAvailable); + self.availableHDsAvailable = @(availableHDsAvailable); + self.stateAvailable = @(stateAvailable); + self.signalStrengthAvailable = @(signalStrengthAvailable); + self.signalChangeThresholdAvailable = @(signalChangeThresholdAvailable); + self.hdRadioEnableAvailable = @(hdRadioEnableAvailable); + self.siriusXMRadioAvailable = @(siriusXMRadioAvailable); + self.sisDataAvailable = @(sisDataAvailable); + + return self; +} + - (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDChannelsAvailable:(BOOL)availableHDChannelsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable { self = [self init]; if(!self){ @@ -37,26 +60,27 @@ - (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:( return self; } -- (instancetype)initWithModuleName:(NSString *)moduleName radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDsAvailable:(BOOL)availableHDsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable { +- (instancetype)initWithModuleName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo radioEnableAvailable:(BOOL)radioEnableAvailable radioBandAvailable:(BOOL)radioBandAvailable radioFrequencyAvailable:(BOOL)radioFrequencyAvailable hdChannelAvailable:(BOOL)hdChannelAvailable rdsDataAvailable:(BOOL)rdsDataAvailable availableHDChannelsAvailable:(BOOL)availableHDChannelsAvailable stateAvailable:(BOOL)stateAvailable signalStrengthAvailable:(BOOL)signalStrengthAvailable signalChangeThresholdAvailable:(BOOL)signalChangeThresholdAvailable hdRadioEnableAvailable:(BOOL)hdRadioEnableAvailable siriusXMRadioAvailable:(BOOL)siriusXMRadioAvailable sisDataAvailable:(BOOL)sisDataAvailable { self = [self init]; if(!self){ return nil; } - + self.moduleName = moduleName; + self.moduleInfo = moduleInfo; self.radioEnableAvailable = @(radioEnableAvailable); self.radioBandAvailable = @(radioBandAvailable); self.radioFrequencyAvailable = @(radioFrequencyAvailable); self.hdChannelAvailable = @(hdChannelAvailable); self.rdsDataAvailable = @(rdsDataAvailable); - self.availableHDsAvailable = @(availableHDsAvailable); + self.availableHDChannelsAvailable = @(availableHDChannelsAvailable); self.stateAvailable = @(stateAvailable); self.signalStrengthAvailable = @(signalStrengthAvailable); self.signalChangeThresholdAvailable = @(signalChangeThresholdAvailable); self.hdRadioEnableAvailable = @(hdRadioEnableAvailable); self.siriusXMRadioAvailable = @(siriusXMRadioAvailable); self.sisDataAvailable = @(sisDataAvailable); - + return self; } diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.h b/SmartDeviceLink/SDLSeatControlCapabilities.h index c2f9c8cde..b54287086 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.h +++ b/SmartDeviceLink/SDLSeatControlCapabilities.h @@ -14,12 +14,12 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithName:(NSString *)moduleName __deprecated_msg("Use initWithName:moduleInfo:"); -- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo; +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo; - (instancetype)initWithName:(NSString *)moduleName heatingEnabledAvailable:(BOOL)heatingEnabledAvail coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail __deprecated_msg("Use initWithName:moduleInfo:heatingEnabledAvailable:coolingEnabledAvailable:heatingLevelAvailable:coolingLevelAvailable:horizontalPositionAvailable:verticalPositionAvailable:frontVerticalPositionAvailable:backVerticalPositionAvailable:backTiltAngleAvailable:headSupportHorizontalPositionAvailable:headSupportVerticalPositionAvailable:massageEnabledAvailable:massageModeAvailable:massageCushionFirmnessAvailable:memoryAvailable:"); -- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(BOOL)heatingEnabledAvail +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(BOOL)heatingEnabledAvail coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail; /** diff --git a/SmartDeviceLink/SDLSeatControlCapabilities.m b/SmartDeviceLink/SDLSeatControlCapabilities.m index f606dd4f8..248c87db0 100644 --- a/SmartDeviceLink/SDLSeatControlCapabilities.m +++ b/SmartDeviceLink/SDLSeatControlCapabilities.m @@ -16,7 +16,7 @@ - (instancetype)initWithName:(NSString *)moduleName { return self; } -- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo { +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo { if (self = [super init]) { self.moduleName = moduleName; self.moduleInfo = moduleInfo; @@ -51,7 +51,7 @@ - (instancetype)initWithName:(NSString *)moduleName heatingEnabledAvailable:(BOO return self; } -- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(BOOL)heatingEnabledAvail +- (instancetype)initWithName:(NSString *)moduleName moduleInfo:(nullable SDLModuleInfo *)moduleInfo heatingEnabledAvailable:(BOOL)heatingEnabledAvail coolingEnabledAvailable:(BOOL)coolingEnabledAvail heatingLevelAvailable:(BOOL)heatingLevelAvail coolingLevelAvailable:(BOOL)coolingLevelAvail horizontalPositionAvailable:(BOOL)horizontalPositionAvail verticalPositionAvailable:(BOOL)verticalPositionAvail frontVerticalPositionAvailable:(BOOL)frontVerticalPositionAvail backVerticalPositionAvailable:(BOOL)backVerticalPositionAvail backTiltAngleAvailable:(BOOL)backTitlAngleAvail headSupportHorizontalPositionAvailable:(BOOL)headSupportHorizontalPositionAvail headSupportVerticalPositionAvailable:(BOOL)headSupportVerticalPositionAvail massageEnabledAvailable:(BOOL)massageEnabledAvail massageModeAvailable:(BOOL)massageModeAvail massageCushionFirmnessAvailable:(BOOL)massageCushionFirmnessAvail memoryAvailable:(BOOL)memoryAvail { self = [super init]; From 36ceb960fcc81054cfb2ebd5899d55e8824dce22 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Thu, 22 Aug 2019 15:40:03 -0700 Subject: [PATCH 31/35] Add SDLSeatLocationCapability to SDLSystemCapabilityManager --- SmartDeviceLink/SDLSystemCapabilityManager.h | 10 ++++++++++ SmartDeviceLink/SDLSystemCapabilityManager.m | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/SmartDeviceLink/SDLSystemCapabilityManager.h b/SmartDeviceLink/SDLSystemCapabilityManager.h index 2a86d77c8..e2cea4feb 100644 --- a/SmartDeviceLink/SDLSystemCapabilityManager.h +++ b/SmartDeviceLink/SDLSystemCapabilityManager.h @@ -23,6 +23,7 @@ @class SDLPhoneCapability; @class SDLPresetBankCapabilities; @class SDLRemoteControlCapabilities; +@class SDLSeatLocationCapability; @class SDLSoftButtonCapabilities; @class SDLSystemCapability; @class SDLSystemCapabilityManager; @@ -183,6 +184,15 @@ typedef void (^SDLCapabilityUpdateHandler)(SDLSystemCapability *capability); */ @property (nullable, strong, nonatomic, readonly) SDLRemoteControlCapabilities *remoteControlCapability; +/** + If returned, the platform supports remote control capabilities for seats + + @see SDLSeatLocationCapability + + Optional + */ +@property (nullable, strong, nonatomic, readonly) SDLSeatLocationCapability *seatLocationCapability; + /** Init is unavailable. Dependencies must be injected using initWithConnectionManager: diff --git a/SmartDeviceLink/SDLSystemCapabilityManager.m b/SmartDeviceLink/SDLSystemCapabilityManager.m index ceeea6c3c..092cb876a 100644 --- a/SmartDeviceLink/SDLSystemCapabilityManager.m +++ b/SmartDeviceLink/SDLSystemCapabilityManager.m @@ -27,6 +27,7 @@ #import "SDLRemoteControlCapabilities.h" #import "SDLRPCNotificationNotification.h" #import "SDLRPCResponseNotification.h" +#import "SDLSeatLocationCapability.h" #import "SDLSetDisplayLayoutResponse.h" #import "SDLSystemCapability.h" #import "SDLSystemCapabilityObserver.h" @@ -57,6 +58,7 @@ @interface SDLSystemCapabilityManager () @property (nullable, strong, nonatomic, readwrite) SDLPhoneCapability *phoneCapability; @property (nullable, strong, nonatomic, readwrite) SDLVideoStreamingCapability *videoStreamingCapability; @property (nullable, strong, nonatomic, readwrite) SDLRemoteControlCapabilities *remoteControlCapability; +@property (nullable, strong, nonatomic, readwrite) SDLSeatLocationCapability *seatLocationCapability; @property (nullable, strong, nonatomic) NSMutableDictionary *appServicesCapabilitiesDictionary; @@ -121,6 +123,7 @@ - (void)stop { _phoneCapability = nil; _videoStreamingCapability = nil; _remoteControlCapability = nil; + _seatLocationCapability = nil; _appServicesCapabilitiesDictionary = [NSMutableDictionary dictionary]; _supportsSubscriptions = NO; @@ -304,6 +307,9 @@ - (BOOL)sdl_saveSystemCapability:(SDLSystemCapability *)systemCapability complet } else if ([systemCapabilityType isEqualToEnum:SDLSystemCapabilityTypeRemoteControl]) { if ([self.remoteControlCapability isEqual:systemCapability.remoteControlCapability]) { return [self sdl_callSaveHandlerForCapability:systemCapability andReturnWithValue:NO handler:handler]; } self.remoteControlCapability = systemCapability.remoteControlCapability; + } else if ([systemCapabilityType isEqualToEnum:SDLSystemCapabilityTypeSeatLocation]) { + if ([self.seatLocationCapability isEqual:systemCapability.seatLocationCapability]) { return [self sdl_callSaveHandlerForCapability:systemCapability andReturnWithValue:NO handler:handler]; } + self.seatLocationCapability = systemCapability.seatLocationCapability; } else if ([systemCapabilityType isEqualToEnum:SDLSystemCapabilityTypeVideoStreaming]) { if ([self.videoStreamingCapability isEqual:systemCapability.videoStreamingCapability]) { return [self sdl_callSaveHandlerForCapability:systemCapability andReturnWithValue:NO handler:handler]; } self.videoStreamingCapability = systemCapability.videoStreamingCapability; From 3e0d2cde65340dfa9946ec23f51f0adc13d1f337 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Fri, 23 Aug 2019 13:16:24 -0700 Subject: [PATCH 32/35] Make recommended fixes --- SmartDeviceLink/SDLButtonPress.h | 4 ++-- SmartDeviceLink/SDLButtonPress.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SmartDeviceLink/SDLButtonPress.h b/SmartDeviceLink/SDLButtonPress.h index c36481331..3d251f87d 100644 --- a/SmartDeviceLink/SDLButtonPress.h +++ b/SmartDeviceLink/SDLButtonPress.h @@ -15,9 +15,9 @@ NS_ASSUME_NONNULL_BEGIN @interface SDLButtonPress : SDLRPCRequest -- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType __deprecated_msg(("Use initWithButtonName:moduleType:moduleId instead"));; +- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType __deprecated_msg(("Use initWithButtonName:moduleType:moduleId: instead"));; -- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType moduleId:(nullable NSString *)moduleId; +- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId; /** * The module where the button should be pressed. diff --git a/SmartDeviceLink/SDLButtonPress.m b/SmartDeviceLink/SDLButtonPress.m index e92cc559b..4f215c206 100644 --- a/SmartDeviceLink/SDLButtonPress.m +++ b/SmartDeviceLink/SDLButtonPress.m @@ -20,7 +20,7 @@ - (instancetype)init { } #pragma clang diagnostic pop -- (instancetype)initWithButtonName:(SDLButtonName) buttonName moduleType:(SDLModuleType) moduleType { +- (instancetype)initWithButtonName:(SDLButtonName) buttonName moduleType:(SDLModuleType)moduleType { self = [self init]; if (!self) { return nil; @@ -32,7 +32,7 @@ - (instancetype)initWithButtonName:(SDLButtonName) buttonName moduleType:(SDLMod return self; } -- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType) moduleType moduleId:(nullable NSString *)moduleId { +- (instancetype)initWithButtonName:(SDLButtonName)buttonName moduleType:(SDLModuleType)moduleType moduleId:(nullable NSString *)moduleId { self = [self init]; if (!self) { return nil; From 5289257efbf21d5b71e062a93831e6d23fd2d323 Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Mon, 26 Aug 2019 15:37:02 -0700 Subject: [PATCH 33/35] Update SmartDeviceLink-iOS.podspec --- SmartDeviceLink-iOS.podspec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SmartDeviceLink-iOS.podspec b/SmartDeviceLink-iOS.podspec index 1f9316962..d1084f7e8 100644 --- a/SmartDeviceLink-iOS.podspec +++ b/SmartDeviceLink-iOS.podspec @@ -135,6 +135,8 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLGetFile.h', 'SmartDeviceLink/SDLGetFileResponse.h', 'SmartDeviceLink/SDLGetInteriorVehicleData.h', +'SmartDeviceLink/SDLGetInteriorVehicleDataConsent.h', +'SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h', 'SmartDeviceLink/SDLGetInteriorVehicleDataResponse.h', 'SmartDeviceLink/SDLGetSystemCapability.h', 'SmartDeviceLink/SDLGetSystemCapabilityResponse.h', @@ -144,6 +146,7 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLGetWaypointsResponse.h', 'SmartDeviceLink/SDLGlobalProperty.h', 'SmartDeviceLink/SDLGPSData.h', +'SmartDeviceLink/SDLGrid.h', 'SmartDeviceLink/SDLHapticRect.h', 'SmartDeviceLink/SDLHeadLampStatus.h', 'SmartDeviceLink/SDLHMICapabilities.h', @@ -212,6 +215,7 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLMetadataTags.h', 'SmartDeviceLink/SDLMetadataType.h', 'SmartDeviceLink/SDLModuleData.h', +'SmartDeviceLink/SDLModuleInfo.h', 'SmartDeviceLink/SDLModuleType.h', 'SmartDeviceLink/SDLMyKey.h', 'SmartDeviceLink/SDLNavigationAction.h', @@ -281,6 +285,8 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLRegisterAppInterface.h', 'SmartDeviceLink/SDLRegisterAppInterfaceResponse.h', 'SmartDeviceLink/SDLRemoteControlCapabilities.h', +'SmartDeviceLink/SDLReleaseInteriorVehicleDataModule.h', +'SmartDeviceLink/SDLReleaseInteriorVehicleDataModuleResponse.h', 'SmartDeviceLink/SDLRequestType.h', 'SmartDeviceLink/SDLResetGlobalProperties.h', 'SmartDeviceLink/SDLResetGlobalPropertiesResponse.h', @@ -303,6 +309,8 @@ ss.public_header_files = [ 'SmartDeviceLink/SDLScrollableMessageResponse.h', 'SmartDeviceLink/SDLSeatControlCapabilities.h', 'SmartDeviceLink/SDLSeatControlData.h', +'SmartDeviceLink/SDLSeatLocation.h', +'SmartDeviceLink/SDLSeatLocationCapability.h', 'SmartDeviceLink/SDLSeatMemoryAction.h', 'SmartDeviceLink/SDLSeatMemoryActionType.h', 'SmartDeviceLink/SDLSupportedSeat.h', From 46cb6487f58ee0aedca69e4d539b13312d8eb46d Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Wed, 28 Aug 2019 12:43:34 -0700 Subject: [PATCH 34/35] Update SDLNotificationConstants.m Make recommended fix --- SmartDeviceLink/SDLNotificationConstants.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SmartDeviceLink/SDLNotificationConstants.m b/SmartDeviceLink/SDLNotificationConstants.m index 86da4d658..2f4b91750 100644 --- a/SmartDeviceLink/SDLNotificationConstants.m +++ b/SmartDeviceLink/SDLNotificationConstants.m @@ -197,6 +197,7 @@ @implementation SDLNotificationConstants SDLDidReceiveGetDTCsResponse, SDLDidReceiveGetFileResponse, SDLDidReceiveGetInteriorVehicleDataResponse, + SDLDidReceiveGetInteriorVehicleDataConsentResponse, SDLDidReceiveGetSystemCapabilitiesResponse, SDLDidReceiveGetVehicleDataResponse, SDLDidReceiveGetWaypointsResponse, @@ -208,6 +209,7 @@ @implementation SDLNotificationConstants SDLDidReceivePutFileResponse, SDLDidReceiveReadDIDResponse, SDLDidReceiveRegisterAppInterfaceResponse, + SDLDidReceiveReleaseInteriorVehicleDataModuleResponse, SDLDidReceiveResetGlobalPropertiesResponse, SDLDidReceiveScrollableMessageResponse, SDLDidReceiveSendHapticDataResponse, From b6db8a79faed8d686e4be5fc65aa04e91a83d6ad Mon Sep 17 00:00:00 2001 From: Satbir Tanda Date: Tue, 3 Sep 2019 12:26:42 -0700 Subject: [PATCH 35/35] Update SDLGetInteriorVehicleDataConsentResponse Make allowed param to be optional --- SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h | 4 ++-- SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h index 0d549c727..7aee83e57 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.h @@ -17,9 +17,9 @@ NS_ASSUME_NONNULL_BEGIN "true" - if SDL grants the permission for the requested module "false" - SDL denies the permission for the requested module. - Required + Optional */ -@property (strong, nonatomic) NSArray *> *allowed; +@property (strong, nonatomic, nullable) NSArray *> *allowed; @end diff --git a/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m index 9d3fbfed4..872eded62 100644 --- a/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m +++ b/SmartDeviceLink/SDLGetInteriorVehicleDataConsentResponse.m @@ -22,11 +22,11 @@ - (instancetype)init { } #pragma clang diagnostic pop -- (void)setAllowed:(NSArray *> *)allowed { +- (void)setAllowed:(nullable NSArray *> *)allowed { [self.parameters sdl_setObject:allowed forName:SDLRPCParameterNameAllowed]; } -- (NSArray *> *)allowed { +- (nullable NSArray *> *)allowed { NSError *error = nil; return [self.parameters sdl_objectsForName:SDLRPCParameterNameAllowed ofClass:NSNumber.class error:&error]; }