diff options
author | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2021-02-05 20:59:11 +0200 |
---|---|---|
committer | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2021-02-05 20:59:11 +0200 |
commit | c8977a9bc589002bead9b2e007ae1223e3f05b25 (patch) | |
tree | aa2920989df114853006116ee92901877a975ced | |
parent | 0f8a7c474299727a8b57577520bf42bc1fdcac26 (diff) | |
parent | c5b58ee9c3491fbb289aeffa8f3abfc39a5254d3 (diff) | |
download | sdl_ios-c8977a9bc589002bead9b2e007ae1223e3f05b25.tar.gz |
[0269] 'New vehicle data climateData': Merge branch 'develop' into this. Resolve many conflicts.
44 files changed, 876 insertions, 152 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ad63eea0..f675f0b41 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,7 +63,7 @@ jobs: - name: Installing dependencies if: steps.carthage-cache.outputs.cache-hit != 'true' - run: bash carthage-build.sh update --no-use-binaries --platform ios --cache-builds + run: bash carthage-build.sh bootstrap --no-use-binaries --platform ios --cache-builds # Split build into build-only and test-only as it is faster than building and running in one step - name: Building unit tests diff --git a/Example Apps/Example ObjC/VehicleDataManager.m b/Example Apps/Example ObjC/VehicleDataManager.m index 57f03a2a5..26384a902 100644 --- a/Example Apps/Example ObjC/VehicleDataManager.m +++ b/Example Apps/Example ObjC/VehicleDataManager.m @@ -144,7 +144,7 @@ NS_ASSUME_NONNULL_BEGIN SDLLogD(@"App has permission to access vehicle data. Requesting vehicle data..."); - SDLGetVehicleData *getAllVehicleData = [[SDLGetVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES climateData:@YES turnSignal:@YES vin:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES windowStatus:@YES handsOffSteering:@YES]; + SDLGetVehicleData *getAllVehicleData = [[SDLGetVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES climateData:@YES turnSignal:@YES vin:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES windowStatus:@YES handsOffSteering:@YES seatOccupancy:@YES]; [manager sendRequest:getAllVehicleData withResponseHandler:^(__kindof SDLRPCRequest * _Nullable request, __kindof SDLRPCResponse * _Nullable response, NSError * _Nullable error) { if (error || ![response isKindOfClass:SDLGetVehicleDataResponse.class]) { diff --git a/Example Apps/Example Swift/VehicleDataManager.swift b/Example Apps/Example Swift/VehicleDataManager.swift index 87176a883..a1e72c469 100644 --- a/Example Apps/Example Swift/VehicleDataManager.swift +++ b/Example Apps/Example Swift/VehicleDataManager.swift @@ -111,7 +111,7 @@ extension VehicleDataManager { guard hasPermissionToAccessVehicleData(with: manager) else { return } SDLLog.d("App has permission to access vehicle data. Requesting all vehicle data...") - let getAllVehicleData = SDLGetVehicleData(gps: NSNumber(true), speed: NSNumber(true), rpm: NSNumber(true), instantFuelConsumption: NSNumber(true), fuelRange: NSNumber(true), externalTemperature: NSNumber(true), turnSignal: NSNumber(true), vin: NSNumber(true), gearStatus: NSNumber(true), tirePressure: NSNumber(true), odometer: NSNumber(true), beltStatus: NSNumber(true), bodyInformation: NSNumber(true), deviceStatus: NSNumber(true), driverBraking: NSNumber(true), wiperStatus: NSNumber(true), headLampStatus: NSNumber(true), engineTorque: NSNumber(true), accPedalPosition: NSNumber(true), steeringWheelAngle: NSNumber(true), engineOilLife: NSNumber(true), electronicParkBrakeStatus: NSNumber(true), cloudAppVehicleID: NSNumber(true), stabilityControlsStatus: NSNumber(true), eCallInfo: NSNumber(true), airbagStatus: NSNumber(true), emergencyEvent: NSNumber(true), clusterModeStatus: NSNumber(true), myKey: NSNumber(true), handsOffSteering: NSNumber(true), windowStatus: NSNumber(true)) + let getAllVehicleData = SDLGetVehicleData(gps: NSNumber(true), speed: NSNumber(true), rpm: NSNumber(true), instantFuelConsumption: NSNumber(true), fuelRange: NSNumber(true), externalTemperature: NSNumber(true), turnSignal: NSNumber(true), vin: NSNumber(true), gearStatus: NSNumber(true), tirePressure: NSNumber(true), odometer: NSNumber(true), beltStatus: NSNumber(true), bodyInformation: NSNumber(true), deviceStatus: NSNumber(true), driverBraking: NSNumber(true), wiperStatus: NSNumber(true), headLampStatus: NSNumber(true), engineTorque: NSNumber(true), accPedalPosition: NSNumber(true), steeringWheelAngle: NSNumber(true), engineOilLife: NSNumber(true), electronicParkBrakeStatus: NSNumber(true), cloudAppVehicleID: NSNumber(true), stabilityControlsStatus: NSNumber(true), eCallInfo: NSNumber(true), airbagStatus: NSNumber(true), emergencyEvent: NSNumber(true), clusterModeStatus: NSNumber(true), myKey: NSNumber(true), handsOffSteering: NSNumber(true), windowStatus: NSNumber(true), seatOccupancy: NSNumber(true)) manager.send(request: getAllVehicleData) { (request, response, error) in guard didAccessVehicleDataSuccessfully(with: manager, response: response, error: error) else { return } diff --git a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj index f0c8d02e1..04d451b0e 100644 --- a/SmartDeviceLink-iOS.xcodeproj/project.pbxproj +++ b/SmartDeviceLink-iOS.xcodeproj/project.pbxproj @@ -1666,6 +1666,12 @@ 9FA0D01222DF0BAC009CF344 /* SDLDeleteWindowResponseSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FA0D01122DF0BAC009CF344 /* SDLDeleteWindowResponseSpec.m */; }; B360F9D0255EFEFD0027CA17 /* SDLClimateData.m in Sources */ = {isa = PBXBuildFile; fileRef = B360F9CE255EFEFD0027CA17 /* SDLClimateData.m */; }; B360F9D1255EFEFD0027CA17 /* SDLClimateData.h in Headers */ = {isa = PBXBuildFile; fileRef = B360F9CF255EFEFD0027CA17 /* SDLClimateData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B360F9DE255F52A50027CA17 /* SDLSeatStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = B360F9DC255F52A40027CA17 /* SDLSeatStatus.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B360F9DF255F52A50027CA17 /* SDLSeatStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = B360F9DD255F52A40027CA17 /* SDLSeatStatus.m */; }; + B360F9E4255F52BA0027CA17 /* SDLSeatOccupancy.m in Sources */ = {isa = PBXBuildFile; fileRef = B360F9E2255F52B90027CA17 /* SDLSeatOccupancy.m */; }; + B360F9E5255F52BA0027CA17 /* SDLSeatOccupancy.h in Headers */ = {isa = PBXBuildFile; fileRef = B360F9E3255F52B90027CA17 /* SDLSeatOccupancy.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B38389D6257C187500420C11 /* SDLSeatOccupancySpec.m in Sources */ = {isa = PBXBuildFile; fileRef = B38389D4257C187400420C11 /* SDLSeatOccupancySpec.m */; }; + B38389D7257C187500420C11 /* SDLSeatStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = B38389D5257C187500420C11 /* SDLSeatStatusSpec.m */; }; B3838A01257C47FD00420C11 /* SDLDoorStatusTypeSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = B3838A00257C47FD00420C11 /* SDLDoorStatusTypeSpec.m */; }; B3838A09257C4EB400420C11 /* SDLDoorStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = B3838A08257C4EB300420C11 /* SDLDoorStatusSpec.m */; }; B3838A0F257C4EE100420C11 /* SDLGateStatusSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = B3838A0E257C4EE100420C11 /* SDLGateStatusSpec.m */; }; @@ -3512,6 +3518,12 @@ 9FA0D01122DF0BAC009CF344 /* SDLDeleteWindowResponseSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLDeleteWindowResponseSpec.m; sourceTree = "<group>"; }; B360F9CE255EFEFD0027CA17 /* SDLClimateData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLClimateData.m; path = public/SDLClimateData.m; sourceTree = "<group>"; }; B360F9CF255EFEFD0027CA17 /* SDLClimateData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDLClimateData.h; path = public/SDLClimateData.h; sourceTree = "<group>"; }; + B360F9DC255F52A40027CA17 /* SDLSeatStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDLSeatStatus.h; path = public/SDLSeatStatus.h; sourceTree = "<group>"; }; + B360F9DD255F52A40027CA17 /* SDLSeatStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLSeatStatus.m; path = public/SDLSeatStatus.m; sourceTree = "<group>"; }; + B360F9E2255F52B90027CA17 /* SDLSeatOccupancy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLSeatOccupancy.m; path = public/SDLSeatOccupancy.m; sourceTree = "<group>"; }; + B360F9E3255F52B90027CA17 /* SDLSeatOccupancy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDLSeatOccupancy.h; path = public/SDLSeatOccupancy.h; sourceTree = "<group>"; }; + B38389D4257C187400420C11 /* SDLSeatOccupancySpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLSeatOccupancySpec.m; path = SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSeatOccupancySpec.m; sourceTree = SOURCE_ROOT; }; + B38389D5257C187500420C11 /* SDLSeatStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLSeatStatusSpec.m; path = SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSeatStatusSpec.m; sourceTree = SOURCE_ROOT; }; B3838A00257C47FD00420C11 /* SDLDoorStatusTypeSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLDoorStatusTypeSpec.m; sourceTree = "<group>"; }; B3838A08257C4EB300420C11 /* SDLDoorStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLDoorStatusSpec.m; path = SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDoorStatusSpec.m; sourceTree = SOURCE_ROOT; }; B3838A0E257C4EE100420C11 /* SDLGateStatusSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLGateStatusSpec.m; path = SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLGateStatusSpec.m; sourceTree = SOURCE_ROOT; }; @@ -4071,6 +4083,8 @@ 5D92934F20AF526200FCC775 /* SDLRGBColorSpec.m */, B3838A14257C4EFD00420C11 /* SDLRoofStatusSpec.m */, 162E82A71A9BDE8A00906325 /* SDLScreenParamsSpec.m */, + B38389D4257C187400420C11 /* SDLSeatOccupancySpec.m */, + B38389D5257C187500420C11 /* SDLSeatStatusSpec.m */, 1E89B0E1203196B800A47992 /* SDLSeatControlCapabilitiesSpec.m */, 1E89B0DD2031636000A47992 /* SDLSeatControlDataSpec.m */, 000DD56B22EEF8E4005AB7A7 /* SDLSeatLocationCapabilitySpec.m */, @@ -5191,6 +5205,10 @@ 4A8BD31C24F93964000945E3 /* SDLSeatLocationCapability.m */, 4A8BD29724F93534000945E3 /* SDLSeatMemoryAction.h */, 4A8BD29524F93534000945E3 /* SDLSeatMemoryAction.m */, + B360F9E3255F52B90027CA17 /* SDLSeatOccupancy.h */, + B360F9E2255F52B90027CA17 /* SDLSeatOccupancy.m */, + B360F9DC255F52A40027CA17 /* SDLSeatStatus.h */, + B360F9DD255F52A40027CA17 /* SDLSeatStatus.m */, C9DFFE76257ACE0000F7D57A /* SDLSeekStreamingIndicator.h */, C9DFFE77257ACE0000F7D57A /* SDLSeekStreamingIndicator.m */, 4A8BD29224F93533000945E3 /* SDLSingleTireStatus.h */, @@ -7049,6 +7067,7 @@ 4ABB273A24F7FD1D0061BF55 /* SDLDirection.h in Headers */, 4ABB25A224F7E6CE0061BF55 /* SDLDynamicMenuUpdateRunScore.h in Headers */, 4A8BD3B024F98ACE000945E3 /* SDLLogManager.h in Headers */, + B360F9E5255F52BA0027CA17 /* SDLSeatOccupancy.h in Headers */, 4ABB26DE24F7FAFD0061BF55 /* SDLRPCRequest.h in Headers */, 4ABB25D824F7E7630061BF55 /* SDLTextField+ScreenManagerExtensions.h in Headers */, 4A8BD25124F93135000945E3 /* SDLModuleData.h in Headers */, @@ -7076,6 +7095,7 @@ 4ABB24E924F594CD0061BF55 /* SDLEncryptionManagerConstants.h in Headers */, 4ABB2AA724F847F40061BF55 /* SDLShowConstantTBTResponse.h in Headers */, 4ABB28ED24F82A6A0061BF55 /* SDLOnKeyboardInput.h in Headers */, + B360F9DE255F52A50027CA17 /* SDLSeatStatus.h in Headers */, 5D9FDA991F2A7D3F00A495C8 /* emhashmap.h in Headers */, 4ABB255F24F7E59E0061BF55 /* SDLPermissionConstants.h in Headers */, 4ABB270324F7FB8F0061BF55 /* SDLButtonName.h in Headers */, @@ -8176,6 +8196,7 @@ 4ABB2AEB24F848270061BF55 /* SDLUpdateTurnListResponse.m in Sources */, 4ABB263124F7F4230061BF55 /* SDLRAWH264Packetizer.m in Sources */, 4ABB2B5724F84EF50061BF55 /* SDLDIDResult.m in Sources */, + B360F9E4255F52BA0027CA17 /* SDLSeatOccupancy.m in Sources */, 5D9FDA981F2A7D3F00A495C8 /* emhashmap.c in Sources */, 4ABB260C24F7F3400061BF55 /* SDLAudioFile.m in Sources */, 4A8BD2F524F93872000945E3 /* SDLTTSChunk.m in Sources */, @@ -8305,6 +8326,7 @@ 4ABB299824F845440061BF55 /* SDLReleaseInteriorVehicleDataModule.m in Sources */, 4ABB277724F7FE910061BF55 /* SDLIgnitionStatus.m in Sources */, 4ABB2B5624F84EF50061BF55 /* SDLDisplayCapability.m in Sources */, + B360F9DF255F52A50027CA17 /* SDLSeatStatus.m in Sources */, 4ABB267F24F7F68F0061BF55 /* SDLCacheFileManager.m in Sources */, 4A8BD24124F93135000945E3 /* SDLMenuParams.m in Sources */, 4ABB28FC24F82BE90061BF55 /* SDLAddCommand.m in Sources */, @@ -8764,6 +8786,7 @@ 162E835D1A9BDE8B00906325 /* SDLReadDIDResponseSpec.m in Sources */, 5DAD5F87205087430025624C /* SDLTextAndGraphicManagerSpec.m in Sources */, 162E82D41A9BDE8A00906325 /* SDLCharacterSetSpec.m in Sources */, + B38389D7257C187500420C11 /* SDLSeatStatusSpec.m in Sources */, 162E830F1A9BDE8B00906325 /* SDLOnAppInterfaceUnregisteredSpec.m in Sources */, 162E83971A9BDE8B00906325 /* SDLVehicleTypeSpec.m in Sources */, 887BE4D422272B2200B397C2 /* SDLControlFramePayloadConstantsSpec.m in Sources */, @@ -8825,6 +8848,7 @@ 1EE8C4501F38629200FDC2CF /* SDLRemoteControlCapabilitiesSpec.m in Sources */, 1EAA47662035B8D3000FE74B /* SDLLightControlDataSpec.m in Sources */, 162E82CF1A9BDE8A00906325 /* SDLBitsPerSampleSpec.m in Sources */, + B38389D6257C187500420C11 /* SDLSeatOccupancySpec.m in Sources */, 883581B022D659BE00405C42 /* SDLCloseApplicationResponseSpec.m in Sources */, 162E831E1A9BDE8B00906325 /* SDLOnTBTClientStateSpec.m in Sources */, 162E83351A9BDE8B00906325 /* SDLReadDIDSpec.m in Sources */, diff --git a/SmartDeviceLink/private/SDLRPCParameterNames.h b/SmartDeviceLink/private/SDLRPCParameterNames.h index 61c6ba7e8..cd34d66e9 100644 --- a/SmartDeviceLink/private/SDLRPCParameterNames.h +++ b/SmartDeviceLink/private/SDLRPCParameterNames.h @@ -152,6 +152,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameClusterModeStatus; extern SDLRPCParameterName const SDLRPCParameterNameCommandIcon; extern SDLRPCParameterName const SDLRPCParameterNameCommandId; extern SDLRPCParameterName const SDLRPCParameterNameCompassDirection; +extern SDLRPCParameterName const SDLRPCParameterNameConditionActive; extern SDLRPCParameterName const SDLRPCParameterNameCorrelationId; extern SDLRPCParameterName const SDLRPCParameterNameCountRate; extern SDLRPCParameterName const SDLRPCParameterNameCountryCode; @@ -526,6 +527,7 @@ extern SDLRPCParameterName const SDLRPCParameterNamePrecipAccumulation; extern SDLRPCParameterName const SDLRPCParameterNamePrecipIntensity; extern SDLRPCParameterName const SDLRPCParameterNamePrecipProbability; extern SDLRPCParameterName const SDLRPCParameterNamePrecipType; +extern SDLRPCParameterName const SDLRPCParameterNamePreferredFPS; extern SDLRPCParameterName const SDLRPCParameterNamePreferredResolution; extern SDLRPCParameterName const SDLRPCParameterNamePrerecordedSpeech; extern SDLRPCParameterName const SDLRPCParameterNamePresetBankCapabilities; @@ -600,7 +602,10 @@ extern SDLRPCParameterName const SDLRPCParameterNameSeatControlData; extern SDLRPCParameterName const SDLRPCParameterNameSeatControlCapabilities; extern SDLRPCParameterName const SDLRPCParameterNameSeatLocation; extern SDLRPCParameterName const SDLRPCParameterNameSeatLocationCapability; +extern SDLRPCParameterName const SDLRPCParameterNameSeatOccupancy; extern SDLRPCParameterName const SDLRPCParameterNameSeats; +extern SDLRPCParameterName const SDLRPCParameterNameSeatsBelted; +extern SDLRPCParameterName const SDLRPCParameterNameSeatsOccupied; extern SDLRPCParameterName const SDLRPCParameterNameSecondaryColor; extern SDLRPCParameterName const SDLRPCParameterNameSecondaryGraphic; extern SDLRPCParameterName const SDLRPCParameterNameSecondaryImage; diff --git a/SmartDeviceLink/private/SDLRPCParameterNames.m b/SmartDeviceLink/private/SDLRPCParameterNames.m index 0fd3c2921..d95d6af05 100644 --- a/SmartDeviceLink/private/SDLRPCParameterNames.m +++ b/SmartDeviceLink/private/SDLRPCParameterNames.m @@ -151,6 +151,7 @@ SDLRPCParameterName const SDLRPCParameterNameColumns = @"columns"; SDLRPCParameterName const SDLRPCParameterNameCommandIcon = @"cmdIcon"; SDLRPCParameterName const SDLRPCParameterNameCommandId = @"cmdID"; SDLRPCParameterName const SDLRPCParameterNameCompassDirection = @"compassDirection"; +SDLRPCParameterName const SDLRPCParameterNameConditionActive = @"conditionActive"; SDLRPCParameterName const SDLRPCParameterNameCorrelationId = @"correlationID"; SDLRPCParameterName const SDLRPCParameterNameCountRate = @"countRate"; SDLRPCParameterName const SDLRPCParameterNameCountryCode = @"countryCode"; @@ -523,6 +524,7 @@ SDLRPCParameterName const SDLRPCParameterNamePrecipType = @"precipType"; SDLRPCParameterName const SDLRPCParameterNamePowerModeActive = @"powerModeActive"; SDLRPCParameterName const SDLRPCParameterNamePowerModeQualificationStatus = @"powerModeQualificationStatus"; SDLRPCParameterName const SDLRPCParameterNamePowerModeStatus = @"powerModeStatus"; +SDLRPCParameterName const SDLRPCParameterNamePreferredFPS = @"preferredFPS"; SDLRPCParameterName const SDLRPCParameterNamePreferredResolution = @"preferredResolution"; SDLRPCParameterName const SDLRPCParameterNamePrerecordedSpeech = @"prerecordedSpeech"; SDLRPCParameterName const SDLRPCParameterNamePresetBankCapabilities = @"presetBankCapabilities"; @@ -597,7 +599,10 @@ SDLRPCParameterName const SDLRPCParameterNameSeatControlData = @"seatControlData SDLRPCParameterName const SDLRPCParameterNameSeatControlCapabilities = @"seatControlCapabilities"; SDLRPCParameterName const SDLRPCParameterNameSeatLocation = @"seatLocation"; SDLRPCParameterName const SDLRPCParameterNameSeatLocationCapability = @"seatLocationCapability"; +SDLRPCParameterName const SDLRPCParameterNameSeatOccupancy = @"seatOccupancy"; SDLRPCParameterName const SDLRPCParameterNameSeats = @"seats"; +SDLRPCParameterName const SDLRPCParameterNameSeatsBelted = @"seatsBelted"; +SDLRPCParameterName const SDLRPCParameterNameSeatsOccupied = @"seatsOccupied"; SDLRPCParameterName const SDLRPCParameterNameSecondaryGraphic = @"secondaryGraphic"; SDLRPCParameterName const SDLRPCParameterNameSecondaryImage = @"secondaryImage"; SDLRPCParameterName const SDLRPCParameterNameSecondaryText = @"secondaryText"; diff --git a/SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m b/SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m index 5d1236a98..d2b5490ee 100644 --- a/SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m +++ b/SmartDeviceLink/private/SDLStreamingVideoLifecycleManager.m @@ -387,6 +387,9 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N if (capability.maxBitrate != nil) { weakSelf.videoEncoderSettings[(__bridge NSString *) kVTCompressionPropertyKey_AverageBitRate] = [[NSNumber alloc] initWithUnsignedLongLong:(capability.maxBitrate.unsignedLongLongValue * 1000)]; } + if (capability.preferredFPS != nil) { + weakSelf.videoEncoderSettings[(__bridge NSString *)kVTCompressionPropertyKey_ExpectedFrameRate] = capability.preferredFPS; + } if (weakSelf.dataSource != nil) { SDLLogV(@"Calling data source for modified preferred formats"); @@ -397,7 +400,7 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N weakSelf.focusableItemManager.enableHapticDataRequests = capability.hapticSpatialDataSupported.boolValue; } - SDLLogD(@"Got specialized video capabilites, preferred formats: %@, haptics enabled %@", weakSelf.preferredFormats, (capability.hapticSpatialDataSupported.boolValue ? @"YES" : @"NO")); + SDLLogD(@"Got specialized video capabilites, preferred formats: %@, haptics enabled %@, videoEncoderSettings: %@", weakSelf.preferredFormats, (capability.hapticSpatialDataSupported.boolValue ? @"YES" : @"NO"), weakSelf.videoEncoderSettings); } else { // If no response, assume that the format is H264 RAW and get the screen resolution from the RAI response's display capabilities. SDLVideoStreamingFormat *format = [[SDLVideoStreamingFormat alloc] initWithCodec:SDLVideoStreamingCodecH264 protocol:SDLVideoStreamingProtocolRAW]; @@ -412,9 +415,21 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N SDLLogD(@"Using generic video capabilites, preferred formats: %@, resolutions: %@, haptics disabled", weakSelf.preferredFormats, weakSelf.preferredResolutions); } - // Apply customEncoderSettings here. Note that value from HMI (such as maxBitrate) will be overwritten by custom settings. + // Apply customEncoderSettings here. Note that value from HMI (such as maxBitrate) will be overwritten by custom settings + // (Exception: ExpectedFrameRate, AverageBitRate) for (id key in self.customEncoderSettings.keyEnumerator) { - self.videoEncoderSettings[key] = [self.customEncoderSettings valueForKey:key]; + // do NOT override framerate or average bitreate if custom setting is higher than current setting. + // See SDL 0323 (https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0323-align-VideoStreamingParameter-with-capability.md) for details. + if ([(NSString *)key isEqualToString:(__bridge NSString *)kVTCompressionPropertyKey_ExpectedFrameRate] || + [(NSString *)key isEqualToString:(__bridge NSString *)kVTCompressionPropertyKey_AverageBitRate]) { + NSNumber *customEncoderSettings = (NSNumber *)[self.customEncoderSettings valueForKey:key]; + NSNumber *videoEncoderSettings = (NSNumber *)[self.videoEncoderSettings valueForKey:key]; + if (customEncoderSettings < videoEncoderSettings) { + self.videoEncoderSettings[key] = customEncoderSettings; + } + } else { + self.videoEncoderSettings[key] = [self.customEncoderSettings valueForKey:key]; + } } if (weakSelf.dataSource != nil) { diff --git a/SmartDeviceLink/public/SDLGetVehicleData.h b/SmartDeviceLink/public/SDLGetVehicleData.h index 3d32d4a44..470cf8ee8 100644 --- a/SmartDeviceLink/public/SDLGetVehicleData.h +++ b/SmartDeviceLink/public/SDLGetVehicleData.h @@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN * @param wiperStatus Get wiperStatus data * @return A SDLGetVehicleData object */ -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** * Convenience init for getting data for all possible vehicle data items. @@ -90,9 +90,11 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLGetVehicleData object */ -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal vin:(nullable NSNumber<SDLBool> *)vin gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal vin:(nullable NSNumber<SDLBool> *)vin gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** + * Convenience init for getting data for all possible vehicle data items. + * * @param gps - gps * @param speed - speed * @param rpm - rpm @@ -122,11 +124,11 @@ NS_ASSUME_NONNULL_BEGIN * @param emergencyEvent - emergencyEvent * @param clusterModeStatus - clusterModeStatus * @param myKey - myKey - * @param windowStatus - windowStatus * @param handsOffSteering - handsOffSteering - * @return A SDLGetVehicleData object + * @param windowStatus - windowStatus + * @param seatOccupancy - seatOccupancy */ -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal vin:(nullable NSNumber<SDLBool> *)vin gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering; +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal vin:(nullable NSNumber<SDLBool> *)vin gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy; /** * See GearStatus @@ -335,6 +337,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable NSNumber<SDLBool> *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +/** + * See SeatOccupancy + * + * @added in SmartDeviceLink 7.1.0 + */ +@property (nullable, strong, nonatomic) NSNumber<SDLBool> *seatOccupancy; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLGetVehicleData.m b/SmartDeviceLink/public/SDLGetVehicleData.m index 594655ca5..30d1728c0 100644 --- a/SmartDeviceLink/public/SDLGetVehicleData.m +++ b/SmartDeviceLink/public/SDLGetVehicleData.m @@ -23,8 +23,8 @@ NS_ASSUME_NONNULL_BEGIN } #pragma clang diagnostic pop -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus { - self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) climateData:nil turnSignal:@(turnSignal) vin:@(vin) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) windowStatus:nil handsOffSteering:nil]; +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus { + self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) climateData:nil turnSignal:@(turnSignal) vin:@(vin) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accelerationPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) windowStatus:nil handsOffSteering:nil seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN } - (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal vin:(nullable NSNumber<SDLBool> *)vin gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus { - self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering]; + self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal vin:(nullable NSNumber<SDLBool> *)vin gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering { +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal vin:(nullable NSNumber<SDLBool> *)vin gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy { self = [self init]; if (!self) { return nil; @@ -84,6 +84,7 @@ NS_ASSUME_NONNULL_BEGIN self.myKey = myKey; self.windowStatus = windowStatus; self.handsOffSteering = handsOffSteering; + self.seatOccupancy = seatOccupancy; return self; } @@ -376,6 +377,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_objectForName:SDLRPCParameterNameHandsOffSteering ofClass:NSNumber.class error:nil]; } +- (void)setSeatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy { + [self.parameters sdl_setObject:seatOccupancy forName:SDLRPCParameterNameSeatOccupancy]; +} + +- (nullable NSNumber<SDLBool> *)seatOccupancy { + return [self.parameters sdl_objectForName:SDLRPCParameterNameSeatOccupancy ofClass:NSNumber.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLGetVehicleDataResponse.h b/SmartDeviceLink/public/SDLGetVehicleDataResponse.h index 26c00dce2..79d72199f 100644 --- a/SmartDeviceLink/public/SDLGetVehicleDataResponse.h +++ b/SmartDeviceLink/public/SDLGetVehicleDataResponse.h @@ -23,11 +23,11 @@ @class SDLGPSData; @class SDLHeadLampStatus; @class SDLMyKey; +@class SDLSeatOccupancy; @class SDLStabilityControlsStatus; @class SDLTireStatus; @class SDLWindowStatus; - /** * Response to SDLGetVehicleData * @@ -74,9 +74,11 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLGetVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** + * Convenience init for initializing data for all possible vehicle data items. + * * @param gps - gps * @param speed - speed * @param rpm - rpm @@ -108,9 +110,10 @@ NS_ASSUME_NONNULL_BEGIN * @param myKey - myKey * @param windowStatus - windowStatus * @param handsOffSteering - handsOffSteering + * @param seatOccupancy - seatOccupancy * @return A SDLGetVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange climateData:(nullable SDLClimateData *)climateData turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering; +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange climateData:(nullable SDLClimateData *)climateData turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable SDLSeatOccupancy *)seatOccupancy; /** * See GearStatus @@ -323,6 +326,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable NSObject *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +/** + * See SeatOccupancy + * + * @added in SmartDeviceLink 7.1.0 + */ +@property (nullable, strong, nonatomic) SDLSeatOccupancy *seatOccupancy; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLGetVehicleDataResponse.m b/SmartDeviceLink/public/SDLGetVehicleDataResponse.m index bbdf340c8..b5fc22261 100644 --- a/SmartDeviceLink/public/SDLGetVehicleDataResponse.m +++ b/SmartDeviceLink/public/SDLGetVehicleDataResponse.m @@ -20,6 +20,7 @@ #import "SDLMyKey.h" #import "SDLRPCParameterNames.h" #import "SDLRPCFunctionNames.h" +#import "SDLSeatOccupancy.h" #import "SDLStabilityControlsStatus.h" #import "SDLTireStatus.h" #import "SDLWindowStatus.h" @@ -40,7 +41,8 @@ NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic pop - (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus { - self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering]; + + self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -50,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange climateData:(nullable SDLClimateData *)climateData turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering { +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange climateData:(nullable SDLClimateData *)climateData turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable SDLSeatOccupancy *)seatOccupancy { self = [self init]; if (!self) { return nil; @@ -84,8 +86,9 @@ NS_ASSUME_NONNULL_BEGIN self.emergencyEvent = emergencyEvent; self.clusterModeStatus = clusterModeStatus; self.myKey = myKey; - self.handsOffSteering = handsOffSteering; self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + self.seatOccupancy = seatOccupancy; return self; } @@ -380,6 +383,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSObject.class error:nil]; } +- (void)setSeatOccupancy:(nullable SDLSeatOccupancy *)seatOccupancy { + [self.parameters sdl_setObject:seatOccupancy forName:SDLRPCParameterNameSeatOccupancy]; +} + +- (nullable SDLSeatOccupancy *)seatOccupancy { + return [self.parameters sdl_objectForName:SDLRPCParameterNameSeatOccupancy ofClass:SDLSeatOccupancy.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLOnVehicleData.h b/SmartDeviceLink/public/SDLOnVehicleData.h index e0337b61d..a85d8610f 100644 --- a/SmartDeviceLink/public/SDLOnVehicleData.h +++ b/SmartDeviceLink/public/SDLOnVehicleData.h @@ -23,6 +23,7 @@ @class SDLGPSData; @class SDLHeadLampStatus; @class SDLMyKey; +@class SDLSeatOccupancy; @class SDLStabilityControlsStatus; @class SDLTireStatus; @class SDLWindowStatus; @@ -74,9 +75,11 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLOnVehicleData object */ -- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** + * Convenience init for setting all possible values on vehicle data items. + * * @param gps - gps * @param speed - speed * @param rpm - rpm @@ -108,9 +111,10 @@ NS_ASSUME_NONNULL_BEGIN * @param myKey - myKey * @param windowStatus - windowStatus * @param handsOffSteering - handsOffSteering + * @param seatOccupancy - seatOccupancy * @return A SDLOnVehicleData object */ -- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange climateData:(nullable SDLClimateData *)climateData turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering; +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange climateData:(nullable SDLClimateData *)climateData turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable SDLSeatOccupancy *)seatOccupancy; /** * See GearStatus @@ -323,6 +327,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable NSObject *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +/** + * See SeatOccupancy + * + * @added in SmartDeviceLink 7.1.0 + */ +@property (nullable, strong, nonatomic) SDLSeatOccupancy *seatOccupancy; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLOnVehicleData.m b/SmartDeviceLink/public/SDLOnVehicleData.m index b2c94522e..1df77371e 100644 --- a/SmartDeviceLink/public/SDLOnVehicleData.m +++ b/SmartDeviceLink/public/SDLOnVehicleData.m @@ -19,6 +19,7 @@ #import "SDLMyKey.h" #import "SDLRPCParameterNames.h" #import "SDLRPCFunctionNames.h" +#import "SDLSeatOccupancy.h" #import "SDLStabilityControlsStatus.h" #import "SDLTireStatus.h" #import "SDLWindowStatus.h" @@ -39,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic pop - (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus { - self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering]; + self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -49,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange climateData:(nullable SDLClimateData *)climateData turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering { +- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(nullable NSNumber<SDLFloat> *)speed rpm:(nullable NSNumber<SDLUInt> *)rpm instantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange climateData:(nullable SDLClimateData *)climateData turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin gearStatus:(nullable SDLGearStatus *)gearStatus tirePressure:(nullable SDLTireStatus *)tirePressure odometer:(nullable NSNumber<SDLUInt> *)odometer beltStatus:(nullable SDLBeltStatus *)beltStatus bodyInformation:(nullable SDLBodyInformation *)bodyInformation deviceStatus:(nullable SDLDeviceStatus *)deviceStatus driverBraking:(nullable SDLVehicleDataEventStatus)driverBraking wiperStatus:(nullable SDLWiperStatus)wiperStatus headLampStatus:(nullable SDLHeadLampStatus *)headLampStatus engineTorque:(nullable NSNumber<SDLFloat> *)engineTorque accPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus eCallInfo:(nullable SDLECallInfo *)eCallInfo airbagStatus:(nullable SDLAirbagStatus *)airbagStatus emergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent clusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus myKey:(nullable SDLMyKey *)myKey windowStatus:(nullable NSArray<SDLWindowStatus *> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable SDLSeatOccupancy *)seatOccupancy { self = [self init]; if (!self) { return nil; @@ -83,8 +84,9 @@ NS_ASSUME_NONNULL_BEGIN self.emergencyEvent = emergencyEvent; self.clusterModeStatus = clusterModeStatus; self.myKey = myKey; - self.handsOffSteering = handsOffSteering; self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + self.seatOccupancy = seatOccupancy; return self; } @@ -378,6 +380,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSObject.class error:nil]; } +- (void)setSeatOccupancy:(nullable SDLSeatOccupancy *)seatOccupancy { + [self.parameters sdl_setObject:seatOccupancy forName:SDLRPCParameterNameSeatOccupancy]; +} + +- (nullable SDLSeatOccupancy *)seatOccupancy { + return [self.parameters sdl_objectForName:SDLRPCParameterNameSeatOccupancy ofClass:SDLSeatOccupancy.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLSeatOccupancy.h b/SmartDeviceLink/public/SDLSeatOccupancy.h new file mode 100644 index 000000000..e453a97e1 --- /dev/null +++ b/SmartDeviceLink/public/SDLSeatOccupancy.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#import "SDLRPCStruct.h" + +@class SDLSeatStatus; + +NS_ASSUME_NONNULL_BEGIN + +/** + * @added in SmartDeviceLink 7.1.0 + */ +@interface SDLSeatOccupancy : SDLRPCStruct + +/** + * @param seatsOccupied - seatsOccupied + * @param seatsBelted - seatsBelted + * @return A SDLSeatOccupancy object + */ +- (instancetype)initWithSeatsOccupied:(nullable NSArray<SDLSeatStatus *> *)seatsOccupied seatsBelted:(nullable NSArray<SDLSeatStatus *> *)seatsBelted; + +/** + * Seat status array containing location and whether the seats are occupied. + * {"array_min_size": 0, "array_max_size": 100} + */ +@property (nullable, strong, nonatomic) NSArray<SDLSeatStatus *> *seatsOccupied; + +/** + * Seat status array containing location and whether the seats are belted. + * {"array_min_size": 0, "array_max_size": 100} + */ +@property (nullable, strong, nonatomic) NSArray<SDLSeatStatus *> *seatsBelted; + +@end + +NS_ASSUME_NONNULL_END
\ No newline at end of file diff --git a/SmartDeviceLink/public/SDLSeatOccupancy.m b/SmartDeviceLink/public/SDLSeatOccupancy.m new file mode 100644 index 000000000..67d6f17f4 --- /dev/null +++ b/SmartDeviceLink/public/SDLSeatOccupancy.m @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#import "NSMutableDictionary+Store.h" +#import "SDLRPCParameterNames.h" +#import "SDLSeatOccupancy.h" +#import "SDLSeatStatus.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation SDLSeatOccupancy + +- (instancetype)initWithSeatsOccupied:(nullable NSArray<SDLSeatStatus *> *)seatsOccupied seatsBelted:(nullable NSArray<SDLSeatStatus *> *)seatsBelted { + self = [self init]; + if (!self) { + return nil; + } + self.seatsOccupied = seatsOccupied; + self.seatsBelted = seatsBelted; + return self; +} + +- (void)setSeatsOccupied:(nullable NSArray<SDLSeatStatus *> *)seatsOccupied { + [self.store sdl_setObject:seatsOccupied forName:SDLRPCParameterNameSeatsOccupied]; +} + +- (nullable NSArray<SDLSeatStatus *> *)seatsOccupied { + return [self.store sdl_objectsForName:SDLRPCParameterNameSeatsOccupied ofClass:SDLSeatStatus.class error:nil]; +} + +- (void)setSeatsBelted:(nullable NSArray<SDLSeatStatus *> *)seatsBelted { + [self.store sdl_setObject:seatsBelted forName:SDLRPCParameterNameSeatsBelted]; +} + +- (nullable NSArray<SDLSeatStatus *> *)seatsBelted { + return [self.store sdl_objectsForName:SDLRPCParameterNameSeatsBelted ofClass:SDLSeatStatus.class error:nil]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLSeatStatus.h b/SmartDeviceLink/public/SDLSeatStatus.h new file mode 100644 index 000000000..29d62c263 --- /dev/null +++ b/SmartDeviceLink/public/SDLSeatStatus.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#import "SDLRPCStruct.h" + +@class SDLSeatLocation; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Describes the status of a parameter of seat. + * + * @added in SmartDeviceLink 7.1.0 + */ +@interface SDLSeatStatus : SDLRPCStruct + +/** + * @param seatLocation - seatLocation + * @param conditionActive - @(conditionActive) + * @return A SDLSeatStatus object + */ +- (instancetype)initWithSeatLocation:(SDLSeatLocation *)seatLocation conditionActive:(BOOL)conditionActive; + +@property (strong, nonatomic) SDLSeatLocation *seatLocation; + +@property (strong, nonatomic) NSNumber<SDLBool> *conditionActive; + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLSeatStatus.m b/SmartDeviceLink/public/SDLSeatStatus.m new file mode 100644 index 000000000..ec2d70d78 --- /dev/null +++ b/SmartDeviceLink/public/SDLSeatStatus.m @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020, SmartDeviceLink Consortium, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#import "NSMutableDictionary+Store.h" +#import "SDLRPCParameterNames.h" +#import "SDLSeatLocation.h" +#import "SDLSeatStatus.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation SDLSeatStatus + +- (instancetype)initWithSeatLocation:(SDLSeatLocation *)seatLocation conditionActive:(BOOL)conditionActive { + self = [self init]; + if (!self) { + return nil; + } + self.seatLocation = seatLocation; + self.conditionActive = @(conditionActive); + return self; +} + +- (void)setSeatLocation:(SDLSeatLocation *)seatLocation { + [self.store sdl_setObject:seatLocation forName:SDLRPCParameterNameSeatLocation]; +} + +- (SDLSeatLocation *)seatLocation { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameSeatLocation ofClass:SDLSeatLocation.class error:&error]; +} + +- (void)setConditionActive:(NSNumber<SDLBool> *)conditionActive { + [self.store sdl_setObject:conditionActive forName:SDLRPCParameterNameConditionActive]; +} + +- (NSNumber<SDLBool> *)conditionActive { + NSError *error = nil; + return [self.store sdl_objectForName:SDLRPCParameterNameConditionActive ofClass:NSNumber.class error:&error]; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLSubscribeVehicleData.h b/SmartDeviceLink/public/SDLSubscribeVehicleData.h index 8a81517a0..053c8c68c 100644 --- a/SmartDeviceLink/public/SDLSubscribeVehicleData.h +++ b/SmartDeviceLink/public/SDLSubscribeVehicleData.h @@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN * @param wiperStatus Subscribe to wiperStatus * @return A SDLSubscribeVehicleData object */ -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** * Convenience init for subscribing to all possible vehicle data items. @@ -90,10 +90,11 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLSubscribeVehicleData object */ -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering: instead"); - +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** + * Convenience init for subscribing to all possible vehicle data items. + * * @param gps - gps * @param speed - speed * @param rpm - rpm @@ -124,9 +125,10 @@ NS_ASSUME_NONNULL_BEGIN * @param myKey - myKey * @param windowStatus - windowStatus * @param handsOffSteering - handsOffSteering + * @param seatOccupancy - seatOccupancy * @return A SDLSubscribeVehicleData object */ -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering; +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy; /** * See GearStatus @@ -330,6 +332,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable NSNumber<SDLBool> *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +/** + * See SeatOccupancy + * + * @added in SmartDeviceLink 7.1.0 + */ +@property (nullable, strong, nonatomic) NSNumber<SDLBool> *seatOccupancy; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLSubscribeVehicleData.m b/SmartDeviceLink/public/SDLSubscribeVehicleData.m index a35ff57eb..d63fe65e6 100644 --- a/SmartDeviceLink/public/SDLSubscribeVehicleData.m +++ b/SmartDeviceLink/public/SDLSubscribeVehicleData.m @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic pop - (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus { - self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) climateData:nil turnSignal:@(turnSignal) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:nil steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) windowStatus:nil handsOffSteering:nil]; + self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) climateData:nil turnSignal:@(turnSignal) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:nil steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) windowStatus:nil handsOffSteering:nil seatOccupancy:nil]; if (self) { self.accPedalPosition = @(accelerationPedalPosition); #pragma clang diagnostic push @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN } - (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus { - self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering]; + self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering { +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy { self = [self init]; if (!self) { return nil; @@ -82,8 +82,9 @@ NS_ASSUME_NONNULL_BEGIN self.emergencyEvent = emergencyEvent; self.clusterModeStatus = clusterModeStatus; self.myKey = myKey; - self.handsOffSteering = handsOffSteering; self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + self.seatOccupancy = seatOccupancy; return self; } @@ -369,6 +370,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:nil]; } +- (void)setSeatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy { + [self.parameters sdl_setObject:seatOccupancy forName:SDLRPCParameterNameSeatOccupancy]; +} + +- (nullable NSNumber<SDLBool> *)seatOccupancy { + return [self.parameters sdl_objectForName:SDLRPCParameterNameSeatOccupancy ofClass:NSNumber.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.h b/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.h index f7628a4a1..de02ed1ef 100644 --- a/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.h +++ b/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.h @@ -51,9 +51,12 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLSubscribeVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); + /** + * Convenience init for setting all possible values on vehicle data items. + * * @param gps - gps * @param speed - speed * @param rpm - rpm @@ -84,9 +87,10 @@ NS_ASSUME_NONNULL_BEGIN * @param myKey - myKey * @param windowStatus - windowStatus * @param handsOffSteering - handsOffSteering + * @param seatOccupancy - seatOccupancy * @return A SDLSubscribeVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange climateData:(nullable SDLVehicleDataResult *)climateData turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering; +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange climateData:(nullable SDLVehicleDataResult *)climateData turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering seatOccupancy:(nullable SDLVehicleDataResult *)seatOccupancy; /** * See GearStatus @@ -344,6 +348,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable SDLVehicleDataResult *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +/** + * See SeatOccupancy + * + * @added in SmartDeviceLink 7.1.0 + */ +@property (nullable, strong, nonatomic) SDLVehicleDataResult *seatOccupancy; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.m b/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.m index 4e24f8601..3ee8eab91 100644 --- a/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.m +++ b/SmartDeviceLink/public/SDLSubscribeVehicleDataResponse.m @@ -25,7 +25,8 @@ NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic pop - (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus { - self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModes:clusterModes myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering]; + + self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModes:clusterModes myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -35,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange climateData:(nullable SDLVehicleDataResult *)climateData turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering { +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange climateData:(nullable SDLVehicleDataResult *)climateData turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering seatOccupancy:(nullable SDLVehicleDataResult *)seatOccupancy { self = [self init]; if (!self) { return nil; @@ -68,8 +69,9 @@ NS_ASSUME_NONNULL_BEGIN self.emergencyEvent = emergencyEvent; self.clusterModes = clusterModes; self.myKey = myKey; - self.handsOffSteering = handsOffSteering; self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + self.seatOccupancy = seatOccupancy; return self; } @@ -355,6 +357,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_objectForName:vehicleDataName ofClass:SDLVehicleDataResult.class error:nil]; } +- (void)setSeatOccupancy:(nullable SDLVehicleDataResult *)seatOccupancy { + [self.parameters sdl_setObject:seatOccupancy forName:SDLRPCParameterNameSeatOccupancy]; +} + +- (nullable SDLVehicleDataResult *)seatOccupancy { + return [self.parameters sdl_objectForName:SDLRPCParameterNameSeatOccupancy ofClass:SDLVehicleDataResult.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLUnsubscribeVehicleData.h b/SmartDeviceLink/public/SDLUnsubscribeVehicleData.h index 0141f96b9..04b08cf29 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeVehicleData.h +++ b/SmartDeviceLink/public/SDLUnsubscribeVehicleData.h @@ -55,7 +55,7 @@ NS_ASSUME_NONNULL_BEGIN * @param wiperStatus Unsubscribe to wiperStatus * @return A SDLUnsubscribeVehicleData object */ -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** * Convenience init for unsubscribing from all possible vehicle data items. @@ -92,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLUnsubscribeVehicleData object */ -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** * Convenience init for unsubscribing from all possible vehicle data items. @@ -127,9 +127,10 @@ NS_ASSUME_NONNULL_BEGIN * @param myKey - myKey * @param windowStatus - windowStatus * @param handsOffSteering - handsOffSteering + * @param seatOccupancy - seatOccupancy * @return A SDLUnsubscribeVehicleData object */ -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering; +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy; /** * See GearStatus @@ -333,6 +334,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable NSNumber<SDLBool> *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +/** + * See SeatOccupancy + * + * @added in SmartDeviceLink 7.1.0 + */ +@property (nullable, strong, nonatomic) NSNumber<SDLBool> *seatOccupancy; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLUnsubscribeVehicleData.m b/SmartDeviceLink/public/SDLUnsubscribeVehicleData.m index 49543506a..569d5bcfb 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeVehicleData.m +++ b/SmartDeviceLink/public/SDLUnsubscribeVehicleData.m @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic pop - (instancetype)initWithAccelerationPedalPosition:(BOOL)accPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus { - self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) climateData:nil turnSignal:@(turnSignal) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) windowStatus:nil handsOffSteering:nil]; + self = [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) climateData:nil turnSignal:@(turnSignal) gearStatus:nil tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:@(electronicParkBrakeStatus) cloudAppVehicleID:@(cloudAppVehicleID) stabilityControlsStatus:nil eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) windowStatus:nil handsOffSteering:nil seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN } - (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering windowStatus:(nullable NSNumber<SDLBool> *)windowStatus { - self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering]; + self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering { +- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange climateData:(nullable NSNumber<SDLBool> *)climateData turnSignal:(nullable NSNumber<SDLBool> *)turnSignal gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey windowStatus:(nullable NSNumber<SDLBool> *)windowStatus handsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering seatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy { self = [self init]; if (!self) { return nil; @@ -81,8 +81,9 @@ NS_ASSUME_NONNULL_BEGIN self.emergencyEvent = emergencyEvent; self.clusterModeStatus = clusterModeStatus; self.myKey = myKey; - self.handsOffSteering = handsOffSteering; self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + self.seatOccupancy = seatOccupancy; return self; } @@ -368,6 +369,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:nil]; } +- (void)setSeatOccupancy:(nullable NSNumber<SDLBool> *)seatOccupancy { + [self.parameters sdl_setObject:seatOccupancy forName:SDLRPCParameterNameSeatOccupancy]; +} + +- (nullable NSNumber<SDLBool> *)seatOccupancy { + return [self.parameters sdl_objectForName:SDLRPCParameterNameSeatOccupancy ofClass:NSNumber.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.h b/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.h index 1f87804bd..1d5c1ae81 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.h +++ b/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.h @@ -50,9 +50,11 @@ NS_ASSUME_NONNULL_BEGIN * @param windowStatus - windowStatus * @return A SDLUnsubscribeVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:windowStatus:handsOffSteering: instead"); +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus __deprecated_msg("Use initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:windowStatus:handsOffSteering:seatOccupancy: instead"); /** + * Convenience init for setting all possible values on vehicle data items. + * * @param gps - gps * @param speed - speed * @param rpm - rpm @@ -83,9 +85,10 @@ NS_ASSUME_NONNULL_BEGIN * @param myKey - myKey * @param windowStatus - windowStatus * @param handsOffSteering - handsOffSteering + * @param seatOccupancy - seatOccupancy * @return A SDLUnsubscribeVehicleDataResponse object */ -- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange climateData:(nullable SDLVehicleDataResult *)climateData turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering; +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange climateData:(nullable SDLVehicleDataResult *)climateData turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering seatOccupancy:(nullable SDLVehicleDataResult *)seatOccupancy; /** * See GearStatus @@ -343,6 +346,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable SDLVehicleDataResult *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +/** + * See SeatOccupancy + * + * @added in SmartDeviceLink 7.1.0 + */ +@property (nullable, strong, nonatomic) SDLVehicleDataResult *seatOccupancy; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.m b/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.m index d0603347b..5fd1af7b5 100644 --- a/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.m +++ b/SmartDeviceLink/public/SDLUnsubscribeVehicleDataResponse.m @@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma clang diagnostic pop - (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering windowStatus:(nullable SDLVehicleDataResult *)windowStatus { - self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModes:clusterModes myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering]; + self = [self initWithGps:gps speed:speed rpm:rpm instantFuelConsumption:instantFuelConsumption fuelRange:fuelRange climateData:nil turnSignal:turnSignal gearStatus:gearStatus tirePressure:tirePressure odometer:odometer beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModes:clusterModes myKey:myKey windowStatus:windowStatus handsOffSteering:handsOffSteering seatOccupancy:nil]; if (self) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange climateData:(nullable SDLVehicleDataResult *)climateData turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering { +- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange climateData:(nullable SDLVehicleDataResult *)climateData turnSignal:(nullable SDLVehicleDataResult *)turnSignal gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey windowStatus:(nullable SDLVehicleDataResult *)windowStatus handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering seatOccupancy:(nullable SDLVehicleDataResult *)seatOccupancy { self = [self init]; if (!self) { return nil; @@ -68,8 +68,9 @@ NS_ASSUME_NONNULL_BEGIN self.emergencyEvent = emergencyEvent; self.clusterModes = clusterModes; self.myKey = myKey; - self.handsOffSteering = handsOffSteering; self.windowStatus = windowStatus; + self.handsOffSteering = handsOffSteering; + self.seatOccupancy = seatOccupancy; return self; } @@ -356,6 +357,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.parameters sdl_objectForName:vehicleDataName ofClass:SDLVehicleDataResult.class error:nil]; } +- (void)setSeatOccupancy:(nullable SDLVehicleDataResult *)seatOccupancy { + [self.parameters sdl_setObject:seatOccupancy forName:SDLRPCParameterNameSeatOccupancy]; +} + +- (nullable SDLVehicleDataResult *)seatOccupancy { + return [self.parameters sdl_objectForName:SDLRPCParameterNameSeatOccupancy ofClass:SDLVehicleDataResult.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLVehicleDataType.h b/SmartDeviceLink/public/SDLVehicleDataType.h index f1c5fed4f..615ea03c4 100644 --- a/SmartDeviceLink/public/SDLVehicleDataType.h +++ b/SmartDeviceLink/public/SDLVehicleDataType.h @@ -201,3 +201,8 @@ extern SDLVehicleDataType const SDLVehicleDataTypeOEMVehicleDataType; * @since SDL 7.0 */ extern SDLVehicleDataType const SDLVehicleDataTypeWindowStatus; + +/** + * @added in SmartDeviceLink 7.1.0 + */ +extern SDLVehicleDataType const SDLVehicleDataTypeSeatOccupancy; diff --git a/SmartDeviceLink/public/SDLVehicleDataType.m b/SmartDeviceLink/public/SDLVehicleDataType.m index 14f84fbe6..a78eca1ca 100644 --- a/SmartDeviceLink/public/SDLVehicleDataType.m +++ b/SmartDeviceLink/public/SDLVehicleDataType.m @@ -39,5 +39,6 @@ SDLVehicleDataType const SDLVehicleDataTypeTirePressure = @"VEHICLEDATA_TIREPRES SDLVehicleDataType const SDLVehicleDataTypeTurnSignal = @"VEHICLEDATA_TURNSIGNAL"; SDLVehicleDataType const SDLVehicleDataTypeVehicleDataClimateData = @"VEHICLEDATA_CLIMATEDATA"; SDLVehicleDataType const SDLVehicleDataTypeVIN = @"VEHICLEDATA_VIN"; +SDLVehicleDataType const SDLVehicleDataTypeSeatOccupancy = @"VEHICLEDATA_SEATOCCUPANCY"; SDLVehicleDataType const SDLVehicleDataTypeWindowStatus = @"VEHICLEDATA_WINDOWSTATUS"; SDLVehicleDataType const SDLVehicleDataTypeWiperStatus = @"VEHICLEDATA_WIPERSTATUS"; diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.h b/SmartDeviceLink/public/SDLVideoStreamingCapability.h index 6a28c30bc..c80363c5c 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.h +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.h @@ -30,7 +30,21 @@ NS_ASSUME_NONNULL_BEGIN @param scale The scaling factor the app should use to change the size of the projecting view @return A SDLVideoStreamingCapability object */ -- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale; +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale __deprecated_msg("Use initWithPreferredResolution:maxBitrate:supportedFormats:hapticDataSupported:diagonalScreenSize:pixelPerInch:scale:preferredFPS instead"); + +/** + * Convenience init for creating a video streaming capability with all parameters. + * @param preferredResolution - preferredResolution + * @param maxBitrate - maxBitrate + * @param supportedFormats - supportedFormats + * @param hapticSpatialDataSupported - hapticSpatialDataSupported + * @param diagonalScreenSize - diagonalScreenSize + * @param pixelPerInch - pixelPerInch + * @param scale - scale + * @param preferredFPS - preferredFPS + * @return A SDLVideoStreamingCapability object + */ +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber<SDLUInt> *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber<SDLBool> *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber<SDLFloat> *)diagonalScreenSize pixelPerInch:(nullable NSNumber<SDLFloat> *)pixelPerInch scale:(nullable NSNumber<SDLFloat> *)scale preferredFPS:(nullable NSNumber<SDLUInt> *)preferredFPS; /** The preferred resolution of a video stream for decoding and rendering on HMI @@ -62,7 +76,7 @@ NS_ASSUME_NONNULL_BEGIN /** The diagonal screen size in inches. - + Float, Optional, minvalue="0" @since SDL 6.0 */ @@ -78,12 +92,20 @@ NS_ASSUME_NONNULL_BEGIN /** The scaling factor the app should use to change the size of the projecting view. - + Float, Optional, minvalue="1" maxvalue="10" @since SDL 6.0 */ @property (nullable, strong, nonatomic) NSNumber<SDLFloat> *scale; +/** + * The preferred frame rate per second of the head unit. The mobile application / app library may take other factors into account that constrain the frame rate lower than this value, but it should not perform streaming at a higher frame rate than this value. + * {"num_min_value": 0, "num_max_value": 2147483647} + * + * @added in SmartDeviceLink 7.1.0 + */ +@property (nullable, strong, nonatomic) NSNumber<SDLUInt> *preferredFPS; + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SDLVideoStreamingCapability.m b/SmartDeviceLink/public/SDLVideoStreamingCapability.m index ec4f2c591..392b102a9 100644 --- a/SmartDeviceLink/public/SDLVideoStreamingCapability.m +++ b/SmartDeviceLink/public/SDLVideoStreamingCapability.m @@ -17,20 +17,24 @@ NS_ASSUME_NONNULL_BEGIN @implementation SDLVideoStreamingCapability +// deprecated method, and will be removed in the future - (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(int32_t)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticDataSupported:(BOOL)hapticDataSupported diagonalScreenSize:(float)diagonalScreenSize pixelPerInch:(float)pixelPerInch scale:(float)scale { + return [self initWithPreferredResolution:preferredResolution maxBitrate:@(maxBitrate) supportedFormats:supportedFormats hapticSpatialDataSupported:@(hapticDataSupported) diagonalScreenSize:@(diagonalScreenSize) pixelPerInch:@(pixelPerInch) scale:@(scale) preferredFPS:nil]; +} + +- (instancetype)initWithPreferredResolution:(nullable SDLImageResolution *)preferredResolution maxBitrate:(nullable NSNumber<SDLUInt> *)maxBitrate supportedFormats:(nullable NSArray<SDLVideoStreamingFormat *> *)supportedFormats hapticSpatialDataSupported:(nullable NSNumber<SDLBool> *)hapticSpatialDataSupported diagonalScreenSize:(nullable NSNumber<SDLFloat> *)diagonalScreenSize pixelPerInch:(nullable NSNumber<SDLFloat> *)pixelPerInch scale:(nullable NSNumber<SDLFloat> *)scale preferredFPS:(nullable NSNumber<SDLUInt> *)preferredFPS { self = [self init]; if (!self) { - return self; + return nil; } - - self.maxBitrate = @(maxBitrate); self.preferredResolution = preferredResolution; + self.maxBitrate = maxBitrate; self.supportedFormats = supportedFormats; - self.hapticSpatialDataSupported = @(hapticDataSupported); - self.diagonalScreenSize = @(diagonalScreenSize); - self.pixelPerInch = @(pixelPerInch); - self.scale = @(scale); - + self.hapticSpatialDataSupported = hapticSpatialDataSupported; + self.diagonalScreenSize = diagonalScreenSize; + self.pixelPerInch = pixelPerInch; + self.scale = scale; + self.preferredFPS = preferredFPS; return self; } @@ -90,6 +94,14 @@ NS_ASSUME_NONNULL_BEGIN return [self.store sdl_objectForName:SDLRPCParameterNameScale ofClass:NSNumber.class error:nil]; } +- (void)setPreferredFPS:(nullable NSNumber<SDLUInt> *)preferredFPS { + [self.store sdl_setObject:preferredFPS forName:SDLRPCParameterNamePreferredFPS]; +} + +- (nullable NSNumber<SDLUInt> *)preferredFPS { + return [self.store sdl_objectForName:SDLRPCParameterNamePreferredFPS ofClass:NSNumber.class error:nil]; +} + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/public/SmartDeviceLink.h b/SmartDeviceLink/public/SmartDeviceLink.h index 9f9903ebb..8b8b6f68d 100644 --- a/SmartDeviceLink/public/SmartDeviceLink.h +++ b/SmartDeviceLink/public/SmartDeviceLink.h @@ -263,6 +263,8 @@ FOUNDATION_EXPORT const unsigned char SmartDeviceLinkVersionString[]; #import "SDLSeatMemoryAction.h" #import "SDLSeatLocation.h" #import "SDLSeatLocationCapability.h" +#import "SDLSeatOccupancy.h" +#import "SDLSeatStatus.h" #import "SDLSingleTireStatus.h" #import "SDLSISData.h" #import "SDLSoftButton.h" diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m index e444ba473..8543f4db0 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLStreamingVideoLifecycleManagerSpec.m @@ -498,7 +498,7 @@ describe(@"the streaming video manager", ^{ response.systemCapability = [[SDLSystemCapability alloc] init]; response.systemCapability.systemCapabilityType = SDLSystemCapabilityTypeVideoStreaming; - testVideoStreamingCapability = [[SDLVideoStreamingCapability alloc] initWithPreferredResolution:resolution maxBitrate:maxBitrate supportedFormats:testFormats hapticDataSupported:testHapticsSupported diagonalScreenSize:8.5 pixelPerInch:117 scale:1.25]; + testVideoStreamingCapability = [[SDLVideoStreamingCapability alloc] initWithPreferredResolution:resolution maxBitrate:@(maxBitrate) supportedFormats:testFormats hapticSpatialDataSupported:@(testHapticsSupported) diagonalScreenSize:@(8.5) pixelPerInch:@(117) scale:@(1.25) preferredFPS:@(15)]; response.systemCapability.videoStreamingCapability = testVideoStreamingCapability; [testConnectionManager respondToLastRequestWithResponse:response]; }); diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m index 220d59274..e1ff34a0f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m @@ -54,6 +54,7 @@ describe(@"individual enum value tests", ^{ expect(SDLVehicleDataTypeTirePressure).to(equal(@"VEHICLEDATA_TIREPRESSURE")); expect(SDLVehicleDataTypeTurnSignal).to(equal(@"VEHICLEDATA_TURNSIGNAL")); expect(SDLVehicleDataTypeVehicleDataClimateData).to(equal(@"VEHICLEDATA_CLIMATEDATA")); + expect(SDLVehicleDataTypeSeatOccupancy).to(equal(@"VEHICLEDATA_SEATOCCUPANCY")); expect(SDLVehicleDataTypeVIN).to(equal(@"VEHICLEDATA_VIN")); expect(SDLVehicleDataTypeWindowStatus).to(equal(@"VEHICLEDATA_WINDOWSTATUS")); expect(SDLVehicleDataTypeWiperStatus).to(equal(@"VEHICLEDATA_WIPERSTATUS")); diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m index e7e77a98b..4b7857312 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m @@ -50,6 +50,7 @@ NSArray<SDLWindowStatus *> *windowStatus = @[[[SDLWindowStatus alloc] init], [[S const BOOL handsOffSteering = YES; SDLGearStatus *gearStatus = [[SDLGearStatus alloc] initWithUserSelectedGear:SDLPRNDLDrive actualGear:SDLPRNDLPark transmissionType:SDLTransmissionTypeAutomatic]; SDLClimateData *climateData = [[SDLClimateData alloc] init]; +SDLSeatOccupancy *seatOccupancy = [[SDLSeatOccupancy alloc] init]; describe(@"getter/setter tests", ^{ context(@"init and assign", ^{ @@ -86,6 +87,7 @@ describe(@"getter/setter tests", ^{ testResponse.prndl = prndl; #pragma clang diagnostic pop testResponse.rpm = @(rpm); + testResponse.seatOccupancy = seatOccupancy; testResponse.speed = @(speed); testResponse.stabilityControlsStatus = stabilityControlsStatus; testResponse.steeringWheelAngle = @(steeringWheelAngle); @@ -129,6 +131,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(equal(prndl)); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(@(rpm))); + expect(testResponse.seatOccupancy).to(equal(seatOccupancy)); expect(testResponse.speed).to(equal(@(speed))); expect(testResponse.stabilityControlsStatus).to(equal(stabilityControlsStatus)); expect(testResponse.steeringWheelAngle).to(equal(@(steeringWheelAngle))); @@ -176,6 +179,7 @@ describe(@"getter/setter tests", ^{ SDLRPCParameterNamePRNDL:prndl, #pragma clang diagnostic pop SDLRPCParameterNameRPM:@(rpm), + SDLRPCParameterNameSeatOccupancy:seatOccupancy, SDLRPCParameterNameSpeed:@(speed), SDLRPCParameterNameStabilityControlsStatus:stabilityControlsStatus, SDLRPCParameterNameSteeringWheelAngle:@(steeringWheelAngle), @@ -222,6 +226,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(equal(prndl)); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(@(rpm))); + expect(testResponse.seatOccupancy).to(equal(seatOccupancy)); expect(testResponse.speed).to(equal(@(speed))); expect(testResponse.stabilityControlsStatus).to(equal(stabilityControlsStatus)); expect(testResponse.steeringWheelAngle).to(equal(@(steeringWheelAngle))); @@ -269,6 +274,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop expect(testResponse.rpm).to(beNil()); + expect(testResponse.seatOccupancy).to(beNil()); expect(testResponse.speed).to(beNil()); expect(testResponse.stabilityControlsStatus).to(beNil()); expect(testResponse.steeringWheelAngle).to(beNil()); @@ -282,10 +288,14 @@ describe(@"getter/setter tests", ^{ }); context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus:", ^{ + __block SDLOnVehicleData *testResponse = nil; + + beforeEach(^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLOnVehicleData* testResponse = [[SDLOnVehicleData alloc] initWithGps:gps speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:fuelRangeArray externalTemperature:@(externalTemperature) turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:@(odometer) beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey handsOffSteering:@(handsOffSteering) windowStatus:windowStatus]; + testResponse = [[SDLOnVehicleData alloc] initWithGps:gps speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:fuelRangeArray externalTemperature:@(externalTemperature) turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:@(odometer) beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey handsOffSteering:@(handsOffSteering) windowStatus:windowStatus]; #pragma clang diagnostic pop + }); it(@"expect all properties to be set properly", ^{ expect(testResponse.accPedalPosition).to(equal(@(accPedalPosition))); @@ -320,6 +330,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(@(rpm))); + expect(testResponse.seatOccupancy).to(beNil()); expect(testResponse.speed).to(equal(@(speed))); expect(testResponse.stabilityControlsStatus).to(equal(stabilityControlsStatus)); expect(testResponse.steeringWheelAngle).to(equal(@(steeringWheelAngle))); @@ -328,12 +339,15 @@ describe(@"getter/setter tests", ^{ expect(testResponse.vin).to(equal(vin)); expect(testResponse.windowStatus).to(equal(windowStatus)); expect(testResponse.wiperStatus).to(equal(wiperStatus)); - expect(testResponse.climateData).to(beNil()); }); }); - context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus:", ^{ - SDLOnVehicleData* testResponse = [[SDLOnVehicleData alloc] initWithGps:gps speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:fuelRangeArray climateData:climateData turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:@(odometer) beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:@(handsOffSteering)]; + context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy:", ^{ + __block SDLOnVehicleData *testResponse = nil; + + beforeEach(^{ + testResponse = [[SDLOnVehicleData alloc] initWithGps:gps speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:fuelRangeArray climateData:climateData turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:@(odometer) beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:@(handsOffSteering) seatOccupancy:seatOccupancy]; + }); it(@"expect all properties to be set properly", ^{ expect(testResponse.accPedalPosition).to(equal(@(accPedalPosition))); @@ -368,6 +382,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(@(rpm))); + expect(testResponse.seatOccupancy).to(equal(seatOccupancy)); expect(testResponse.speed).to(equal(@(speed))); expect(testResponse.stabilityControlsStatus).to(equal(stabilityControlsStatus)); expect(testResponse.steeringWheelAngle).to(equal(@(steeringWheelAngle))); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m index 2a43dcafb..c2b0b3681 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m @@ -16,47 +16,52 @@ QuickSpecBegin(SDLGetVehicleDataSpec) describe(@"getter/setter tests", ^{ context(@"init and assign", ^{ - SDLGetVehicleData* testRequest = [[SDLGetVehicleData alloc] init]; - testRequest.accPedalPosition = @YES; - testRequest.airbagStatus = @YES; - testRequest.beltStatus = @YES; - testRequest.bodyInformation = @YES; - testRequest.cloudAppVehicleID = @YES; - testRequest.clusterModeStatus = @YES; - testRequest.deviceStatus = @YES; - testRequest.driverBraking = @YES; - testRequest.eCallInfo = @YES; - testRequest.electronicParkBrakeStatus = @YES; - testRequest.emergencyEvent = @YES; - testRequest.engineOilLife = @YES; - testRequest.engineTorque = @YES; + __block SDLGetVehicleData *testRequest = nil; + + beforeEach(^{ + testRequest = [[SDLGetVehicleData alloc] init]; + testRequest.accPedalPosition = @YES; + testRequest.airbagStatus = @YES; + testRequest.beltStatus = @YES; + testRequest.bodyInformation = @YES; + testRequest.cloudAppVehicleID = @YES; + testRequest.clusterModeStatus = @YES; + testRequest.deviceStatus = @YES; + testRequest.driverBraking = @YES; + testRequest.eCallInfo = @YES; + testRequest.electronicParkBrakeStatus = @YES; + testRequest.emergencyEvent = @YES; + testRequest.engineOilLife = @YES; + testRequest.engineTorque = @YES; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - testRequest.externalTemperature = @YES; - testRequest.fuelLevel = @YES; - testRequest.fuelLevel_State = @YES; + testRequest.externalTemperature = @YES; + testRequest.fuelLevel = @YES; + testRequest.fuelLevel_State = @YES; #pragma clang diagnostic pop - testRequest.fuelRange = @YES; - testRequest.gearStatus = @YES; - testRequest.gps = @YES; - testRequest.handsOffSteering = @YES; - testRequest.headLampStatus = @YES; - testRequest.instantFuelConsumption = @YES; - testRequest.myKey = @YES; - testRequest.odometer = @YES; + testRequest.fuelRange = @YES; + testRequest.gearStatus = @YES; + testRequest.gps = @YES; + testRequest.handsOffSteering = @YES; + testRequest.headLampStatus = @YES; + testRequest.instantFuelConsumption = @YES; + testRequest.myKey = @YES; + testRequest.odometer = @YES; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - testRequest.prndl = @YES; + testRequest.prndl = @YES; #pragma clang diagnostic pop - testRequest.rpm = @YES; - testRequest.speed = @YES; - testRequest.stabilityControlsStatus = @YES; - testRequest.steeringWheelAngle = @YES; - testRequest.tirePressure = @YES; - testRequest.turnSignal = @YES; - testRequest.windowStatus = @YES; - testRequest.wiperStatus = @YES; - testRequest.climateData = @YES; + testRequest.rpm = @YES; + testRequest.seatOccupancy = @YES; + testRequest.speed = @YES; + testRequest.stabilityControlsStatus = @YES; + testRequest.steeringWheelAngle = @YES; + testRequest.tirePressure = @YES; + testRequest.turnSignal = @YES; + testRequest.windowStatus = @YES; + testRequest.wiperStatus = @YES; + testRequest.climateData = @YES; + }); it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); @@ -91,6 +96,7 @@ describe(@"getter/setter tests", ^{ expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -103,6 +109,7 @@ describe(@"getter/setter tests", ^{ }); context(@"initWithDictionary:", ^{ + __block SDLGetVehicleData *testRequest = nil; NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest: @{SDLRPCParameterNameParameters:@{ SDLRPCParameterNameAccelerationPedalPosition:@YES, @@ -137,6 +144,7 @@ describe(@"getter/setter tests", ^{ SDLRPCParameterNamePRNDL:@YES, #pragma clang diagnostic pop SDLRPCParameterNameRPM:@YES, + SDLRPCParameterNameSeatOccupancy:@YES, SDLRPCParameterNameSpeed:@YES, SDLRPCParameterNameStabilityControlsStatus:@YES, SDLRPCParameterNameSteeringWheelAngle:@YES, @@ -147,7 +155,9 @@ describe(@"getter/setter tests", ^{ SDLRPCParameterNameClimateData:@YES }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetVehicleData}}; - SDLGetVehicleData* testRequest = [[SDLGetVehicleData alloc] initWithDictionary:dict]; + beforeEach(^{ + testRequest = [[SDLGetVehicleData alloc] initWithDictionary:dict]; + }); it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); @@ -182,6 +192,7 @@ describe(@"getter/setter tests", ^{ expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -196,7 +207,12 @@ describe(@"getter/setter tests", ^{ describe(@"initializers", ^{ context(@"init", ^{ - SDLGetVehicleData* testRequest = [[SDLGetVehicleData alloc] init]; + __block SDLGetVehicleData *testRequest = nil; + + beforeEach(^{ + testRequest = [[SDLGetVehicleData alloc] init]; + }); + it(@"expect all properties to be nil", ^{ expect(testRequest.accPedalPosition).to(beNil()); expect(testRequest.airbagStatus).to(beNil()); @@ -230,6 +246,7 @@ describe(@"initializers", ^{ expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(beNil()); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(beNil()); expect(testRequest.stabilityControlsStatus).to(beNil()); expect(testRequest.steeringWheelAngle).to(beNil()); @@ -242,10 +259,14 @@ describe(@"initializers", ^{ }); context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus:", ^{ + __block SDLGetVehicleData *testRequest = nil; + + beforeEach(^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLGetVehicleData *testRequest = [[SDLGetVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES cloudAppVehicleID: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]; + testRequest = [[SDLGetVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES cloudAppVehicleID: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 + }); it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); @@ -280,6 +301,7 @@ describe(@"initializers", ^{ expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(beNil()); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -292,10 +314,14 @@ describe(@"initializers", ^{ }); context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus:", ^{ + __block SDLGetVehicleData *testRequest = nil; + + beforeEach(^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLGetVehicleData *testRequest = [[SDLGetVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES vin:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES windowStatus:@YES]; + testRequest = [[SDLGetVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES vin:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES windowStatus:@YES]; #pragma clang diagnostic pop + }); it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); @@ -330,6 +356,7 @@ describe(@"initializers", ^{ expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -341,8 +368,12 @@ describe(@"initializers", ^{ }); }); - context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:", ^{ - SDLGetVehicleData *testRequest = [[SDLGetVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES climateData:@YES turnSignal:@YES vin:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES windowStatus:@YES handsOffSteering:@YES]; + context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy:", ^{ + __block SDLGetVehicleData *testRequest = nil; + + beforeEach(^{ + testRequest = [[SDLGetVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES climateData:@YES turnSignal:@YES vin:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES windowStatus:@YES handsOffSteering:@YES seatOccupancy:@YES]; + }); it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); @@ -377,6 +408,7 @@ describe(@"initializers", ^{ expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -389,9 +421,13 @@ describe(@"initializers", ^{ }); context(@"should set OEM Custom Vehicle Data", ^{ - SDLGetVehicleData* testRequest = [[SDLGetVehicleData alloc] init]; - [testRequest setOEMCustomVehicleData:@"OEMCustomVehicleData" withVehicleDataState:NO]; - [testRequest setOEMCustomVehicleData:@"OEMCustomVehicleData1" withVehicleDataState:YES]; + __block SDLGetVehicleData *testRequest = nil; + + beforeEach(^{ + testRequest = [[SDLGetVehicleData alloc] init]; + [testRequest setOEMCustomVehicleData:@"OEMCustomVehicleData" withVehicleDataState:NO]; + [testRequest setOEMCustomVehicleData:@"OEMCustomVehicleData1" withVehicleDataState:YES]; + }); it(@"expect OEM Custom Vehicle Data to be set properly", ^{ expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData"]).to(equal(@NO)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m index 570c643aa..558bca573 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m @@ -49,6 +49,7 @@ describe(@"getter/setter tests", ^{ testRequest.prndl = @YES; #pragma clang diagnostic pop testRequest.rpm = @YES; + testRequest.seatOccupancy = @YES; testRequest.speed = @YES; testRequest.stabilityControlsStatus = @YES; testRequest.steeringWheelAngle = @YES; @@ -91,6 +92,7 @@ describe(@"getter/setter tests", ^{ expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -137,6 +139,7 @@ describe(@"getter/setter tests", ^{ SDLRPCParameterNamePRNDL:@YES, #pragma clang diagnostic pop SDLRPCParameterNameRPM:@YES, + SDLRPCParameterNameSeatOccupancy:@YES, SDLRPCParameterNameSpeed:@YES, SDLRPCParameterNameStabilityControlsStatus:@YES, SDLRPCParameterNameSteeringWheelAngle:@YES, @@ -182,6 +185,7 @@ describe(@"getter/setter tests", ^{ expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -231,6 +235,7 @@ describe(@"test initializers", ^{ expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(beNil()); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(beNil()); expect(testRequest.stabilityControlsStatus).to(beNil()); expect(testRequest.steeringWheelAngle).to(beNil()); @@ -242,10 +247,10 @@ describe(@"test initializers", ^{ }); }); - context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus:", ^{ + context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus:", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES windowStatus:@YES]; + SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES cloudAppVehicleID: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 wiperStatus:YES]; #pragma clang diagnostic pop it(@"expect all properties to be set properly", ^{ @@ -265,37 +270,38 @@ describe(@"test initializers", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testRequest.externalTemperature).to(equal(@YES)); - expect(testRequest.fuelLevel).to(beNil()); - expect(testRequest.fuelLevel_State).to(beNil()); + expect(testRequest.fuelLevel).to(equal(@YES)); + expect(testRequest.fuelLevel_State).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.fuelRange).to(equal(@YES)); - expect(testRequest.gearStatus).to(equal(@YES)); + expect(testRequest.gearStatus).to(beNil()); expect(testRequest.gps).to(equal(@YES)); - expect(testRequest.handsOffSteering).to(equal(@YES)); + expect(testRequest.handsOffSteering).to(beNil()); expect(testRequest.headLampStatus).to(equal(@YES)); expect(testRequest.instantFuelConsumption).to(equal(@YES)); expect(testRequest.myKey).to(equal(@YES)); expect(testRequest.odometer).to(equal(@YES)); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testRequest.prndl).to(beNil()); + expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(equal(@YES)); - expect(testRequest.stabilityControlsStatus).to(equal(@YES)); + expect(testRequest.stabilityControlsStatus).to(beNil()); expect(testRequest.steeringWheelAngle).to(equal(@YES)); expect(testRequest.tirePressure).to(equal(@YES)); expect(testRequest.turnSignal).to(equal(@YES)); - expect(testRequest.windowStatus).to(equal(@YES)); + expect(testRequest.windowStatus).to(beNil()); expect(testRequest.wiperStatus).to(equal(@YES)); expect(testRequest.climateData).to(beNil()); }); }); - context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus:", ^{ + context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus:", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES cloudAppVehicleID: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 wiperStatus:YES]; + SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES windowStatus:@YES]; #pragma clang diagnostic pop it(@"expect all properties to be set properly", ^{ @@ -315,35 +321,36 @@ describe(@"test initializers", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testRequest.externalTemperature).to(equal(@YES)); - expect(testRequest.fuelLevel).to(equal(@YES)); - expect(testRequest.fuelLevel_State).to(equal(@YES)); + expect(testRequest.fuelLevel).to(beNil()); + expect(testRequest.fuelLevel_State).to(beNil()); #pragma clang diagnostic pop expect(testRequest.fuelRange).to(equal(@YES)); - expect(testRequest.gearStatus).to(beNil()); + expect(testRequest.gearStatus).to(equal(@YES)); expect(testRequest.gps).to(equal(@YES)); - expect(testRequest.handsOffSteering).to(beNil()); + expect(testRequest.handsOffSteering).to(equal(@YES)); expect(testRequest.headLampStatus).to(equal(@YES)); expect(testRequest.instantFuelConsumption).to(equal(@YES)); expect(testRequest.myKey).to(equal(@YES)); expect(testRequest.odometer).to(equal(@YES)); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testRequest.prndl).to(equal(@YES)); + expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(equal(@YES)); - expect(testRequest.stabilityControlsStatus).to(beNil()); + expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); expect(testRequest.tirePressure).to(equal(@YES)); expect(testRequest.turnSignal).to(equal(@YES)); - expect(testRequest.windowStatus).to(beNil()); + expect(testRequest.windowStatus).to(equal(@YES)); expect(testRequest.wiperStatus).to(equal(@YES)); expect(testRequest.climateData).to(beNil()); }); }); - context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:", ^{ - SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES climateData:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES windowStatus:@YES handsOffSteering:@YES]; + context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy:", ^{ + SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES climateData:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES windowStatus:@YES handsOffSteering:@YES seatOccupancy:@YES]; it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); @@ -378,6 +385,7 @@ describe(@"test initializers", ^{ expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m index 97e65d246..b2b52ad5e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m @@ -49,6 +49,7 @@ describe(@"getter/setter tests", ^{ testRequest.prndl = @YES; #pragma clang diagnostic pop testRequest.rpm = @YES; + testRequest.seatOccupancy = @YES; testRequest.speed = @YES; testRequest.stabilityControlsStatus = @YES; testRequest.steeringWheelAngle = @YES; @@ -91,6 +92,7 @@ describe(@"getter/setter tests", ^{ expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -136,6 +138,7 @@ describe(@"getter/setter tests", ^{ SDLRPCParameterNamePRNDL:@YES, #pragma clang diagnostic pop SDLRPCParameterNameRPM:@YES, + SDLRPCParameterNameSeatOccupancy:@YES, SDLRPCParameterNameSpeed:@YES, SDLRPCParameterNameStabilityControlsStatus:@YES, SDLRPCParameterNameSteeringWheelAngle:@YES, @@ -181,6 +184,7 @@ describe(@"getter/setter tests", ^{ expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -230,6 +234,7 @@ describe(@"test initializers", ^{ expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(beNil()); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(beNil()); expect(testRequest.stabilityControlsStatus).to(beNil()); expect(testRequest.steeringWheelAngle).to(beNil()); @@ -280,6 +285,7 @@ describe(@"test initializers", ^{ expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(beNil()); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -291,10 +297,7 @@ describe(@"test initializers", ^{ }); context (@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus:", ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES windowStatus:@YES]; -#pragma clang diagnostic pop + SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES windowStatus:@YES]; it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); @@ -329,6 +332,7 @@ describe(@"test initializers", ^{ expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(beNil()); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -340,10 +344,10 @@ describe(@"test initializers", ^{ }); }); - context (@"QQQ", ^{ + context (@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:seatOccupancy:", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES climateData:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES windowStatus:@YES handsOffSteering:@YES]; + SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES instantFuelConsumption:@YES fuelRange:@YES climateData:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES stabilityControlsStatus:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES windowStatus:@YES handsOffSteering:@YES seatOccupancy:@YES]; #pragma clang diagnostic pop it(@"expect all properties to be set properly", ^{ @@ -379,6 +383,7 @@ describe(@"test initializers", ^{ expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.seatOccupancy).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.stabilityControlsStatus).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m index c505e71f1..2c13dcd80 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m @@ -51,6 +51,7 @@ const BOOL handsOffSteering = YES; SDLStabilityControlsStatus *stabilityControlsStatus = [[SDLStabilityControlsStatus alloc] init]; NSArray<SDLWindowStatus *> *windowStatus = @[[[SDLWindowStatus alloc] init], [[SDLWindowStatus alloc] init]]; SDLClimateData *climateData = [[SDLClimateData alloc] init]; +SDLSeatOccupancy *seatOccupancy = [[SDLSeatOccupancy alloc] init]; describe(@"getter/setter tests", ^{ context(@"init and assign", ^{ @@ -87,6 +88,7 @@ describe(@"getter/setter tests", ^{ testResponse.prndl = prndl; #pragma clang diagnostic pop testResponse.rpm = @(rpm); + testResponse.seatOccupancy = seatOccupancy; testResponse.speed = @(speed); testResponse.stabilityControlsStatus = stabilityControlsStatus; testResponse.steeringWheelAngle = @(steeringWheelAngle); @@ -130,6 +132,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(equal(prndl)); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(@(rpm))); + expect(testResponse.seatOccupancy).to(equal(seatOccupancy)); expect(testResponse.speed).to(equal(@(speed))); expect(testResponse.stabilityControlsStatus).to(equal(stabilityControlsStatus)); expect(testResponse.steeringWheelAngle).to(equal(@(steeringWheelAngle))); @@ -177,6 +180,7 @@ describe(@"getter/setter tests", ^{ SDLRPCParameterNamePRNDL:prndl, #pragma clang diagnostic pop SDLRPCParameterNameRPM:@(rpm), + SDLRPCParameterNameSeatOccupancy:seatOccupancy, SDLRPCParameterNameSpeed:@(speed), SDLRPCParameterNameStabilityControlsStatus:stabilityControlsStatus, SDLRPCParameterNameSteeringWheelAngle:@(steeringWheelAngle), @@ -223,6 +227,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(equal(prndl)); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(@(rpm))); + expect(testResponse.seatOccupancy).to(equal(seatOccupancy)); expect(testResponse.speed).to(equal(@(speed))); expect(testResponse.stabilityControlsStatus).to(equal(stabilityControlsStatus)); expect(testResponse.steeringWheelAngle).to(equal(@(steeringWheelAngle))); @@ -270,6 +275,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic push expect(testResponse.rpm).to(beNil()); + expect(testResponse.seatOccupancy).to(beNil()); expect(testResponse.speed).to(beNil()); expect(testResponse.stabilityControlsStatus).to(beNil()); expect(testResponse.steeringWheelAngle).to(beNil()); @@ -329,9 +335,9 @@ describe(@"getter/setter tests", ^{ }); }); - context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:windowStatus:handsOffSteering:", ^{ - SDLGetVehicleDataResponse *testResponse = [[SDLGetVehicleDataResponse alloc] initWithGps:gps speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:fuelRangeArray climateData:climateData turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:@(odometer) beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:@(handsOffSteering)]; + context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:windowStatus:seatOccupancy:", ^{ it(@"should set all properties properly", ^{ + SDLGetVehicleDataResponse *testResponse = [[SDLGetVehicleDataResponse alloc] initWithGps:gps speed:@(speed) rpm:@(rpm) instantFuelConsumption:@(instantFuelConsumption) fuelRange:fuelRangeArray climateData:climateData turnSignal:turnSignal vin:vin gearStatus:gearStatus tirePressure:tirePressure odometer:@(odometer) beltStatus:beltStatus bodyInformation:bodyInformation deviceStatus:deviceStatus driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLampStatus engineTorque:@(engineTorque) accPedalPosition:@(accPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(engineOilLife) electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID stabilityControlsStatus:stabilityControlsStatus eCallInfo:eCallInfo airbagStatus:airbagStatus emergencyEvent:emergencyEvent clusterModeStatus:clusterModeStatus myKey:myKey windowStatus:windowStatus handsOffSteering:@(handsOffSteering) seatOccupancy:seatOccupancy]; expect(testResponse.accPedalPosition).to(equal(@(accPedalPosition))); expect(testResponse.airbagStatus).to(equal(airbagStatus)); expect(testResponse.beltStatus).to(equal(beltStatus)); @@ -364,6 +370,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(@(rpm))); + expect(testResponse.seatOccupancy).to(equal(seatOccupancy)); expect(testResponse.speed).to(equal(@(speed))); expect(testResponse.stabilityControlsStatus).to(equal(stabilityControlsStatus)); expect(testResponse.steeringWheelAngle).to(equal(@(steeringWheelAngle))); @@ -372,7 +379,6 @@ describe(@"getter/setter tests", ^{ expect(testResponse.vin).to(equal(vin)); expect(testResponse.windowStatus).to(equal(windowStatus)); expect(testResponse.wiperStatus).to(equal(wiperStatus)); - expect(testResponse.climateData).to(equal(climateData)); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSeatOccupancySpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSeatOccupancySpec.m new file mode 100644 index 000000000..172af240b --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSeatOccupancySpec.m @@ -0,0 +1,64 @@ +// +// SDLUnsubscribeVehicleDataResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSeatOccupancy.h" +#import "SDLSeatStatus.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLSeatOccupancySpec) + +SDLSeatStatus *seatStatus = [[SDLSeatStatus alloc] init]; +NSArray *seatStatusArr = @[seatStatus]; + +describe(@"getter/setter tests", ^{ + context(@"init", ^{ + it(@"expect all properties to be set properly", ^{ + SDLSeatOccupancy* testStruct = [[SDLSeatOccupancy alloc] init]; + testStruct.seatsBelted = seatStatusArr; + testStruct.seatsOccupied = seatStatusArr; + + expect(testStruct.seatsBelted).to(equal(seatStatusArr)); + expect(testStruct.seatsOccupied).to(equal(seatStatusArr)); + }); + }); + + context(@"initWithDictionary:", ^{ + it(@"expect all properties to be set properly", ^{ + NSDictionary *dict = @{ + SDLRPCParameterNameSeatsBelted:seatStatusArr, + SDLRPCParameterNameSeatsOccupied:seatStatusArr, + }; + + SDLSeatOccupancy* testStruct = [[SDLSeatOccupancy alloc] initWithDictionary:dict]; + + expect(testStruct.seatsBelted).to(equal(seatStatusArr)); + expect(testStruct.seatsOccupied).to(equal(seatStatusArr)); + }); + }); + + context(@"init", ^{ + it(@"expect all properties to be nil", ^{ + SDLSeatOccupancy* testStruct = [[SDLSeatOccupancy alloc] init]; + expect(testStruct.seatsBelted).to(beNil()); + expect(testStruct.seatsOccupied).to(beNil()); + }); + }); + + context(@"initWithSeatsOccupied:seatsBelted:", ^{ + it(@"expect all properties to be set properly", ^{ + SDLSeatOccupancy* testStruct = [[SDLSeatOccupancy alloc] initWithSeatsOccupied:seatStatusArr seatsBelted:seatStatusArr]; + expect(testStruct.seatsBelted).to(equal(seatStatusArr)); + expect(testStruct.seatsOccupied).to(equal(seatStatusArr)); + }); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSeatStatusSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSeatStatusSpec.m new file mode 100644 index 000000000..fa56d7729 --- /dev/null +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSeatStatusSpec.m @@ -0,0 +1,66 @@ +// +// SDLUnsubscribeVehicleDataResponseSpec.m +// SmartDeviceLink + + +#import <Foundation/Foundation.h> + +#import <Quick/Quick.h> +#import <Nimble/Nimble.h> + +#import "SDLSeatStatus.h" +#import "SDLSeatLocation.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + +QuickSpecBegin(SDLSeatStatusSpec) + +SDLSeatLocation *seatLocation = [[SDLSeatLocation alloc] init]; +NSNumber<SDLBool> *conditionActive = @YES; + +describe(@"getter/setter tests", ^{ + context(@"init", ^{ + it(@"expect all properties to be set properly", ^{ + SDLSeatStatus* testStruct = [[SDLSeatStatus alloc] init]; + testStruct.conditionActive = conditionActive; + testStruct.seatLocation = seatLocation; + + expect(testStruct.conditionActive).to(equal(conditionActive)); + expect(testStruct.seatLocation).to(equal(seatLocation)); + }); + }); + + context(@"initWithDictionary:", ^{ + it(@"expect all properties to be set properly", ^{ + NSDictionary *dict = @{ + SDLRPCParameterNameConditionActive:conditionActive, + SDLRPCParameterNameSeatLocation:seatLocation, + }; + + SDLSeatStatus* testStruct = [[SDLSeatStatus alloc] initWithDictionary:dict]; + + expect(testStruct.conditionActive).to(equal(conditionActive)); + expect(testStruct.seatLocation).to(equal(seatLocation)); + }); + }); + + context(@"init", ^{ + it(@"expect all properties to be nil", ^{ + SDLSeatStatus* testStruct = [[SDLSeatStatus alloc] init]; + + expect(testStruct.conditionActive).to(beNil()); + expect(testStruct.seatLocation).to(beNil()); + }); + }); + + context(@"initWithSeatsOccupied:seatsBelted:", ^{ + it(@"expect all properties to be set properly", ^{ + SDLSeatStatus* testStruct = [[SDLSeatStatus alloc] initWithSeatLocation:seatLocation conditionActive:conditionActive]; + + expect(testStruct.conditionActive).to(equal(conditionActive)); + expect(testStruct.seatLocation).to(equal(seatLocation)); + }); + }); +}); + +QuickSpecEnd diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m index 84188b4be..6b3e7058e 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m @@ -55,6 +55,7 @@ describe(@"getter/setter tests", ^{ testResponse.prndl = vehicleDataResult; #pragma clang diagnostic pop testResponse.rpm = vehicleDataResult; + testResponse.seatOccupancy = vehicleDataResult; testResponse.speed = vehicleDataResult; testResponse.stabilityControlsStatus = vehicleDataResult; testResponse.steeringWheelAngle = vehicleDataResult; @@ -97,6 +98,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(equal(vehicleDataResult)); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.seatOccupancy).to(equal(vehicleDataResult)); expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.stabilityControlsStatus).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); @@ -143,6 +145,7 @@ describe(@"getter/setter tests", ^{ SDLRPCParameterNamePRNDL:vehicleDataResult, #pragma clang diagnostic pop SDLRPCParameterNameRPM:vehicleDataResult, + SDLRPCParameterNameSeatOccupancy:vehicleDataResult, SDLRPCParameterNameSpeed:vehicleDataResult, SDLRPCParameterNameStabilityControlsStatus:vehicleDataResult, SDLRPCParameterNameSteeringWheelAngle:vehicleDataResult, @@ -189,6 +192,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(equal(vehicleDataResult)); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.seatOccupancy).to(equal(vehicleDataResult)); expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.stabilityControlsStatus).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); @@ -236,6 +240,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop expect(testResponse.rpm).to(beNil()); + expect(testResponse.seatOccupancy).to(beNil()); expect(testResponse.speed).to(beNil()); expect(testResponse.stabilityControlsStatus).to(beNil()); expect(testResponse.steeringWheelAngle).to(beNil()); @@ -286,6 +291,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic push expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.seatOccupancy).to(beNil()); expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.stabilityControlsStatus).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); @@ -293,12 +299,11 @@ describe(@"getter/setter tests", ^{ expect(testResponse.turnSignal).to(equal(vehicleDataResult)); expect(testResponse.windowStatus).to(equal(vehicleDataResult)); expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); - expect(testResponse.climateData).to(beNil()); }); }); - context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:windowStatus:handsOffSteering:", ^{ - SDLSubscribeVehicleDataResponse *testResponse = [[SDLSubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult climateData:vehicleDataResult turnSignal:vehicleDataResult gearStatus:vehicleDataResult tirePressure:vehicleDataResult odometer:vehicleDataResult beltStatus:vehicleDataResult bodyInformation:vehicleDataResult deviceStatus:vehicleDataResult driverBraking:vehicleDataResult wiperStatus:vehicleDataResult headLampStatus:vehicleDataResult engineTorque:vehicleDataResult accPedalPosition:vehicleDataResult steeringWheelAngle:vehicleDataResult engineOilLife:vehicleDataResult electronicParkBrakeStatus:vehicleDataResult cloudAppVehicleID:vehicleDataResult stabilityControlsStatus:vehicleDataResult eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult windowStatus:vehicleDataResult handsOffSteering:vehicleDataResult]; + context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:windowStatus:handsOffSteering:seatOccupancy:", ^{ + SDLSubscribeVehicleDataResponse *testResponse = [[SDLSubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult climateData:vehicleDataResult turnSignal:vehicleDataResult gearStatus:vehicleDataResult tirePressure:vehicleDataResult odometer:vehicleDataResult beltStatus:vehicleDataResult bodyInformation:vehicleDataResult deviceStatus:vehicleDataResult driverBraking:vehicleDataResult wiperStatus:vehicleDataResult headLampStatus:vehicleDataResult engineTorque:vehicleDataResult accPedalPosition:vehicleDataResult steeringWheelAngle:vehicleDataResult engineOilLife:vehicleDataResult electronicParkBrakeStatus:vehicleDataResult cloudAppVehicleID:vehicleDataResult stabilityControlsStatus:vehicleDataResult eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult windowStatus:vehicleDataResult handsOffSteering:vehicleDataResult seatOccupancy:vehicleDataResult]; it(@"expect all properties to be set properly", ^{ expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); @@ -333,6 +338,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic push expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.seatOccupancy).to(equal(vehicleDataResult)); expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.stabilityControlsStatus).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m index e0092c212..b2b2561e0 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m @@ -54,6 +54,7 @@ describe(@"getter/setter tests", ^{ testResponse.prndl = vehicleDataResult; #pragma clang diagnostic pop testResponse.rpm = vehicleDataResult; + testResponse.seatOccupancy = vehicleDataResult; testResponse.speed = vehicleDataResult; testResponse.stabilityControlsStatus = vehicleDataResult; testResponse.steeringWheelAngle = vehicleDataResult; @@ -96,6 +97,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(equal(vehicleDataResult)); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.seatOccupancy).to(equal(vehicleDataResult)); expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.stabilityControlsStatus).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); @@ -142,6 +144,7 @@ describe(@"getter/setter tests", ^{ SDLRPCParameterNamePRNDL:vehicleDataResult, #pragma clang diagnostic pop SDLRPCParameterNameRPM:vehicleDataResult, + SDLRPCParameterNameSeatOccupancy:vehicleDataResult, SDLRPCParameterNameSpeed:vehicleDataResult, SDLRPCParameterNameStabilityControlsStatus:vehicleDataResult, SDLRPCParameterNameSteeringWheelAngle:vehicleDataResult, @@ -187,6 +190,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(equal(vehicleDataResult)); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.seatOccupancy).to(equal(vehicleDataResult)); expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.stabilityControlsStatus).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); @@ -234,6 +238,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop expect(testResponse.rpm).to(beNil()); + expect(testResponse.seatOccupancy).to(beNil()); expect(testResponse.speed).to(beNil()); expect(testResponse.stabilityControlsStatus).to(beNil()); expect(testResponse.steeringWheelAngle).to(beNil()); @@ -246,12 +251,13 @@ describe(@"getter/setter tests", ^{ }); context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:handsOffSteering:windowStatus:", ^{ + + it(@"expect all properties to be set properly", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult externalTemperature:vehicleDataResult turnSignal:vehicleDataResult gearStatus:vehicleDataResult tirePressure:vehicleDataResult odometer:vehicleDataResult beltStatus:vehicleDataResult bodyInformation:vehicleDataResult deviceStatus:vehicleDataResult driverBraking:vehicleDataResult wiperStatus:vehicleDataResult headLampStatus:vehicleDataResult engineTorque:vehicleDataResult accPedalPosition:vehicleDataResult steeringWheelAngle:vehicleDataResult engineOilLife:vehicleDataResult electronicParkBrakeStatus:vehicleDataResult cloudAppVehicleID:vehicleDataResult stabilityControlsStatus:vehicleDataResult eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult handsOffSteering:vehicleDataResult windowStatus:vehicleDataResult]; + SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult externalTemperature:vehicleDataResult turnSignal:vehicleDataResult gearStatus:vehicleDataResult tirePressure:vehicleDataResult odometer:vehicleDataResult beltStatus:vehicleDataResult bodyInformation:vehicleDataResult deviceStatus:vehicleDataResult driverBraking:vehicleDataResult wiperStatus:vehicleDataResult headLampStatus:vehicleDataResult engineTorque:vehicleDataResult accPedalPosition:vehicleDataResult steeringWheelAngle:vehicleDataResult engineOilLife:vehicleDataResult electronicParkBrakeStatus:vehicleDataResult cloudAppVehicleID:vehicleDataResult stabilityControlsStatus:vehicleDataResult eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult handsOffSteering:vehicleDataResult windowStatus:vehicleDataResult]; #pragma clang diagnostic pop - it(@"expect all properties to be set properly", ^{ expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); expect(testResponse.beltStatus).to(equal(vehicleDataResult)); @@ -265,9 +271,9 @@ describe(@"getter/setter tests", ^{ expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); expect(testResponse.engineOilLife).to(equal(vehicleDataResult)); expect(testResponse.engineTorque).to(equal(vehicleDataResult)); + expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); expect(testResponse.fuelLevel).to(beNil()); expect(testResponse.fuelLevel_State).to(beNil()); #pragma clang diagnostic pop @@ -284,20 +290,20 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.seatOccupancy).to(beNil()); expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); expect(testResponse.tirePressure).to(equal(vehicleDataResult)); expect(testResponse.turnSignal).to(equal(vehicleDataResult)); expect(testResponse.windowStatus).to(equal(vehicleDataResult)); expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); - expect(testResponse.climateData).to(beNil()); }); }); - context(@"QQQ", ^{ + context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:climateData:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:windowStatus:handsOffSteering:seatOccupancy:", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult climateData:vehicleDataResult turnSignal:vehicleDataResult gearStatus:vehicleDataResult tirePressure:vehicleDataResult odometer:vehicleDataResult beltStatus:vehicleDataResult bodyInformation:vehicleDataResult deviceStatus:vehicleDataResult driverBraking:vehicleDataResult wiperStatus:vehicleDataResult headLampStatus:vehicleDataResult engineTorque:vehicleDataResult accPedalPosition:vehicleDataResult steeringWheelAngle:vehicleDataResult engineOilLife:vehicleDataResult electronicParkBrakeStatus:vehicleDataResult cloudAppVehicleID:vehicleDataResult stabilityControlsStatus:vehicleDataResult eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult windowStatus:vehicleDataResult handsOffSteering:vehicleDataResult]; + SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult climateData:vehicleDataResult turnSignal:vehicleDataResult gearStatus:vehicleDataResult tirePressure:vehicleDataResult odometer:vehicleDataResult beltStatus:vehicleDataResult bodyInformation:vehicleDataResult deviceStatus:vehicleDataResult driverBraking:vehicleDataResult wiperStatus:vehicleDataResult headLampStatus:vehicleDataResult engineTorque:vehicleDataResult accPedalPosition:vehicleDataResult steeringWheelAngle:vehicleDataResult engineOilLife:vehicleDataResult electronicParkBrakeStatus:vehicleDataResult cloudAppVehicleID:vehicleDataResult stabilityControlsStatus:vehicleDataResult eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult windowStatus:vehicleDataResult handsOffSteering:vehicleDataResult seatOccupancy:vehicleDataResult]; #pragma clang diagnostic pop it(@"expect all properties to be set properly", ^{ @@ -333,6 +339,7 @@ describe(@"getter/setter tests", ^{ expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.seatOccupancy).to(equal(vehicleDataResult)); expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); expect(testResponse.tirePressure).to(equal(vehicleDataResult)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m index 0e3fc67f4..453076aa2 100755 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLSystemCapabilitySpec.m @@ -37,7 +37,7 @@ describe(@"Getter/Setter Tests", ^ { testNavigationCapability = [[SDLNavigationCapability alloc] initWithSendLocation:YES waypoints:NO]; 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 diagonalScreenSize:23 pixelPerInch:119 scale:1.4]; + testVideoStreamingCapability = [[SDLVideoStreamingCapability alloc] initWithPreferredResolution:[[SDLImageResolution alloc] initWithWidth:50 height: 50] maxBitrate:@(5) supportedFormats:@[] hapticSpatialDataSupported:@(false) diagonalScreenSize:@(23) pixelPerInch:@(119) scale:@(1.4) preferredFPS:@(15)]; testSeatLocationCapability = [[SDLSeatLocationCapability alloc] init]; testDriverDistractionCapability = [[SDLDriverDistractionCapability alloc] initWithMenuLength:@2 subMenuDepth:@4]; }); @@ -158,7 +158,7 @@ describe(@"Getter/Setter Tests", ^ { NSArray<SDLVideoStreamingFormat *> *formatArray = @[format1, format2]; - SDLVideoStreamingCapability *testVidStruct = [[SDLVideoStreamingCapability alloc] initWithPreferredResolution:resolution maxBitrate:maxBitrate supportedFormats:formatArray hapticDataSupported:hapticDataSupported diagonalScreenSize:45 pixelPerInch:112 scale:2.1]; + SDLVideoStreamingCapability *testVidStruct = [[SDLVideoStreamingCapability alloc] initWithPreferredResolution:resolution maxBitrate:@(maxBitrate) supportedFormats:formatArray hapticSpatialDataSupported:@(hapticDataSupported) diagonalScreenSize:@(45) pixelPerInch:@(112) scale:@(2.1) preferredFPS:@(15)]; SDLSystemCapability *testStruct = [[SDLSystemCapability alloc] initWithVideoStreamingCapability:testVidStruct]; expect(testStruct.systemCapabilityType).to(equal(SDLSystemCapabilityTypeVideoStreaming)); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m index e4d08951c..10d9eb40f 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLVideoStreamingCapabilitySpec.m @@ -28,6 +28,7 @@ describe(@"Initialization tests", ^{ __block float testDiagonalScreenSize = 22.45; __block float testPixelPerInch = 96.122; __block float testScale = 2.1; + __block uint testPreferredFPS = 15; beforeEach(^{ testPreferredResolution = [[SDLImageResolution alloc] initWithWidth:600 height:500]; @@ -50,7 +51,8 @@ describe(@"Initialization tests", ^{ SDLRPCParameterNameHapticSpatialDataSupported: @(testHapticDataSupported), SDLRPCParameterNameDiagonalScreenSize: @(testDiagonalScreenSize), SDLRPCParameterNamePixelPerInch: @(testPixelPerInch), - SDLRPCParameterNameScale: @(testScale)}; + SDLRPCParameterNameScale: @(testScale), + SDLRPCParameterNamePreferredFPS: @(testPreferredFPS)}; SDLVideoStreamingCapability* testStruct = [[SDLVideoStreamingCapability alloc] initWithDictionary:dict]; @@ -61,6 +63,7 @@ describe(@"Initialization tests", ^{ expect(testStruct.diagonalScreenSize).to(equal(testDiagonalScreenSize)); expect(testStruct.pixelPerInch).to(equal(testPixelPerInch)); expect(testStruct.scale).to(equal(testScale)); + expect(testStruct.preferredFPS).to(equal(testPreferredFPS)); }); it(@"Should return nil if not set", ^ { @@ -73,6 +76,7 @@ describe(@"Initialization tests", ^{ expect(testStruct.diagonalScreenSize).to(beNil()); expect(testStruct.pixelPerInch).to(beNil()); expect(testStruct.scale).to(beNil()); + expect(testStruct.preferredFPS).to(beNil()); }); it(@"Should initialize correctly with initWithPreferredResolution:maxBitrate:supportedFormats:hapticDataSupported:diagonalScreenSize:pixelPerInch:scale", ^ { @@ -85,6 +89,20 @@ describe(@"Initialization tests", ^{ expect(testStruct.diagonalScreenSize).to(equal(testDiagonalScreenSize)); expect(testStruct.pixelPerInch).to(equal(testPixelPerInch)); expect(testStruct.scale).to(equal(testScale)); + expect(testStruct.preferredFPS).to(equal(beNil())); + }); + + it(@"Should initialize correctly with initWithPreferredResolution:maxBitrate:supportedFormats:hapticDataSupported:diagonalScreenSize:pixelPerInch:scale:preferredFPS", ^ { + SDLVideoStreamingCapability *testStruct = [[SDLVideoStreamingCapability alloc] initWithPreferredResolution:testPreferredResolution maxBitrate:@(testMaxBitrate) supportedFormats:testVideoStreamingFormats hapticSpatialDataSupported:@(testHapticDataSupported) diagonalScreenSize:@(testDiagonalScreenSize) pixelPerInch:@(testPixelPerInch) scale:@(testScale) preferredFPS:@(testPreferredFPS)]; + + expect(testStruct.preferredResolution).to(equal(testPreferredResolution)); + expect(testStruct.maxBitrate).to(equal(testMaxBitrate)); + expect(testStruct.supportedFormats).to(equal(testVideoStreamingFormats)); + expect(testStruct.hapticSpatialDataSupported).to(equal(testHapticDataSupported)); + expect(testStruct.diagonalScreenSize).to(equal(testDiagonalScreenSize)); + expect(testStruct.pixelPerInch).to(equal(testPixelPerInch)); + expect(testStruct.scale).to(equal(testScale)); + expect(testStruct.preferredFPS).to(equal(testPreferredFPS)); }); }); diff --git a/generator/rpc_spec b/generator/rpc_spec -Subproject 762489ca140f246923e8bb8f54e96364e9d0101 +Subproject 1a8d4a28ebdf4410a63e22ce7a1792d9e5cd7e4 |