summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2020-08-06 16:08:31 -0400
committerGitHub <noreply@github.com>2020-08-06 16:08:31 -0400
commit465d4d70f92037f16b0e5146a409ff19498678cf (patch)
treeca0e6ffb996c998e65420a06c1bbca35aedc3ef2
parent85cad72cfda9a03550fa4a002ee2c755cd45605e (diff)
parentd66ee961f69c0101ee3d4b5fceda81007ec6c213 (diff)
downloadsdl_ios-465d4d70f92037f16b0e5146a409ff19498678cf.tar.gz
Merge pull request #1693 from yoooriii/feature/0257_hands_off_steering
[SDL-0257] New vehicle data HandsOffSteering
-rw-r--r--SmartDeviceLink/SDLGetVehicleData.h49
-rw-r--r--SmartDeviceLink/SDLGetVehicleData.m83
-rw-r--r--SmartDeviceLink/SDLGetVehicleDataResponse.h44
-rw-r--r--SmartDeviceLink/SDLGetVehicleDataResponse.m52
-rw-r--r--SmartDeviceLink/SDLOnVehicleData.h42
-rw-r--r--SmartDeviceLink/SDLOnVehicleData.m52
-rw-r--r--SmartDeviceLink/SDLRPCParameterNames.h33
-rw-r--r--SmartDeviceLink/SDLRPCParameterNames.m33
-rw-r--r--SmartDeviceLink/SDLSubscribeVehicleData.h50
-rw-r--r--SmartDeviceLink/SDLSubscribeVehicleData.m82
-rw-r--r--SmartDeviceLink/SDLSubscribeVehicleDataResponse.h44
-rw-r--r--SmartDeviceLink/SDLSubscribeVehicleDataResponse.m51
-rw-r--r--SmartDeviceLink/SDLUnsubscribeVehicleData.h48
-rw-r--r--SmartDeviceLink/SDLUnsubscribeVehicleData.m83
-rw-r--r--SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h44
-rw-r--r--SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m51
-rw-r--r--SmartDeviceLink/SDLVehicleDataType.h6
-rw-r--r--SmartDeviceLink/SDLVehicleDataType.m2
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m1
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m113
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m312
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m289
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m277
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m122
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m55
-rw-r--r--SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m58
26 files changed, 1474 insertions, 602 deletions
diff --git a/SmartDeviceLink/SDLGetVehicleData.h b/SmartDeviceLink/SDLGetVehicleData.h
index 8e7082037..6af61f4c8 100644
--- a/SmartDeviceLink/SDLGetVehicleData.h
+++ b/SmartDeviceLink/SDLGetVehicleData.h
@@ -47,7 +47,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 clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus: instead");
+- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
/**
* Convenience init for getting data for all possible vehicle data items.
@@ -83,7 +83,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 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 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: instead");
+- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation 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:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
/**
* Convenience init for getting data for all possible vehicle data items.
@@ -120,7 +120,45 @@ 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;
+- (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:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
+
+/**
+ * Convenience init for getting data for all possible vehicle data items.
+ *
+ * @param gps - gps
+ * @param speed - speed
+ * @param rpm - rpm
+ * @param fuelLevel - fuelLevel
+ * @param fuelLevel_State - fuelLevel_State
+ * @param instantFuelConsumption - instantFuelConsumption
+ * @param fuelRange - fuelRange
+ * @param externalTemperature - externalTemperature
+ * @param turnSignal - turnSignal
+ * @param vin - vin
+ * @param prndl - prndl
+ * @param tirePressure - tirePressure
+ * @param odometer - odometer
+ * @param beltStatus - beltStatus
+ * @param bodyInformation - bodyInformation
+ * @param deviceStatus - deviceStatus
+ * @param driverBraking - driverBraking
+ * @param wiperStatus - wiperStatus
+ * @param headLampStatus - headLampStatus
+ * @param engineTorque - engineTorque
+ * @param accPedalPosition - accPedalPosition
+ * @param steeringWheelAngle - steeringWheelAngle
+ * @param engineOilLife - engineOilLife
+ * @param electronicParkBrakeStatus - electronicParkBrakeStatus
+ * @param cloudAppVehicleID - cloudAppVehicleID
+ * @param eCallInfo - eCallInfo
+ * @param airbagStatus - airbagStatus
+ * @param emergencyEvent - emergencyEvent
+ * @param clusterModeStatus - clusterModeStatus
+ * @param myKey - myKey
+ * @param handsOffSteering - handsOffSteering
+ * @return A SDLGetVehicleData object
+ */
+- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm fuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel fuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State 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 prndl:(nullable NSNumber<SDLBool> *)prndl 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 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;
/**
* A boolean value. If true, requests GPS data.
@@ -208,6 +246,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *wiperStatus;
/**
+ * To indicate whether driver hands are off the steering wheel
+ */
+@property (strong, nonatomic, nullable) NSNumber<SDLBool> *handsOffSteering;
+
+/**
* A boolean value. If true, requests Head Lamp Status data.
*/
@property (nullable, strong, nonatomic) NSNumber<SDLBool> *headLampStatus;
diff --git a/SmartDeviceLink/SDLGetVehicleData.m b/SmartDeviceLink/SDLGetVehicleData.m
index 30b8dfe81..354ae7a8b 100644
--- a/SmartDeviceLink/SDLGetVehicleData.m
+++ b/SmartDeviceLink/SDLGetVehicleData.m
@@ -15,57 +15,62 @@ NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (instancetype)init {
- if (self = [super initWithName:SDLRPCFunctionNameGetVehicleData]) {
+ self = [super initWithName:SDLRPCFunctionNameGetVehicleData];
+ if (!self) {
+ return nil;
}
return self;
}
#pragma clang diagnostic pop
- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus {
- return [self initWithAccelerationPedalPosition:accelerationPedalPosition airbagStatus:airbagStatus beltStatus:beltStatus bodyInformation:bodyInformation clusterModeStatus:clusterModeStatus deviceStatus:deviceStatus driverBraking:driverBraking eCallInfo:eCallInfo electronicParkBrakeStatus:NO emergencyEvent:emergencyEvent engineOilLife:NO engineTorque:engineTorque externalTemperature:externalTemperature fuelLevel:fuelLevel fuelLevelState:fuelLevelState fuelRange:NO gps:gps headLampStatus:headLampStatus instantFuelConsumption:instantFuelConsumption myKey:myKey odometer:odometer prndl:prndl rpm:rpm speed:speed steeringWheelAngle:steeringWheelAngle tirePressure:tirePressure turnSignal:NO vin:vin wiperStatus:wiperStatus];
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(NO) externalTemperature:@(externalTemperature) turnSignal:@(NO) vin:@(vin) prndl:@(prndl) tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accelerationPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(NO) electronicParkBrakeStatus:@(NO) cloudAppVehicleID:@(NO) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
}
- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation 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 {
- return [self initWithAccelerationPedalPosition:accelerationPedalPosition airbagStatus:airbagStatus beltStatus:beltStatus bodyInformation:bodyInformation cloudAppVehicleID:NO clusterModeStatus:clusterModeStatus deviceStatus:deviceStatus driverBraking:driverBraking eCallInfo:eCallInfo electronicParkBrakeStatus:electronicParkBrakeStatus emergencyEvent:emergencyEvent engineOilLife:engineOilLife engineTorque:engineTorque externalTemperature:externalTemperature fuelLevel:fuelLevel fuelLevelState:fuelLevelState fuelRange:fuelRange gps:gps headLampStatus:headLampStatus instantFuelConsumption:instantFuelConsumption myKey:myKey odometer:odometer prndl:prndl rpm:rpm speed:speed steeringWheelAngle:steeringWheelAngle tirePressure:tirePressure turnSignal:turnSignal vin:vin wiperStatus:wiperStatus];
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) vin:@(vin) prndl:@(prndl) 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:@(NO) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
}
- (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 {
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) vin:@(vin) prndl:@(prndl) 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) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
+}
+
+- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm fuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel fuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State 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 prndl:(nullable NSNumber<SDLBool> *)prndl 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 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 {
self = [self init];
if (!self) {
return nil;
}
-
- self.accPedalPosition = @(accelerationPedalPosition);
- self.airbagStatus = @(airbagStatus);
- self.beltStatus = @(beltStatus);
- self.bodyInformation = @(bodyInformation);
- self.cloudAppVehicleID = @(cloudAppVehicleID);
- self.clusterModeStatus = @(clusterModeStatus);
- self.deviceStatus = @(deviceStatus);
- self.driverBraking = @(driverBraking);
- self.eCallInfo = @(eCallInfo);
- self.electronicParkBrakeStatus = @(electronicParkBrakeStatus);
- self.emergencyEvent = @(emergencyEvent);
- self.engineOilLife = @(engineOilLife);
- self.engineTorque = @(engineTorque);
- self.externalTemperature = @(externalTemperature);
- self.fuelLevel = @(fuelLevel);
- self.fuelLevel_State = @(fuelLevelState);
- self.fuelRange = @(fuelRange);
- self.myKey = @(myKey);
- self.odometer = @(odometer);
- self.gps = @(gps);
- self.headLampStatus = @(headLampStatus);
- self.instantFuelConsumption = @(instantFuelConsumption);
- self.prndl = @(prndl);
- self.rpm = @(rpm);
- self.speed = @(speed);
- self.steeringWheelAngle = @(steeringWheelAngle);
- self.tirePressure = @(tirePressure);
- self.turnSignal = @(turnSignal);
- self.vin = @(vin);
- self.wiperStatus = @(wiperStatus);
-
+ self.gps = gps;
+ self.speed = speed;
+ self.rpm = rpm;
+ self.fuelLevel = fuelLevel;
+ self.fuelLevel_State = fuelLevel_State;
+ self.instantFuelConsumption = instantFuelConsumption;
+ self.fuelRange = fuelRange;
+ self.externalTemperature = externalTemperature;
+ self.turnSignal = turnSignal;
+ self.vin = vin;
+ self.prndl = prndl;
+ self.tirePressure = tirePressure;
+ self.odometer = odometer;
+ self.beltStatus = beltStatus;
+ self.bodyInformation = bodyInformation;
+ self.deviceStatus = deviceStatus;
+ self.driverBraking = driverBraking;
+ self.wiperStatus = wiperStatus;
+ self.headLampStatus = headLampStatus;
+ self.engineTorque = engineTorque;
+ self.accPedalPosition = accPedalPosition;
+ self.steeringWheelAngle = steeringWheelAngle;
+ self.engineOilLife = engineOilLife;
+ self.electronicParkBrakeStatus = electronicParkBrakeStatus;
+ self.cloudAppVehicleID = cloudAppVehicleID;
+ self.eCallInfo = eCallInfo;
+ self.airbagStatus = airbagStatus;
+ self.emergencyEvent = emergencyEvent;
+ self.clusterModeStatus = clusterModeStatus;
+ self.myKey = myKey;
+ self.handsOffSteering = handsOffSteering;
return self;
}
@@ -317,6 +322,14 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:nil];
}
+- (void)setHandsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering {
+ [self.parameters sdl_setObject:handsOffSteering forName:SDLRPCParameterNameHandsOffSteering];
+}
+
+- (nullable NSNumber<SDLBool> *)handsOffSteering {
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameHandsOffSteering ofClass:NSNumber.class error:nil];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLGetVehicleDataResponse.h b/SmartDeviceLink/SDLGetVehicleDataResponse.h
index 7e727aebd..1d9afddb6 100644
--- a/SmartDeviceLink/SDLGetVehicleDataResponse.h
+++ b/SmartDeviceLink/SDLGetVehicleDataResponse.h
@@ -35,6 +35,45 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLGetVehicleDataResponse : SDLRPCResponse
/**
+ * initializes a new allocated object of the SDLGetVehicleDataResponse class
+ *
+ * @param accPedalPosition Accelerator pedal position (percentage depressed), optional
+ * @param airbagStatus The status of the air bags, optional
+ * @param beltStatus The status of the seat belts, optional
+ * @param bodyInformation The body information including power modes, optional
+ * @param cloudAppVehicleID The cloud app vehicle ID, optional
+ * @param clusterModeStatus The status modes of the cluster, optional
+ * @param deviceStatus The IVI system status including signal and battery strength, optional
+ * @param driverBraking The status of the brake pedal, optional
+ * @param eCallInfo Emergency Call notification and confirmation data, optional
+ * @param electronicParkBrakeStatus The status of the electronic parking brake, optional
+ * @param emergencyEvent Information related to an emergency event (and if it occurred), optional
+ * @param engineOilLife The estimated percentage (0% - 100%) of remaining oil life of the engine, optional
+ * @param engineTorque Torque value for engine (in Nm) on non-diesel variants, optional
+ * @param externalTemperature The external temperature in degrees celsius., optional
+ * @param fuelLevel The fuel level in the tank (percentage), optional
+ * @param fuelLevel_State The fuel level state, optional
+ * @param fuelRange The estimate range in KM the vehicle can travel based on fuel level and consumption. Optional, Array of length 0 - 100, of SDLFuelRange
+ * @param gps The car current GPS coordinates, optional
+ * @param handsOffSteering To indicate whether driver hands are off the steering wheel, optional
+ * @param headLampStatus Status of the head lamps, optional
+ * @param instantFuelConsumption The instantaneous fuel consumption in microlitres, optional
+ * @param myKey Information related to the MyKey feature, optional
+ * @param odometer Odometer reading in km, optional
+ * @param prndl The current gear shift state of the user's vehicle, optional
+ * @param rpm The number of revolutions per minute of the engine., optional
+ * @param speed The vehicle speed in kilometers per hour, optional
+ * @param steeringWheelAngle Current angle of the steering wheel (in deg), optional
+ * @param tirePressure The current pressure warnings for the user's vehicle, optional
+ * @param turnSignal The status of the turn signal, optional
+ * @param vin The Vehicle Identification Number, optional
+ * @param wiperStatus The status of the wipers, optional
+ *
+ * @return an initialized object of the SDLGetVehicleDataResponse class or nil
+ */
+- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(float)speed rpm:(nullable NSNumber<SDLUInt> *)rpm fuelLevel:(float)fuelLevel fuelLevel_State:(nullable SDLComponentVolumeStatus)fuelLevel_State instantFuelConsumption:(float)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(float)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin prndl:(nullable SDLPRNDL)prndl 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:(float)engineTorque accPedalPosition:(float)accPedalPosition steeringWheelAngle:(float)steeringWheelAngle engineOilLife:(float)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID 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;
+
+/**
The car current GPS coordinates
*/
@property (nullable, strong, nonatomic) SDLGPSData *gps;
@@ -122,6 +161,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nullable, strong, nonatomic) SDLWiperStatus wiperStatus;
/**
+ To indicate whether driver hands are off the steering wheel
+ */
+@property (strong, nonatomic, nullable) NSNumber<SDLBool> *handsOffSteering;
+
+/**
Status of the head lamps
*/
@property (nullable, strong, nonatomic) SDLHeadLampStatus *headLampStatus;
diff --git a/SmartDeviceLink/SDLGetVehicleDataResponse.m b/SmartDeviceLink/SDLGetVehicleDataResponse.m
index 25ddde3f4..7203cef32 100644
--- a/SmartDeviceLink/SDLGetVehicleDataResponse.m
+++ b/SmartDeviceLink/SDLGetVehicleDataResponse.m
@@ -27,12 +27,53 @@ NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (instancetype)init {
- if (self = [super initWithName:SDLRPCFunctionNameGetVehicleData]) {
+ self = [super initWithName:SDLRPCFunctionNameGetVehicleData];
+ if (!self) {
+ return nil;
}
return self;
}
#pragma clang diagnostic pop
+- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(float)speed rpm:(nullable NSNumber<SDLUInt> *)rpm fuelLevel:(float)fuelLevel fuelLevel_State:(nullable SDLComponentVolumeStatus)fuelLevel_State instantFuelConsumption:(float)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(float)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin prndl:(nullable SDLPRNDL)prndl 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:(float)engineTorque accPedalPosition:(float)accPedalPosition steeringWheelAngle:(float)steeringWheelAngle engineOilLife:(float)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID 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 {
+ self = [self init];
+ if (!self) {
+ return nil;
+ }
+ self.gps = gps;
+ self.speed = @(speed);
+ self.rpm = rpm;
+ self.fuelLevel = @(fuelLevel);
+ self.fuelLevel_State = fuelLevel_State;
+ self.instantFuelConsumption = @(instantFuelConsumption);
+ self.fuelRange = fuelRange;
+ self.externalTemperature = @(externalTemperature);
+ self.turnSignal = turnSignal;
+ self.vin = vin;
+ self.prndl = prndl;
+ self.tirePressure = tirePressure;
+ self.odometer = odometer;
+ self.beltStatus = beltStatus;
+ self.bodyInformation = bodyInformation;
+ self.deviceStatus = deviceStatus;
+ self.driverBraking = driverBraking;
+ self.wiperStatus = wiperStatus;
+ self.headLampStatus = headLampStatus;
+ self.engineTorque = @(engineTorque);
+ self.accPedalPosition = @(accPedalPosition);
+ self.steeringWheelAngle = @(steeringWheelAngle);
+ self.engineOilLife = @(engineOilLife);
+ self.electronicParkBrakeStatus = electronicParkBrakeStatus;
+ self.cloudAppVehicleID = cloudAppVehicleID;
+ self.eCallInfo = eCallInfo;
+ self.airbagStatus = airbagStatus;
+ self.emergencyEvent = emergencyEvent;
+ self.clusterModeStatus = clusterModeStatus;
+ self.myKey = myKey;
+ self.handsOffSteering = handsOffSteering;
+ return self;
+}
+
- (void)setGps:(nullable SDLGPSData *)gps {
[self.parameters sdl_setObject:gps forName:SDLRPCParameterNameGPS];
}
@@ -281,6 +322,15 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSObject.class error:nil];
}
+- (void)setHandsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering {
+ [self.parameters sdl_setObject:handsOffSteering forName:SDLRPCParameterNameHandsOffSteering];
+}
+
+- (nullable NSNumber<SDLBool> *)handsOffSteering {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameHandsOffSteering ofClass:NSNumber.class error:&error];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLOnVehicleData.h b/SmartDeviceLink/SDLOnVehicleData.h
index 815827cb3..80661c046 100644
--- a/SmartDeviceLink/SDLOnVehicleData.h
+++ b/SmartDeviceLink/SDLOnVehicleData.h
@@ -35,6 +35,43 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLOnVehicleData : SDLRPCNotification
/**
+ * Initializes an instance of the SDLOnVehicleData class
+ * @param gps - gps
+ * @param speed - @(speed)
+ * @param rpm - rpm
+ * @param fuelLevel - @(fuelLevel)
+ * @param fuelLevel_State - fuelLevel_State
+ * @param instantFuelConsumption - @(instantFuelConsumption)
+ * @param fuelRange - fuelRange
+ * @param externalTemperature - @(externalTemperature)
+ * @param turnSignal - turnSignal
+ * @param vin - vin
+ * @param prndl - prndl
+ * @param tirePressure - tirePressure
+ * @param odometer - odometer
+ * @param beltStatus - beltStatus
+ * @param bodyInformation - bodyInformation
+ * @param deviceStatus - deviceStatus
+ * @param driverBraking - driverBraking
+ * @param wiperStatus - wiperStatus
+ * @param headLampStatus - headLampStatus
+ * @param engineTorque - @(engineTorque)
+ * @param accPedalPosition - @(accPedalPosition)
+ * @param steeringWheelAngle - @(steeringWheelAngle)
+ * @param engineOilLife - @(engineOilLife)
+ * @param electronicParkBrakeStatus - electronicParkBrakeStatus
+ * @param cloudAppVehicleID - cloudAppVehicleID
+ * @param eCallInfo - eCallInfo
+ * @param airbagStatus - airbagStatus
+ * @param emergencyEvent - emergencyEvent
+ * @param clusterModeStatus - clusterModeStatus
+ * @param myKey - myKey
+ * @param handsOffSteering - handsOffSteering
+ * @return A SDLOnVehicleData object
+ */
+- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(float)speed rpm:(nullable NSNumber<SDLUInt> *)rpm fuelLevel:(float)fuelLevel fuelLevel_State:(nullable SDLComponentVolumeStatus)fuelLevel_State instantFuelConsumption:(float)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(float)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin prndl:(nullable SDLPRNDL)prndl 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:(float)engineTorque accPedalPosition:(float)accPedalPosition steeringWheelAngle:(float)steeringWheelAngle engineOilLife:(float)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID 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;
+
+/**
The car current GPS coordinates
*/
@property (nullable, strong, nonatomic) SDLGPSData *gps;
@@ -122,6 +159,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nullable, strong, nonatomic) SDLWiperStatus wiperStatus;
/**
+ To indicate whether driver hands are off the steering wheel
+ */
+@property (strong, nonatomic, nullable) NSNumber<SDLBool> *handsOffSteering;
+
+/**
Status of the head lamps
*/
@property (nullable, strong, nonatomic) SDLHeadLampStatus *headLampStatus;
diff --git a/SmartDeviceLink/SDLOnVehicleData.m b/SmartDeviceLink/SDLOnVehicleData.m
index 7c59dee34..be08a62a2 100644
--- a/SmartDeviceLink/SDLOnVehicleData.m
+++ b/SmartDeviceLink/SDLOnVehicleData.m
@@ -26,12 +26,53 @@ NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (instancetype)init {
- if (self = [super initWithName:SDLRPCFunctionNameOnVehicleData]) {
+ self = [super initWithName:SDLRPCFunctionNameOnVehicleData];
+ if (!self) {
+ return nil;
}
return self;
}
#pragma clang diagnostic pop
+- (instancetype)initWithGps:(nullable SDLGPSData *)gps speed:(float)speed rpm:(nullable NSNumber<SDLUInt> *)rpm fuelLevel:(float)fuelLevel fuelLevel_State:(nullable SDLComponentVolumeStatus)fuelLevel_State instantFuelConsumption:(float)instantFuelConsumption fuelRange:(nullable NSArray<SDLFuelRange *> *)fuelRange externalTemperature:(float)externalTemperature turnSignal:(nullable SDLTurnSignal)turnSignal vin:(nullable NSString *)vin prndl:(nullable SDLPRNDL)prndl 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:(float)engineTorque accPedalPosition:(float)accPedalPosition steeringWheelAngle:(float)steeringWheelAngle engineOilLife:(float)engineOilLife electronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSString *)cloudAppVehicleID 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 {
+ self = [self init];
+ if (!self) {
+ return nil;
+ }
+ self.gps = gps;
+ self.speed = @(speed);
+ self.rpm = rpm;
+ self.fuelLevel = @(fuelLevel);
+ self.fuelLevel_State = fuelLevel_State;
+ self.instantFuelConsumption = @(instantFuelConsumption);
+ self.fuelRange = fuelRange;
+ self.externalTemperature = @(externalTemperature);
+ self.turnSignal = turnSignal;
+ self.vin = vin;
+ self.prndl = prndl;
+ self.tirePressure = tirePressure;
+ self.odometer = odometer;
+ self.beltStatus = beltStatus;
+ self.bodyInformation = bodyInformation;
+ self.deviceStatus = deviceStatus;
+ self.driverBraking = driverBraking;
+ self.wiperStatus = wiperStatus;
+ self.headLampStatus = headLampStatus;
+ self.engineTorque = @(engineTorque);
+ self.accPedalPosition = @(accPedalPosition);
+ self.steeringWheelAngle = @(steeringWheelAngle);
+ self.engineOilLife = @(engineOilLife);
+ self.electronicParkBrakeStatus = electronicParkBrakeStatus;
+ self.cloudAppVehicleID = cloudAppVehicleID;
+ self.eCallInfo = eCallInfo;
+ self.airbagStatus = airbagStatus;
+ self.emergencyEvent = emergencyEvent;
+ self.clusterModeStatus = clusterModeStatus;
+ self.myKey = myKey;
+ self.handsOffSteering = handsOffSteering;
+ return self;
+}
+
- (void)setGps:(nullable SDLGPSData *)gps {
[self.parameters sdl_setObject:gps forName:SDLRPCParameterNameGPS];
}
@@ -280,6 +321,15 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSObject.class error:nil];
}
+- (void)setHandsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering {
+ [self.parameters sdl_setObject:handsOffSteering forName:SDLRPCParameterNameHandsOffSteering];
+}
+
+- (nullable NSNumber<SDLBool> *)handsOffSteering {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameHandsOffSteering ofClass:NSNumber.class error:&error];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h
index ecf2e57ca..ef2f00be9 100644
--- a/SmartDeviceLink/SDLRPCParameterNames.h
+++ b/SmartDeviceLink/SDLRPCParameterNames.h
@@ -1,5 +1,35 @@
+/*
+ * 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.
+ */
// SDLRPCParameterNames.h
-//
#import <Foundation/Foundation.h>
#import "SDLMacros.h"
@@ -231,6 +261,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameGraphicSupported;
extern SDLRPCParameterName const SDLRPCParameterNameGreen;
extern SDLRPCParameterName const SDLRPCParameterNameGrid;
extern SDLRPCParameterName const SDLRPCParameterNameHandledRPCs;
+extern SDLRPCParameterName const SDLRPCParameterNameHandsOffSteering;
extern SDLRPCParameterName const SDLRPCParameterNameHapticRectData;
extern SDLRPCParameterName const SDLRPCParameterNameHapticSpatialDataSupported;
extern SDLRPCParameterName const SDLRPCParameterNameHardware;
diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m
index e05a91e9e..671436c4c 100644
--- a/SmartDeviceLink/SDLRPCParameterNames.m
+++ b/SmartDeviceLink/SDLRPCParameterNames.m
@@ -1,5 +1,35 @@
+/*
+ * 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.
+ */
// SDLRPCParameterNames.h
-//
#import "NSMutableDictionary+Store.h"
#import "SDLRPCParameterNames.h"
@@ -227,6 +257,7 @@ SDLRPCParameterName const SDLRPCParameterNameGraphicSupported = @"graphicSupport
SDLRPCParameterName const SDLRPCParameterNameGreen = @"green";
SDLRPCParameterName const SDLRPCParameterNameGrid = @"grid";
SDLRPCParameterName const SDLRPCParameterNameHandledRPCs = @"handledRPCs";
+SDLRPCParameterName const SDLRPCParameterNameHandsOffSteering = @"handsOffSteering";
SDLRPCParameterName const SDLRPCParameterNameHapticRectData = @"hapticRectData";
SDLRPCParameterName const SDLRPCParameterNameHapticSpatialDataSupported = @"hapticSpatialDataSupported";
SDLRPCParameterName const SDLRPCParameterNameHardware = @"hardware";
diff --git a/SmartDeviceLink/SDLSubscribeVehicleData.h b/SmartDeviceLink/SDLSubscribeVehicleData.h
index d0e6d4629..a3db1c1de 100644
--- a/SmartDeviceLink/SDLSubscribeVehicleData.h
+++ b/SmartDeviceLink/SDLSubscribeVehicleData.h
@@ -48,7 +48,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 clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus: instead");
+- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
/**
* Convenience init for subscribing to all possible vehicle data items.
@@ -83,7 +83,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 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 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: instead");
+- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation 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:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
/**
* Convenience init for subscribing to all possible vehicle data items.
@@ -119,7 +119,44 @@ 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;
+- (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:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
+
+/**
+ * Convenience init for subscribing to all possible vehicle data items.
+ *
+ * @param gps - gps
+ * @param speed - speed
+ * @param rpm - rpm
+ * @param fuelLevel - fuelLevel
+ * @param fuelLevel_State - fuelLevel_State
+ * @param instantFuelConsumption - instantFuelConsumption
+ * @param fuelRange - fuelRange
+ * @param externalTemperature - externalTemperature
+ * @param turnSignal - turnSignal
+ * @param prndl - prndl
+ * @param tirePressure - tirePressure
+ * @param odometer - odometer
+ * @param beltStatus - beltStatus
+ * @param bodyInformation - bodyInformation
+ * @param deviceStatus - deviceStatus
+ * @param driverBraking - driverBraking
+ * @param wiperStatus - wiperStatus
+ * @param headLampStatus - headLampStatus
+ * @param engineTorque - engineTorque
+ * @param accPedalPosition - accPedalPosition
+ * @param steeringWheelAngle - steeringWheelAngle
+ * @param engineOilLife - engineOilLife
+ * @param electronicParkBrakeStatus - electronicParkBrakeStatus
+ * @param cloudAppVehicleID - cloudAppVehicleID
+ * @param eCallInfo - eCallInfo
+ * @param airbagStatus - airbagStatus
+ * @param emergencyEvent - emergencyEvent
+ * @param clusterModeStatus - clusterModeStatus
+ * @param myKey - myKey
+ * @param handsOffSteering - handsOffSteering
+ * @return A SDLSubscribeVehicleData object
+ */
+- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm fuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel fuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal prndl:(nullable NSNumber<SDLBool> *)prndl 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 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;
/**
* A boolean value. If true, subscribes GPS data.
@@ -202,6 +239,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, nullable) NSNumber<SDLBool> *wiperStatus;
/**
+ * To indicate whether driver hands are off the steering wheel
+ */
+@property (strong, nonatomic, nullable) NSNumber<SDLBool> *handsOffSteering;
+
+/**
* A boolean value. If true, subscribes Head Lamp Status data.
*/
@property (strong, nonatomic, nullable) NSNumber<SDLBool> *headLampStatus;
@@ -268,7 +310,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Sets the OEM custom vehicle data state for any given OEM custom vehicle data name.
-
+
@param vehicleDataName The name of the OEM custom vehicle data item.
@param vehicleDataState A boolean value. If true, requests the OEM custom vehicle data item.
diff --git a/SmartDeviceLink/SDLSubscribeVehicleData.m b/SmartDeviceLink/SDLSubscribeVehicleData.m
index a5bd22070..5f3ad421d 100644
--- a/SmartDeviceLink/SDLSubscribeVehicleData.m
+++ b/SmartDeviceLink/SDLSubscribeVehicleData.m
@@ -15,56 +15,61 @@ NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (instancetype)init {
- if (self = [super initWithName:SDLRPCFunctionNameSubscribeVehicleData]) {
+ self = [super initWithName:SDLRPCFunctionNameSubscribeVehicleData];
+ if (!self) {
+ return nil;
}
return self;
}
#pragma clang diagnostic pop
- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 wiperStatus:(BOOL)wiperStatus {
- return [self initWithAccelerationPedalPosition:accelerationPedalPosition airbagStatus:airbagStatus beltStatus:beltStatus bodyInformation:bodyInformation clusterModeStatus:clusterModeStatus deviceStatus:deviceStatus driverBraking:driverBraking eCallInfo:eCallInfo electronicParkBrakeStatus:NO emergencyEvent:emergencyEvent engineOilLife:NO engineTorque:engineTorque externalTemperature:externalTemperature fuelLevel:fuelLevel fuelLevelState:fuelLevelState fuelRange:NO gps:gps headLampStatus:headLampStatus instantFuelConsumption:instantFuelConsumption myKey:myKey odometer:odometer prndl:prndl rpm:rpm speed:speed steeringWheelAngle:steeringWheelAngle tirePressure:tirePressure turnSignal:NO wiperStatus:wiperStatus];
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(NO) externalTemperature:@(externalTemperature) turnSignal:@(NO) prndl:@(prndl) tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accelerationPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(NO) electronicParkBrakeStatus:@(NO) cloudAppVehicleID:@(NO) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
}
- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation 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 {
- return [self initWithAccelerationPedalPosition:accelerationPedalPosition airbagStatus:airbagStatus beltStatus:beltStatus bodyInformation:bodyInformation cloudAppVehicleID:NO clusterModeStatus:clusterModeStatus deviceStatus:deviceStatus driverBraking:driverBraking eCallInfo:eCallInfo electronicParkBrakeStatus:electronicParkBrakeStatus emergencyEvent:emergencyEvent engineOilLife:engineOilLife engineTorque:engineTorque externalTemperature:externalTemperature fuelLevel:fuelLevel fuelLevelState:fuelLevelState fuelRange:fuelRange gps:gps headLampStatus:headLampStatus instantFuelConsumption:instantFuelConsumption myKey:myKey odometer:odometer prndl:prndl rpm:rpm speed:speed steeringWheelAngle:steeringWheelAngle tirePressure:tirePressure turnSignal:turnSignal wiperStatus:wiperStatus];
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) prndl:@(prndl) 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:@(NO) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
}
- (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 {
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) prndl:@(prndl) 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) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
+}
+
+- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm fuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel fuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal prndl:(nullable NSNumber<SDLBool> *)prndl 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 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 {
self = [self init];
if (!self) {
return nil;
}
-
- self.accPedalPosition = @(accelerationPedalPosition);
- self.airbagStatus = @(airbagStatus);
- self.beltStatus = @(beltStatus);
- self.bodyInformation = @(bodyInformation);
- self.cloudAppVehicleID = @(cloudAppVehicleID);
- self.clusterModeStatus = @(clusterModeStatus);
- self.deviceStatus = @(deviceStatus);
- self.driverBraking = @(driverBraking);
- self.eCallInfo = @(eCallInfo);
- self.electronicParkBrakeStatus = @(electronicParkBrakeStatus);
- self.emergencyEvent = @(emergencyEvent);
- self.engineOilLife = @(engineOilLife);
- self.engineTorque = @(engineTorque);
- self.externalTemperature = @(externalTemperature);
- self.fuelLevel = @(fuelLevel);
- self.fuelLevel_State = @(fuelLevelState);
- self.fuelRange = @(fuelRange);
- self.myKey = @(myKey);
- self.odometer = @(odometer);
- self.gps = @(gps);
- self.headLampStatus = @(headLampStatus);
- self.instantFuelConsumption = @(instantFuelConsumption);
- self.prndl = @(prndl);
- self.rpm = @(rpm);
- self.speed = @(speed);
- self.steeringWheelAngle = @(steeringWheelAngle);
- self.tirePressure = @(tirePressure);
- self.turnSignal = @(turnSignal);
- self.wiperStatus = @(wiperStatus);
-
+ self.gps = gps;
+ self.speed = speed;
+ self.rpm = rpm;
+ self.fuelLevel = fuelLevel;
+ self.fuelLevel_State = fuelLevel_State;
+ self.instantFuelConsumption = instantFuelConsumption;
+ self.fuelRange = fuelRange;
+ self.externalTemperature = externalTemperature;
+ self.turnSignal = turnSignal;
+ self.prndl = prndl;
+ self.tirePressure = tirePressure;
+ self.odometer = odometer;
+ self.beltStatus = beltStatus;
+ self.bodyInformation = bodyInformation;
+ self.deviceStatus = deviceStatus;
+ self.driverBraking = driverBraking;
+ self.wiperStatus = wiperStatus;
+ self.headLampStatus = headLampStatus;
+ self.engineTorque = engineTorque;
+ self.accPedalPosition = accPedalPosition;
+ self.steeringWheelAngle = steeringWheelAngle;
+ self.engineOilLife = engineOilLife;
+ self.electronicParkBrakeStatus = electronicParkBrakeStatus;
+ self.cloudAppVehicleID = cloudAppVehicleID;
+ self.eCallInfo = eCallInfo;
+ self.airbagStatus = airbagStatus;
+ self.emergencyEvent = emergencyEvent;
+ self.clusterModeStatus = clusterModeStatus;
+ self.myKey = myKey;
+ self.handsOffSteering = handsOffSteering;
return self;
}
@@ -308,6 +313,15 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:nil];
}
+- (void)setHandsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering {
+ [self.parameters sdl_setObject:handsOffSteering forName:SDLRPCParameterNameHandsOffSteering];
+}
+
+- (nullable NSNumber<SDLBool> *)handsOffSteering {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameHandsOffSteering ofClass:NSNumber.class error:&error];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.h b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.h
index 3f4386499..0f6d9e0e4 100644
--- a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.h
+++ b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.h
@@ -17,6 +17,43 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLSubscribeVehicleDataResponse : SDLRPCResponse
/**
+ * Convenience initializer, initializes a new allocated object of the class SDLSubscribeVehicleDataResponse
+ *
+ * @param gps - gps
+ * @param speed - speed
+ * @param rpm - rpm
+ * @param fuelLevel - fuelLevel
+ * @param fuelLevel_State - fuelLevel_State
+ * @param instantFuelConsumption - instantFuelConsumption
+ * @param fuelRange - fuelRange
+ * @param externalTemperature - externalTemperature
+ * @param turnSignal - turnSignal
+ * @param prndl - prndl
+ * @param tirePressure - tirePressure
+ * @param odometer - odometer
+ * @param beltStatus - beltStatus
+ * @param bodyInformation - bodyInformation
+ * @param deviceStatus - deviceStatus
+ * @param driverBraking - driverBraking
+ * @param wiperStatus - wiperStatus
+ * @param headLampStatus - headLampStatus
+ * @param engineTorque - engineTorque
+ * @param accPedalPosition - accPedalPosition
+ * @param steeringWheelAngle - steeringWheelAngle
+ * @param engineOilLife - engineOilLife
+ * @param electronicParkBrakeStatus - electronicParkBrakeStatus
+ * @param cloudAppVehicleID - cloudAppVehicleID
+ * @param eCallInfo - eCallInfo
+ * @param airbagStatus - airbagStatus
+ * @param emergencyEvent - emergencyEvent
+ * @param clusterModes - clusterModes
+ * @param myKey - myKey
+ * @param handsOffSteering - handsOffSteering
+ * @return A SDLSubscribeVehicleDataResponse object
+ */
+- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm fuelLevel:(nullable SDLVehicleDataResult *)fuelLevel fuelLevel_State:(nullable SDLVehicleDataResult *)fuelLevel_State instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal prndl:(nullable SDLVehicleDataResult *)prndl 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 eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering;
+
+/**
The result of requesting to subscribe to the GPSData.
Optional
@@ -129,6 +166,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, nullable) SDLVehicleDataResult *wiperStatus;
/**
+ To indicate whether driver hands are off the steering wheel
+ */
+@property (strong, nonatomic, nullable) SDLVehicleDataResult *handsOffSteering;
+
+/**
The result of requesting to subscribe to the status of the head lamps.
Optional
@@ -221,7 +263,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Sets the OEM custom vehicle data state for any given OEM custom vehicle data name.
-
+
@param vehicleDataName The name of the OEM custom vehicle data item.
@param vehicleDataState SDLVehicleDataResult object containing custom data type and result code information.
diff --git a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m
index 7ab6b4e63..6e73fe0c7 100644
--- a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m
+++ b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m
@@ -16,12 +16,52 @@ NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (instancetype)init {
- if (self = [super initWithName:SDLRPCFunctionNameSubscribeVehicleData]) {
+ self = [super initWithName:SDLRPCFunctionNameSubscribeVehicleData];
+ if (!self) {
+ return nil;
}
return self;
}
#pragma clang diagnostic pop
+- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm fuelLevel:(nullable SDLVehicleDataResult *)fuelLevel fuelLevel_State:(nullable SDLVehicleDataResult *)fuelLevel_State instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal prndl:(nullable SDLVehicleDataResult *)prndl 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 eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering {
+ self = [self init];
+ if (!self) {
+ return nil;
+ }
+ self.gps = gps;
+ self.speed = speed;
+ self.rpm = rpm;
+ self.fuelLevel = fuelLevel;
+ self.fuelLevel_State = fuelLevel_State;
+ self.instantFuelConsumption = instantFuelConsumption;
+ self.fuelRange = fuelRange;
+ self.externalTemperature = externalTemperature;
+ self.turnSignal = turnSignal;
+ self.prndl = prndl;
+ self.tirePressure = tirePressure;
+ self.odometer = odometer;
+ self.beltStatus = beltStatus;
+ self.bodyInformation = bodyInformation;
+ self.deviceStatus = deviceStatus;
+ self.driverBraking = driverBraking;
+ self.wiperStatus = wiperStatus;
+ self.headLampStatus = headLampStatus;
+ self.engineTorque = engineTorque;
+ self.accPedalPosition = accPedalPosition;
+ self.steeringWheelAngle = steeringWheelAngle;
+ self.engineOilLife = engineOilLife;
+ self.electronicParkBrakeStatus = electronicParkBrakeStatus;
+ self.cloudAppVehicleID = cloudAppVehicleID;
+ self.eCallInfo = eCallInfo;
+ self.airbagStatus = airbagStatus;
+ self.emergencyEvent = emergencyEvent;
+ self.clusterModes = clusterModes;
+ self.myKey = myKey;
+ self.handsOffSteering = handsOffSteering;
+ return self;
+}
+
- (void)setGps:(nullable SDLVehicleDataResult *)gps {
[self.parameters sdl_setObject:gps forName:SDLRPCParameterNameGPS];
}
@@ -262,6 +302,15 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectForName:vehicleDataName ofClass:SDLVehicleDataResult.class error:nil];
}
+- (void)setHandsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering {
+ [self.parameters sdl_setObject:handsOffSteering forName:SDLRPCParameterNameHandsOffSteering];
+}
+
+- (nullable SDLVehicleDataResult *)handsOffSteering {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameHandsOffSteering ofClass:SDLVehicleDataResult.class error:&error];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.h b/SmartDeviceLink/SDLUnsubscribeVehicleData.h
index 370f34882..b87ac7da6 100644
--- a/SmartDeviceLink/SDLUnsubscribeVehicleData.h
+++ b/SmartDeviceLink/SDLUnsubscribeVehicleData.h
@@ -50,7 +50,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 clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus: instead");
+- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
/**
* Convenience init for unsubscribing to all possible vehicle data items.
@@ -85,7 +85,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 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 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: instead");
+- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation 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:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
/**
* Convenience init for unsubscribing to all possible vehicle data items.
@@ -121,7 +121,44 @@ 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;
+- (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:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering: instead");
+
+/**
+ * Convenience init for unsubscribing to all possible vehicle data items.
+ *
+ * @param gps - gps
+ * @param speed - speed
+ * @param rpm - rpm
+ * @param fuelLevel - fuelLevel
+ * @param fuelLevel_State - fuelLevel_State
+ * @param instantFuelConsumption - instantFuelConsumption
+ * @param fuelRange - fuelRange
+ * @param externalTemperature - externalTemperature
+ * @param turnSignal - turnSignal
+ * @param prndl - prndl
+ * @param tirePressure - tirePressure
+ * @param odometer - odometer
+ * @param beltStatus - beltStatus
+ * @param bodyInformation - bodyInformation
+ * @param deviceStatus - deviceStatus
+ * @param driverBraking - driverBraking
+ * @param wiperStatus - wiperStatus
+ * @param headLampStatus - headLampStatus
+ * @param engineTorque - engineTorque
+ * @param accPedalPosition - accPedalPosition
+ * @param steeringWheelAngle - steeringWheelAngle
+ * @param engineOilLife - engineOilLife
+ * @param electronicParkBrakeStatus - electronicParkBrakeStatus
+ * @param cloudAppVehicleID - cloudAppVehicleID
+ * @param eCallInfo - eCallInfo
+ * @param airbagStatus - airbagStatus
+ * @param emergencyEvent - emergencyEvent
+ * @param clusterModeStatus - clusterModeStatus
+ * @param myKey - myKey
+ * @param handsOffSteering - handsOffSteering
+ * @return A SDLUnsubscribeVehicleData object
+ */
+- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm fuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel fuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal prndl:(nullable NSNumber<SDLBool> *)prndl 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 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;
/**
* If true, unsubscribes from GPS
@@ -204,6 +241,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, nullable) NSNumber<SDLBool> *wiperStatus;
/**
+ * To indicate whether driver hands are off the steering wheel
+ */
+@property (strong, nonatomic, nullable) NSNumber<SDLBool> *handsOffSteering;
+
+/**
* If true, unsubscribes from Head Lamp Status
*/
@property (strong, nonatomic, nullable) NSNumber<SDLBool> *headLampStatus;
diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.m b/SmartDeviceLink/SDLUnsubscribeVehicleData.m
index e83148be0..e4f40bbc2 100644
--- a/SmartDeviceLink/SDLUnsubscribeVehicleData.m
+++ b/SmartDeviceLink/SDLUnsubscribeVehicleData.m
@@ -15,56 +15,62 @@ NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (instancetype)init {
- if (self = [super initWithName:SDLRPCFunctionNameUnsubscribeVehicleData]) {
+ self = [super initWithName:SDLRPCFunctionNameUnsubscribeVehicleData];
+ if (!self) {
+ return nil;
}
return self;
}
#pragma clang diagnostic pop
- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState 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 wiperStatus:(BOOL)wiperStatus {
- return [self initWithAccelerationPedalPosition:accelerationPedalPosition airbagStatus:airbagStatus beltStatus:beltStatus bodyInformation:bodyInformation clusterModeStatus:clusterModeStatus deviceStatus:deviceStatus driverBraking:driverBraking eCallInfo:eCallInfo electronicParkBrakeStatus:NO emergencyEvent:emergencyEvent engineOilLife:NO engineTorque:engineTorque externalTemperature:externalTemperature fuelLevel:fuelLevel fuelLevelState:fuelLevelState fuelRange:NO gps:gps headLampStatus:headLampStatus instantFuelConsumption:instantFuelConsumption myKey:myKey odometer:odometer prndl:prndl rpm:rpm speed:speed steeringWheelAngle:steeringWheelAngle tirePressure:tirePressure turnSignal:NO wiperStatus:wiperStatus];
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(NO) externalTemperature:@(externalTemperature) turnSignal:@(NO) prndl:@(prndl) tirePressure:@(tirePressure) odometer:@(odometer) beltStatus:@(beltStatus) bodyInformation:@(bodyInformation) deviceStatus:@(deviceStatus) driverBraking:@(driverBraking) wiperStatus:@(wiperStatus) headLampStatus:@(headLampStatus) engineTorque:@(engineTorque) accPedalPosition:@(accelerationPedalPosition) steeringWheelAngle:@(steeringWheelAngle) engineOilLife:@(NO) electronicParkBrakeStatus:@(NO) cloudAppVehicleID:@(NO) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
}
- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation 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 {
- return [self initWithAccelerationPedalPosition:accelerationPedalPosition airbagStatus:airbagStatus beltStatus:beltStatus bodyInformation:bodyInformation cloudAppVehicleID:NO clusterModeStatus:clusterModeStatus deviceStatus:deviceStatus driverBraking:driverBraking eCallInfo:eCallInfo electronicParkBrakeStatus:electronicParkBrakeStatus emergencyEvent:emergencyEvent engineOilLife:engineOilLife engineTorque:engineTorque externalTemperature:externalTemperature fuelLevel:fuelLevel fuelLevelState:fuelLevelState fuelRange:fuelRange gps:gps headLampStatus:headLampStatus instantFuelConsumption:instantFuelConsumption myKey:myKey odometer:odometer prndl:prndl rpm:rpm speed:speed steeringWheelAngle:steeringWheelAngle tirePressure:tirePressure turnSignal:turnSignal wiperStatus:wiperStatus];
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) prndl:@(prndl) 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:@(NO) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
}
- (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 {
+ return [self initWithGps:@(gps) speed:@(speed) rpm:@(rpm) fuelLevel:@(fuelLevel) fuelLevel_State:@(fuelLevelState) instantFuelConsumption:@(instantFuelConsumption) fuelRange:@(fuelRange) externalTemperature:@(externalTemperature) turnSignal:@(turnSignal) prndl:@(prndl) 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) eCallInfo:@(eCallInfo) airbagStatus:@(airbagStatus) emergencyEvent:@(emergencyEvent) clusterModeStatus:@(clusterModeStatus) myKey:@(myKey) handsOffSteering:@(NO)];
+
+}
+
+- (instancetype)initWithGps:(nullable NSNumber<SDLBool> *)gps speed:(nullable NSNumber<SDLBool> *)speed rpm:(nullable NSNumber<SDLBool> *)rpm fuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel fuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State instantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption fuelRange:(nullable NSNumber<SDLBool> *)fuelRange externalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature turnSignal:(nullable NSNumber<SDLBool> *)turnSignal prndl:(nullable NSNumber<SDLBool> *)prndl 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 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 {
self = [self init];
if (!self) {
return nil;
}
-
- self.accPedalPosition = @(accelerationPedalPosition);
- self.airbagStatus = @(airbagStatus);
- self.beltStatus = @(beltStatus);
- self.bodyInformation = @(bodyInformation);
- self.cloudAppVehicleID = @(cloudAppVehicleID);
- self.clusterModeStatus = @(clusterModeStatus);
- self.deviceStatus = @(deviceStatus);
- self.driverBraking = @(driverBraking);
- self.eCallInfo = @(eCallInfo);
- self.electronicParkBrakeStatus = @(electronicParkBrakeStatus);
- self.emergencyEvent = @(emergencyEvent);
- self.engineOilLife = @(engineOilLife);
- self.engineTorque = @(engineTorque);
- self.externalTemperature = @(externalTemperature);
- self.fuelLevel = @(fuelLevel);
- self.fuelLevel_State = @(fuelLevelState);
- self.fuelRange = @(fuelRange);
- self.myKey = @(myKey);
- self.odometer = @(odometer);
- self.gps = @(gps);
- self.headLampStatus = @(headLampStatus);
- self.instantFuelConsumption = @(instantFuelConsumption);
- self.prndl = @(prndl);
- self.rpm = @(rpm);
- self.speed = @(speed);
- self.steeringWheelAngle = @(steeringWheelAngle);
- self.tirePressure = @(tirePressure);
- self.turnSignal = @(turnSignal);
- self.wiperStatus = @(wiperStatus);
-
+ self.gps = gps;
+ self.speed = speed;
+ self.rpm = rpm;
+ self.fuelLevel = fuelLevel;
+ self.fuelLevel_State = fuelLevel_State;
+ self.instantFuelConsumption = instantFuelConsumption;
+ self.fuelRange = fuelRange;
+ self.externalTemperature = externalTemperature;
+ self.turnSignal = turnSignal;
+ self.prndl = prndl;
+ self.tirePressure = tirePressure;
+ self.odometer = odometer;
+ self.beltStatus = beltStatus;
+ self.bodyInformation = bodyInformation;
+ self.deviceStatus = deviceStatus;
+ self.driverBraking = driverBraking;
+ self.wiperStatus = wiperStatus;
+ self.headLampStatus = headLampStatus;
+ self.engineTorque = engineTorque;
+ self.accPedalPosition = accPedalPosition;
+ self.steeringWheelAngle = steeringWheelAngle;
+ self.engineOilLife = engineOilLife;
+ self.electronicParkBrakeStatus = electronicParkBrakeStatus;
+ self.cloudAppVehicleID = cloudAppVehicleID;
+ self.eCallInfo = eCallInfo;
+ self.airbagStatus = airbagStatus;
+ self.emergencyEvent = emergencyEvent;
+ self.clusterModeStatus = clusterModeStatus;
+ self.myKey = myKey;
+ self.handsOffSteering = handsOffSteering;
return self;
}
@@ -308,6 +314,15 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:nil];
}
+- (void)setHandsOffSteering:(nullable NSNumber<SDLBool> *)handsOffSteering {
+ [self.parameters sdl_setObject:handsOffSteering forName:SDLRPCParameterNameHandsOffSteering];
+}
+
+- (nullable NSNumber<SDLBool> *)handsOffSteering {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameHandsOffSteering ofClass:NSNumber.class error:&error];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h
index da07d6616..fb355316d 100644
--- a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h
+++ b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h
@@ -16,6 +16,43 @@ NS_ASSUME_NONNULL_BEGIN
@interface SDLUnsubscribeVehicleDataResponse : SDLRPCResponse
/**
+ * Convenience initializer, initializes a new allocated object of the class SDLUnsubscribeVehicleDataResponse
+ *
+ * @param gps - gps
+ * @param speed - speed
+ * @param rpm - rpm
+ * @param fuelLevel - fuelLevel
+ * @param fuelLevel_State - fuelLevel_State
+ * @param instantFuelConsumption - instantFuelConsumption
+ * @param fuelRange - fuelRange
+ * @param externalTemperature - externalTemperature
+ * @param turnSignal - turnSignal
+ * @param prndl - prndl
+ * @param tirePressure - tirePressure
+ * @param odometer - odometer
+ * @param beltStatus - beltStatus
+ * @param bodyInformation - bodyInformation
+ * @param deviceStatus - deviceStatus
+ * @param driverBraking - driverBraking
+ * @param wiperStatus - wiperStatus
+ * @param headLampStatus - headLampStatus
+ * @param engineTorque - engineTorque
+ * @param accPedalPosition - accPedalPosition
+ * @param steeringWheelAngle - steeringWheelAngle
+ * @param engineOilLife - engineOilLife
+ * @param electronicParkBrakeStatus - electronicParkBrakeStatus
+ * @param cloudAppVehicleID - cloudAppVehicleID
+ * @param eCallInfo - eCallInfo
+ * @param airbagStatus - airbagStatus
+ * @param emergencyEvent - emergencyEvent
+ * @param clusterModes - clusterModes
+ * @param myKey - myKey
+ * @param handsOffSteering - handsOffSteering
+ * @return A SDLUnsubscribeVehicleDataResponse object
+ */
+- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm fuelLevel:(nullable SDLVehicleDataResult *)fuelLevel fuelLevel_State:(nullable SDLVehicleDataResult *)fuelLevel_State instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal prndl:(nullable SDLVehicleDataResult *)prndl 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 eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering;
+
+/**
The result of requesting to unsubscribe to the GPSData.
Optional
@@ -128,6 +165,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, nullable) SDLVehicleDataResult *wiperStatus;
/**
+ The result of requesting to unsubscribe from the status of driver hands are off the steering wheel
+ */
+@property (nullable, strong, nonatomic) SDLVehicleDataResult *handsOffSteering;
+
+/**
The result of requesting to unsubscribe to the status of the head lamps.
Optional
@@ -220,7 +262,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Sets the OEM custom vehicle data state for any given OEM custom vehicle data name.
-
+
@param vehicleDataName The name of the OEM custom vehicle data item.
@param vehicleDataState SDLVehicleDataResult object containing custom data type and result code information.
diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m
index b86423085..dcca4a34b 100644
--- a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m
+++ b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m
@@ -16,12 +16,52 @@ NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (instancetype)init {
- if (self = [super initWithName:SDLRPCFunctionNameUnsubscribeVehicleData]) {
+ self = [super initWithName:SDLRPCFunctionNameUnsubscribeVehicleData];
+ if (!self) {
+ return nil;
}
return self;
}
#pragma clang diagnostic pop
+- (instancetype)initWithGps:(nullable SDLVehicleDataResult *)gps speed:(nullable SDLVehicleDataResult *)speed rpm:(nullable SDLVehicleDataResult *)rpm fuelLevel:(nullable SDLVehicleDataResult *)fuelLevel fuelLevel_State:(nullable SDLVehicleDataResult *)fuelLevel_State instantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption fuelRange:(nullable SDLVehicleDataResult *)fuelRange externalTemperature:(nullable SDLVehicleDataResult *)externalTemperature turnSignal:(nullable SDLVehicleDataResult *)turnSignal prndl:(nullable SDLVehicleDataResult *)prndl 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 eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey handsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering {
+ self = [self init];
+ if (!self) {
+ return nil;
+ }
+ self.gps = gps;
+ self.speed = speed;
+ self.rpm = rpm;
+ self.fuelLevel = fuelLevel;
+ self.fuelLevel_State = fuelLevel_State;
+ self.instantFuelConsumption = instantFuelConsumption;
+ self.fuelRange = fuelRange;
+ self.externalTemperature = externalTemperature;
+ self.turnSignal = turnSignal;
+ self.prndl = prndl;
+ self.tirePressure = tirePressure;
+ self.odometer = odometer;
+ self.beltStatus = beltStatus;
+ self.bodyInformation = bodyInformation;
+ self.deviceStatus = deviceStatus;
+ self.driverBraking = driverBraking;
+ self.wiperStatus = wiperStatus;
+ self.headLampStatus = headLampStatus;
+ self.engineTorque = engineTorque;
+ self.accPedalPosition = accPedalPosition;
+ self.steeringWheelAngle = steeringWheelAngle;
+ self.engineOilLife = engineOilLife;
+ self.electronicParkBrakeStatus = electronicParkBrakeStatus;
+ self.cloudAppVehicleID = cloudAppVehicleID;
+ self.eCallInfo = eCallInfo;
+ self.airbagStatus = airbagStatus;
+ self.emergencyEvent = emergencyEvent;
+ self.clusterModes = clusterModes;
+ self.myKey = myKey;
+ self.handsOffSteering = handsOffSteering;
+ return self;
+}
+
- (void)setGps:(nullable SDLVehicleDataResult *)gps {
[self.parameters sdl_setObject:gps forName:SDLRPCParameterNameGPS];
}
@@ -262,6 +302,15 @@ NS_ASSUME_NONNULL_BEGIN
return [self.parameters sdl_objectForName:vehicleDataName ofClass:SDLVehicleDataResult.class error:nil];
}
+- (void)setHandsOffSteering:(nullable SDLVehicleDataResult *)handsOffSteering {
+ [self.parameters sdl_setObject:handsOffSteering forName:SDLRPCParameterNameHandsOffSteering];
+}
+
+- (nullable SDLVehicleDataResult *)handsOffSteering {
+ NSError *error = nil;
+ return [self.parameters sdl_objectForName:SDLRPCParameterNameHandsOffSteering ofClass:SDLVehicleDataResult.class error:&error];
+}
+
@end
NS_ASSUME_NONNULL_END
diff --git a/SmartDeviceLink/SDLVehicleDataType.h b/SmartDeviceLink/SDLVehicleDataType.h
index e65cdcef9..ca30728f7 100644
--- a/SmartDeviceLink/SDLVehicleDataType.h
+++ b/SmartDeviceLink/SDLVehicleDataType.h
@@ -120,6 +120,12 @@ extern SDLVehicleDataType const SDLVehicleDataTypeBraking;
extern SDLVehicleDataType const SDLVehicleDataTypeWiperStatus;
/**
+ To indicate whether driver hands are off the steering wheel
+ Added in SDL 7.0.0
+ */
+extern SDLVehicleDataType const SDLVehicleDataTypeHandsOffSteering;
+
+/**
Vehicle headlamp status
*/
extern SDLVehicleDataType const SDLVehicleDataTypeHeadlampStatus;
diff --git a/SmartDeviceLink/SDLVehicleDataType.m b/SmartDeviceLink/SDLVehicleDataType.m
index 895613873..a9436587e 100644
--- a/SmartDeviceLink/SDLVehicleDataType.m
+++ b/SmartDeviceLink/SDLVehicleDataType.m
@@ -36,4 +36,4 @@ SDLVehicleDataType const SDLVehicleDataTypeElectronicParkBrakeStatus = @"VEHICLE
SDLVehicleDataType const SDLVehicleDataTypeTurnSignal = @"VEHICLEDATA_TURNSIGNAL";
SDLVehicleDataType const SDLVehicleDataTypeCloudAppVehicleID = @"VEHICLEDATA_CLOUDAPPVEHICLEID";
SDLVehicleDataType const SDLVehicleDataTypeOEMVehicleDataType = @"VEHICLEDATA_OEM_CUSTOM_DATA";
-
+SDLVehicleDataType const SDLVehicleDataTypeHandsOffSteering = @"VEHICLEDATA_HANDSOFFSTEERING";
diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m
index 16f87d613..25936ebed 100644
--- a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m
@@ -45,6 +45,7 @@ describe(@"Individual Enum Value Tests", ^ {
expect(SDLVehicleDataTypeElectronicParkBrakeStatus).to(equal(@"VEHICLEDATA_ELECTRONICPARKBRAKESTATUS"));
expect(SDLVehicleDataTypeTurnSignal).to(equal(@"VEHICLEDATA_TURNSIGNAL"));
expect(SDLVehicleDataTypeCloudAppVehicleID).to(equal(@"VEHICLEDATA_CLOUDAPPVEHICLEID"));
+ expect(SDLVehicleDataTypeHandsOffSteering).to(equal(@"VEHICLEDATA_HANDSOFFSTEERING"));
});
});
diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m
index c2f9afbf2..2b0f14f72 100644
--- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m
@@ -15,36 +15,39 @@
QuickSpecBegin(SDLOnVehicleDataSpec)
-describe(@"Getter/Setter Tests", ^ {
- __block SDLGPSData* gps = nil;
- __block SDLTireStatus* tires = nil;
- __block SDLBeltStatus* belt = nil;
- __block SDLBodyInformation* body = nil;
- __block SDLDeviceStatus* device = nil;
- __block SDLHeadLampStatus* headLamp = nil;
- __block SDLECallInfo* eCall = nil;
- __block SDLAirbagStatus* airbag = nil;
- __block SDLEmergencyEvent* event = nil;
- __block SDLClusterModeStatus* clusterMode = nil;
- __block SDLMyKey* myKey = nil;
- __block SDLFuelRange* fuelRange = nil;
- __block NSString* cloudAppVehicleID = nil;
-
- beforeEach(^{
- gps = [[SDLGPSData alloc] init];
- tires = [[SDLTireStatus alloc] init];
- belt = [[SDLBeltStatus alloc] init];
- body = [[SDLBodyInformation alloc] init];
- device = [[SDLDeviceStatus alloc] init];
- headLamp = [[SDLHeadLampStatus alloc] init];
- eCall = [[SDLECallInfo alloc] init];
- airbag = [[SDLAirbagStatus alloc] init];
- event = [[SDLEmergencyEvent alloc] init];
- clusterMode = [[SDLClusterModeStatus alloc] init];
- myKey = [[SDLMyKey alloc] init];
- fuelRange = [[SDLFuelRange alloc] init];
- cloudAppVehicleID = @"testCloudAppVehicleID";
- });
+describe(@"getter/setter tests", ^ {
+ SDLGPSData* gps = [[SDLGPSData alloc] init];
+ SDLTireStatus* tires = [[SDLTireStatus alloc] init];
+ SDLBeltStatus* belt = [[SDLBeltStatus alloc] init];
+ SDLBodyInformation* body = [[SDLBodyInformation alloc] init];
+ SDLDeviceStatus* device = [[SDLDeviceStatus alloc] init];
+ SDLHeadLampStatus* headLamp = [[SDLHeadLampStatus alloc] init];
+ SDLECallInfo* eCall = [[SDLECallInfo alloc] init];
+ SDLAirbagStatus* airbag = [[SDLAirbagStatus alloc] init];
+ SDLEmergencyEvent* event = [[SDLEmergencyEvent alloc] init];
+ SDLClusterModeStatus* clusterMode = [[SDLClusterModeStatus alloc] init];
+ SDLMyKey *myKey = [[SDLMyKey alloc] init];
+ SDLFuelRange* fuelRange = [[SDLFuelRange alloc] init];
+ NSString *cloudAppVehicleID = @"testCloudAppVehicleID";
+ const float speed = 123.45;
+ const NSUInteger rpm = 42;
+ const float fuelLevel = 10.3;
+ SDLComponentVolumeStatus fuelLevel_State = SDLComponentVolumeStatusAlert;
+ const float instantFuelConsumption = 4000.63;
+ NSArray *fuelRangeArray = @[fuelRange, fuelRange];
+ const float externalTemperature = -10.5;
+ NSString *const vin = @"222222222722";
+ SDLTurnSignal turnSignal = SDLTurnSignalOff;
+ SDLPRNDL prndl = SDLPRNDLDrive;
+ NSUInteger odometer = 100500;
+ SDLVehicleDataEventStatus driverBraking = SDLVehicleDataEventStatusYes;
+ SDLWiperStatus wiperStatus = SDLWiperStatusStalled;
+ const float engineTorque = -200.124;
+ const float accPedalPosition = 99.99999999;
+ const float steeringWheelAngle = M_PI_4;
+ const float engineOilLife = 34.45;
+ SDLElectronicParkBrakeStatus electronicParkBrakeStatus = SDLElectronicParkBrakeStatusDriveActive;
+ const BOOL handsOffSteering = YES;
it(@"should correctly initialize with init", ^ {
SDLOnVehicleData* testNotification = [[SDLOnVehicleData alloc] init];
@@ -67,6 +70,7 @@ describe(@"Getter/Setter Tests", ^ {
testNotification.fuelLevel_State = SDLComponentVolumeStatusAlert;
testNotification.fuelRange = @[fuelRange, fuelRange];
testNotification.gps = gps;
+ testNotification.handsOffSteering = @YES;
testNotification.headLampStatus = headLamp;
testNotification.instantFuelConsumption = @4000.63;
testNotification.myKey = myKey;
@@ -110,9 +114,10 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotification.turnSignal).to(equal(SDLTurnSignalRight));
expect(testNotification.vin).to(equal(@"222222222722"));
expect(testNotification.wiperStatus).to(equal(SDLWiperStatusStalled));
+ expect(testNotification.handsOffSteering).to(equal(@YES));
});
- it(@"Should get correctly when initialized", ^ {
+ it(@"should get correctly when initialized", ^ {
NSDictionary* dict = @{SDLRPCParameterNameNotification:
@{SDLRPCParameterNameParameters:
@{SDLRPCParameterNameAccelerationPedalPosition:@99.99999999,
@@ -144,7 +149,9 @@ describe(@"Getter/Setter Tests", ^ {
SDLRPCParameterNameTirePressure:tires,
SDLRPCParameterNameTurnSignal:SDLTurnSignalOff,
SDLRPCParameterNameVIN:@"222222222722",
- SDLRPCParameterNameWiperStatus:SDLWiperStatusStalled},
+ SDLRPCParameterNameWiperStatus:SDLWiperStatusStalled,
+ SDLRPCParameterNameHandsOffSteering:@YES
+ },
SDLRPCParameterNameOperationName:SDLRPCFunctionNameOnVehicleData}};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -169,6 +176,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotification.fuelLevel_State).to(equal(SDLComponentVolumeStatusAlert));
expect(testNotification.fuelRange).to(equal(@[fuelRange]));
expect(testNotification.gps).to(equal(gps));
+ expect(testNotification.handsOffSteering).to(equal(@YES));
expect(testNotification.headLampStatus).to(equal(headLamp));
expect(testNotification.instantFuelConsumption).to(equal(@4000.63));
expect(testNotification.myKey).to(equal(myKey));
@@ -183,7 +191,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotification.wiperStatus).to(equal(SDLWiperStatusStalled));
});
- it(@"Should return nil if not set", ^ {
+ it(@"should return nil if not set", ^ {
SDLOnVehicleData* testNotification = [[SDLOnVehicleData alloc] init];
expect(testNotification.accPedalPosition).to(beNil());
@@ -204,6 +212,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotification.fuelLevel_State).to(beNil());
expect(testNotification.fuelRange).to(beNil());
expect(testNotification.gps).to(beNil());
+ expect(testNotification.handsOffSteering).to(beNil());
expect(testNotification.headLampStatus).to(beNil());
expect(testNotification.instantFuelConsumption).to(beNil());
expect(testNotification.myKey).to(beNil());
@@ -218,13 +227,49 @@ describe(@"Getter/Setter Tests", ^ {
expect(testNotification.wiperStatus).to(beNil());
});
- it(@"Should set and get generic Network Signal Data", ^{
+ it(@"should set and get OEM Custom Vehicle Data", ^{
SDLOnVehicleData *testRequest = [[SDLOnVehicleData alloc] init];
[testRequest setOEMCustomVehicleData:@"customVehicleData" withVehicleDataState:@"oemVehicleData"];
expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(equal(@"oemVehicleData"));
+ });
+ context(@"initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:", ^{
+ SDLOnVehicleData *onVehicleData = [[SDLOnVehicleData alloc] initWithGps:gps speed:speed rpm:@(rpm) fuelLevel:fuelLevel fuelLevel_State:fuelLevel_State instantFuelConsumption:instantFuelConsumption fuelRange:fuelRangeArray externalTemperature:externalTemperature turnSignal:turnSignal vin:vin prndl:prndl tirePressure:tires odometer:@(odometer) beltStatus:belt bodyInformation:body deviceStatus:device driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLamp engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID eCallInfo:eCall airbagStatus:airbag emergencyEvent:event clusterModeStatus:clusterMode myKey:myKey handsOffSteering:@(handsOffSteering)];
+ it(@"should initialize an object correctly", ^{
+ expect(onVehicleData.accPedalPosition).to(equal(@(accPedalPosition)));
+ expect(onVehicleData.airbagStatus).to(equal(airbag));
+ expect(onVehicleData.beltStatus).to(equal(belt));
+ expect(onVehicleData.bodyInformation).to(equal(body));
+ expect(onVehicleData.cloudAppVehicleID).to(equal(cloudAppVehicleID));
+ expect(onVehicleData.clusterModeStatus).to(equal(clusterMode));
+ expect(onVehicleData.deviceStatus).to(equal(device));
+ expect(onVehicleData.driverBraking).to(equal(driverBraking));
+ expect(onVehicleData.eCallInfo).to(equal(eCall));
+ expect(onVehicleData.electronicParkBrakeStatus).to(equal(electronicParkBrakeStatus));
+ expect(onVehicleData.emergencyEvent).to(equal(event));
+ expect(onVehicleData.engineOilLife).to(equal(@(engineOilLife)));
+ expect(onVehicleData.engineTorque).to(equal(@(engineTorque)));
+ expect(onVehicleData.externalTemperature).to(equal(@(externalTemperature)));
+ expect(onVehicleData.fuelLevel).to(equal(@(fuelLevel)));
+ expect(onVehicleData.fuelLevel_State).to(equal(fuelLevel_State));
+ expect(onVehicleData.fuelRange).to(equal(fuelRangeArray));
+ expect(onVehicleData.gps).to(equal(gps));
+ expect(onVehicleData.handsOffSteering).to(equal(@(handsOffSteering)));
+ expect(onVehicleData.headLampStatus).to(equal(headLamp));
+ expect(onVehicleData.instantFuelConsumption).to(equal(@(instantFuelConsumption)));
+ expect(onVehicleData.myKey).to(equal(myKey));
+ expect(onVehicleData.odometer).to(equal(@(odometer)));
+ expect(onVehicleData.prndl).to(equal(prndl));
+ expect(onVehicleData.rpm).to(equal(@(rpm)));
+ expect(onVehicleData.speed).to(equal(@(speed)));
+ expect(onVehicleData.steeringWheelAngle).to(equal((steeringWheelAngle)));
+ expect(onVehicleData.tirePressure).to(equal(tires));
+ expect(onVehicleData.turnSignal).to(equal(turnSignal));
+ expect(onVehicleData.vin).to(equal(vin));
+ expect(onVehicleData.wiperStatus).to(equal(wiperStatus));
+ });
});
});
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m
index bcf32d76c..45e63d46f 100644
--- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m
@@ -47,6 +47,7 @@ describe(@"Getter/Setter Tests", ^ {
testRequest.tirePressure = @NO;
testRequest.turnSignal = @YES;
testRequest.wiperStatus = @NO;
+ testRequest.handsOffSteering = @YES;
expect(testRequest.accPedalPosition).to(equal(@YES));
expect(testRequest.airbagStatus).to(equal(@NO));
@@ -77,6 +78,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.tirePressure).to(equal(@NO));
expect(testRequest.turnSignal).to(equal(@YES));
expect(testRequest.wiperStatus).to(equal(@NO));
+ expect(testRequest.handsOffSteering).to(equal(@YES));
});
it(@"Should get correctly when initialized", ^ {
@@ -110,7 +112,9 @@ describe(@"Getter/Setter Tests", ^ {
SDLRPCParameterNameSteeringWheelAngle:@NO,
SDLRPCParameterNameTirePressure:@YES,
SDLRPCParameterNameTurnSignal:@NO,
- SDLRPCParameterNameWiperStatus:@YES},
+ SDLRPCParameterNameWiperStatus:@YES,
+ SDLRPCParameterNameHandsOffSteering:@YES
+ },
SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetVehicleData}};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -146,6 +150,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.tirePressure).to(equal(@YES));
expect(testRequest.turnSignal).to(equal(@NO));
expect(testRequest.wiperStatus).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@YES));
});
});
@@ -153,155 +158,206 @@ describe(@"initializers", ^{
context(@"init", ^{
SDLGetVehicleData* testRequest = [[SDLGetVehicleData alloc] init];
- expect(testRequest.accPedalPosition).to(beNil());
- expect(testRequest.airbagStatus).to(beNil());
- expect(testRequest.beltStatus).to(beNil());
- expect(testRequest.bodyInformation).to(beNil());
- expect(testRequest.cloudAppVehicleID).to(beNil());
- expect(testRequest.clusterModeStatus).to(beNil());
- expect(testRequest.deviceStatus).to(beNil());
- expect(testRequest.driverBraking).to(beNil());
- expect(testRequest.eCallInfo).to(beNil());
- expect(testRequest.electronicParkBrakeStatus).to(beNil());
- expect(testRequest.emergencyEvent).to(beNil());
- expect(testRequest.engineOilLife).to(beNil());
- expect(testRequest.engineTorque).to(beNil());
- expect(testRequest.externalTemperature).to(beNil());
- expect(testRequest.fuelLevel).to(beNil());
- expect(testRequest.fuelLevel_State).to(beNil());
- expect(testRequest.fuelRange).to(beNil());
- expect(testRequest.gps).to(beNil());
- expect(testRequest.headLampStatus).to(beNil());
- expect(testRequest.instantFuelConsumption).to(beNil());
- expect(testRequest.myKey).to(beNil());
- expect(testRequest.odometer).to(beNil());
- expect(testRequest.prndl).to(beNil());
- expect(testRequest.rpm).to(beNil());
- expect(testRequest.speed).to(beNil());
- expect(testRequest.steeringWheelAngle).to(beNil());
- expect(testRequest.tirePressure).to(beNil());
- expect(testRequest.turnSignal).to(beNil());
- expect(testRequest.wiperStatus).to(beNil());
+ it(@"should set all the parameters to nil", ^{
+ expect(testRequest.accPedalPosition).to(beNil());
+ expect(testRequest.airbagStatus).to(beNil());
+ expect(testRequest.beltStatus).to(beNil());
+ expect(testRequest.bodyInformation).to(beNil());
+ expect(testRequest.cloudAppVehicleID).to(beNil());
+ expect(testRequest.clusterModeStatus).to(beNil());
+ expect(testRequest.deviceStatus).to(beNil());
+ expect(testRequest.driverBraking).to(beNil());
+ expect(testRequest.eCallInfo).to(beNil());
+ expect(testRequest.electronicParkBrakeStatus).to(beNil());
+ expect(testRequest.emergencyEvent).to(beNil());
+ expect(testRequest.engineOilLife).to(beNil());
+ expect(testRequest.engineTorque).to(beNil());
+ expect(testRequest.externalTemperature).to(beNil());
+ expect(testRequest.fuelLevel).to(beNil());
+ expect(testRequest.fuelLevel_State).to(beNil());
+ expect(testRequest.fuelRange).to(beNil());
+ expect(testRequest.gps).to(beNil());
+ expect(testRequest.headLampStatus).to(beNil());
+ expect(testRequest.instantFuelConsumption).to(beNil());
+ expect(testRequest.myKey).to(beNil());
+ expect(testRequest.odometer).to(beNil());
+ expect(testRequest.prndl).to(beNil());
+ expect(testRequest.rpm).to(beNil());
+ expect(testRequest.speed).to(beNil());
+ expect(testRequest.steeringWheelAngle).to(beNil());
+ expect(testRequest.tirePressure).to(beNil());
+ expect(testRequest.turnSignal).to(beNil());
+ expect(testRequest.wiperStatus).to(beNil());
+ expect(testRequest.handsOffSteering).to(beNil());
+ });
});
context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus:", ^{
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLGetVehicleData *testRequest = [[SDLGetVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:NO beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES emergencyEvent:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES vin:YES wiperStatus:YES];
+#pragma clang diagnostic pop
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@NO));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.cloudAppVehicleID).to(equal(@NO));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@NO));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@NO));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@YES));
- expect(testRequest.fuelRange).to(equal(@NO));
- expect(testRequest.gps).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));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@NO));
- expect(testRequest.wiperStatus).to(equal(@YES));
- #pragma clang diagnostic pop
+ it(@"should set all the parameters properly", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@NO));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@NO));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@NO));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@NO));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@NO));
+ expect(testRequest.gps).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));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@NO));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@NO));
+ });
});
context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus:", ^{
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLGetVehicleData *testRequest = [[SDLGetVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES electronicParkBrakeStatus:YES emergencyEvent:YES engineOilLife:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES fuelRange:YES gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES turnSignal:YES vin:YES wiperStatus:YES];
+#pragma clang diagnostic pop
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@YES));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.cloudAppVehicleID).to(equal(@NO));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@YES));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@YES));
- expect(testRequest.fuelRange).to(equal(@YES));
- expect(testRequest.gps).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));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@YES));
- expect(testRequest.wiperStatus).to(equal(@YES));
- #pragma clang diagnostic pop
+ it(@"should set all the parameters properly", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@NO));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@YES));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@YES));
+ expect(testRequest.gps).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));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@YES));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@NO));
+ });
});
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:", ^{
+#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];
+#pragma clang diagnostic push
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@YES));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.cloudAppVehicleID).to(equal(@YES));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@YES));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@YES));
- expect(testRequest.fuelRange).to(equal(@YES));
- expect(testRequest.gps).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));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@YES));
- expect(testRequest.wiperStatus).to(equal(@YES));
+ it(@"should set all the parameters properly", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@YES));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@YES));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@YES));
+ expect(testRequest.gps).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));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@YES));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@NO));
+ });
+ });
+
+ context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:handsOffSteering:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:vin:wiperStatus:", ^{
+ SDLGetVehicleData *testRequest = [[SDLGetVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES fuelLevel:@YES fuelLevel_State:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES vin:@YES prndl:@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 eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES];
+ it(@"should set all the parameters to YES", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@YES));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@YES));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@YES));
+ expect(testRequest.gps).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));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@YES));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@YES));
+ });
});
- context(@"Should set and get Generic Network Signal Data", ^{
+ context(@"Should set and get OEM Custom Vehicle Data", ^{
SDLGetVehicleData *testRequest = [[SDLGetVehicleData alloc] init];
[testRequest setOEMCustomVehicleData:@"OEMCustomVehicleData" withVehicleDataState:NO];
[testRequest setOEMCustomVehicleData:@"OEMCustomVehicleData1" withVehicleDataState:YES];
- expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData"]).to(beFalse());
- expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData1"]).to(beTrue());
-
+ it(@"Should set and get OEM Custom Vehicle Data", ^{
+ expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData"]).to(equal(@NO));
+ expect([testRequest getOEMCustomVehicleData:@"OEMCustomVehicleData1"]).to(equal(@YES));
+ });
});
-
});
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m
index b69336d23..14dd3b3db 100644
--- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m
@@ -14,8 +14,8 @@
QuickSpecBegin(SDLSubscribeVehicleDataSpec)
-describe(@"Getter/Setter Tests", ^ {
- it(@"Should set and get correctly", ^ {
+describe(@"getter/setter tests", ^ {
+ it(@"should set and get correctly", ^ {
SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] init];
testRequest.accPedalPosition = @YES;
@@ -47,6 +47,7 @@ describe(@"Getter/Setter Tests", ^ {
testRequest.tirePressure = @NO;
testRequest.turnSignal = @YES;
testRequest.wiperStatus = @NO;
+ testRequest.handsOffSteering = @YES;
expect(testRequest.accPedalPosition).to(equal(@YES));
expect(testRequest.airbagStatus).to(equal(@NO));
@@ -77,9 +78,10 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.tirePressure).to(equal(@NO));
expect(testRequest.turnSignal).to(equal(@YES));
expect(testRequest.wiperStatus).to(equal(@NO));
+ expect(testRequest.handsOffSteering).to(equal(@YES));
});
- it(@"Should get correctly when initialized with a dictionary", ^ {
+ it(@"should get correctly when initialized with a dictionary", ^ {
NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest:
@{SDLRPCParameterNameParameters:
@{SDLRPCParameterNameAccelerationPedalPosition:@YES,
@@ -110,7 +112,9 @@ describe(@"Getter/Setter Tests", ^ {
SDLRPCParameterNameSteeringWheelAngle:@NO,
SDLRPCParameterNameTirePressure:@YES,
SDLRPCParameterNameTurnSignal:@NO,
- SDLRPCParameterNameWiperStatus:@NO},
+ SDLRPCParameterNameWiperStatus:@NO,
+ SDLRPCParameterNameHandsOffSteering:@YES
+ },
SDLRPCParameterNameOperationName:SDLRPCFunctionNameSubscribeVehicleData}};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -135,6 +139,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.fuelLevel_State).to(equal(@YES));
expect(testRequest.fuelRange).to(equal(@YES));
expect(testRequest.gps).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@YES));
expect(testRequest.headLampStatus).to(equal(@YES));
expect(testRequest.instantFuelConsumption).to(equal(@YES));
expect(testRequest.myKey).to(equal(@YES));
@@ -153,153 +158,165 @@ describe(@"initializers", ^{
context(@"init", ^{
SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] init];
- expect(testRequest.accPedalPosition).to(beNil());
- expect(testRequest.airbagStatus).to(beNil());
- expect(testRequest.beltStatus).to(beNil());
- expect(testRequest.bodyInformation).to(beNil());
- expect(testRequest.cloudAppVehicleID).to(beNil());
- expect(testRequest.clusterModeStatus).to(beNil());
- expect(testRequest.deviceStatus).to(beNil());
- expect(testRequest.driverBraking).to(beNil());
- expect(testRequest.eCallInfo).to(beNil());
- expect(testRequest.electronicParkBrakeStatus).to(beNil());
- expect(testRequest.emergencyEvent).to(beNil());
- expect(testRequest.engineOilLife).to(beNil());
- expect(testRequest.engineTorque).to(beNil());
- expect(testRequest.externalTemperature).to(beNil());
- expect(testRequest.fuelLevel).to(beNil());
- expect(testRequest.fuelLevel_State).to(beNil());
- expect(testRequest.fuelRange).to(beNil());
- expect(testRequest.gps).to(beNil());
- expect(testRequest.headLampStatus).to(beNil());
- expect(testRequest.instantFuelConsumption).to(beNil());
- expect(testRequest.myKey).to(beNil());
- expect(testRequest.odometer).to(beNil());
- expect(testRequest.prndl).to(beNil());
- expect(testRequest.rpm).to(beNil());
- expect(testRequest.speed).to(beNil());
- expect(testRequest.steeringWheelAngle).to(beNil());
- expect(testRequest.tirePressure).to(beNil());
- expect(testRequest.turnSignal).to(beNil());
- expect(testRequest.wiperStatus).to(beNil());
+ it(@"should set all the parameters to nil", ^{
+ expect(testRequest.accPedalPosition).to(beNil());
+ expect(testRequest.airbagStatus).to(beNil());
+ expect(testRequest.beltStatus).to(beNil());
+ expect(testRequest.bodyInformation).to(beNil());
+ expect(testRequest.cloudAppVehicleID).to(beNil());
+ expect(testRequest.clusterModeStatus).to(beNil());
+ expect(testRequest.deviceStatus).to(beNil());
+ expect(testRequest.driverBraking).to(beNil());
+ expect(testRequest.eCallInfo).to(beNil());
+ expect(testRequest.electronicParkBrakeStatus).to(beNil());
+ expect(testRequest.emergencyEvent).to(beNil());
+ expect(testRequest.engineOilLife).to(beNil());
+ expect(testRequest.engineTorque).to(beNil());
+ expect(testRequest.externalTemperature).to(beNil());
+ expect(testRequest.fuelLevel).to(beNil());
+ expect(testRequest.fuelLevel_State).to(beNil());
+ expect(testRequest.fuelRange).to(beNil());
+ expect(testRequest.gps).to(beNil());
+ expect(testRequest.handsOffSteering).to(beNil());
+ expect(testRequest.headLampStatus).to(beNil());
+ expect(testRequest.instantFuelConsumption).to(beNil());
+ expect(testRequest.myKey).to(beNil());
+ expect(testRequest.odometer).to(beNil());
+ expect(testRequest.prndl).to(beNil());
+ expect(testRequest.rpm).to(beNil());
+ expect(testRequest.speed).to(beNil());
+ expect(testRequest.steeringWheelAngle).to(beNil());
+ expect(testRequest.tirePressure).to(beNil());
+ expect(testRequest.turnSignal).to(beNil());
+ expect(testRequest.wiperStatus).to(beNil());
+ });
});
- 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:", ^{
- 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];
-
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@YES));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.cloudAppVehicleID).to(equal(@YES));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@YES));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@YES));
- expect(testRequest.fuelRange).to(equal(@YES));
- expect(testRequest.gps).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));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@YES));
- expect(testRequest.wiperStatus).to(equal(@YES));
- });
context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus:", ^{
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES electronicParkBrakeStatus:YES emergencyEvent:YES engineOilLife:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES fuelRange:YES gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES turnSignal:YES wiperStatus:YES];
+#pragma clang diagnostic pop
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@YES));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.cloudAppVehicleID).to(equal(@NO));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@YES));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@YES));
- expect(testRequest.fuelRange).to(equal(@YES));
- expect(testRequest.gps).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));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@YES));
- expect(testRequest.wiperStatus).to(equal(@YES));
- #pragma clang diagnostic pop
+ it(@"should set all the parameters properly", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@NO));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@YES));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@YES));
+ expect(testRequest.gps).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@NO));
+ expect(testRequest.headLampStatus).to(equal(@YES));
+ expect(testRequest.instantFuelConsumption).to(equal(@YES));
+ expect(testRequest.myKey).to(equal(@YES));
+ expect(testRequest.odometer).to(equal(@YES));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@YES));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ });
});
-
context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus:", ^{
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES emergencyEvent:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:NO gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES wiperStatus:YES];
+#pragma clang diagnostic pop
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@YES));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.cloudAppVehicleID).to(equal(@NO));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@NO));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@NO));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@NO));
- expect(testRequest.fuelRange).to(equal(@NO));
- expect(testRequest.gps).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));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@NO));
- expect(testRequest.wiperStatus).to(equal(@YES));
- #pragma clang diagnostic pop
+ it(@"should set all the parameters properly", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@NO));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@NO));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@NO));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@NO));
+ expect(testRequest.fuelRange).to(equal(@NO));
+ expect(testRequest.gps).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@NO));
+ expect(testRequest.headLampStatus).to(equal(@YES));
+ expect(testRequest.instantFuelConsumption).to(equal(@YES));
+ expect(testRequest.myKey).to(equal(@YES));
+ expect(testRequest.odometer).to(equal(@YES));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@NO));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ });
});
- context(@"Should set and get Generic Network Signal Data", ^{
- SDLSubscribeVehicleData *testRequest = [[SDLSubscribeVehicleData alloc] init];
+ context(@"initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:", ^{
+ SDLSubscribeVehicleData* testRequest = [[SDLSubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES fuelLevel:@YES fuelLevel_State:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES prndl:@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 eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES];
+
+ it(@"should set all the parameters properly", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@YES));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@YES));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@YES));
+ expect(testRequest.gps).to(equal(@YES));
+ 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));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@YES));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ });
+ });
+ context(@"should set and get OEM Custom Vehicle Data", ^{
+ SDLSubscribeVehicleData *testRequest = [[SDLSubscribeVehicleData alloc] init];
[testRequest setOEMCustomVehicleData:@"customVehicleData" withVehicleDataState:NO];
[testRequest setOEMCustomVehicleData:@"customVehicleData1" withVehicleDataState:YES];
- expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(beFalse());
- expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(beTrue());
-
+ it(@"should set the custom data properly", ^{
+ expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(equal(@NO));
+ expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(equal(@YES));
+ });
});
});
diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m
index 9795f6a29..d2b7da878 100644
--- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m
@@ -15,7 +15,7 @@
QuickSpecBegin(SDLUnsubscribeVehicleDataSpec)
describe(@"Getter/Setter Tests", ^ {
- it(@"Should set and get correctly", ^ {
+ it(@"should set and get correctly", ^ {
SDLUnsubscribeVehicleData* testRequest = [[SDLUnsubscribeVehicleData alloc] init];
testRequest.accPedalPosition = @YES;
@@ -36,6 +36,7 @@ describe(@"Getter/Setter Tests", ^ {
testRequest.fuelLevel_State = @YES;
testRequest.fuelRange = @YES;
testRequest.gps = @YES;
+ testRequest.handsOffSteering = @YES;
testRequest.headLampStatus = @YES;
testRequest.instantFuelConsumption = @YES;
testRequest.myKey = @YES;
@@ -66,6 +67,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.fuelLevel_State).to(equal(@YES));
expect(testRequest.fuelRange).to(equal(@YES));
expect(testRequest.gps).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@YES));
expect(testRequest.headLampStatus).to(equal(@YES));
expect(testRequest.instantFuelConsumption).to(equal(@YES));
expect(testRequest.myKey).to(equal(@YES));
@@ -79,7 +81,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.wiperStatus).to(equal(@YES));
});
- it(@"Should get correctly when initialized with a dictionary", ^ {
+ it(@"should get correctly when initialized with a dictionary", ^ {
NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest:
@{SDLRPCParameterNameParameters:
@{SDLRPCParameterNameAccelerationPedalPosition:@YES,
@@ -110,7 +112,9 @@ describe(@"Getter/Setter Tests", ^ {
SDLRPCParameterNameSteeringWheelAngle:@YES,
SDLRPCParameterNameTirePressure:@YES,
SDLRPCParameterNameTurnSignal:@YES,
- SDLRPCParameterNameWiperStatus:@YES},
+ SDLRPCParameterNameWiperStatus:@YES,
+ SDLRPCParameterNameHandsOffSteering:@YES
+ },
SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -135,6 +139,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testRequest.fuelLevel_State).to(equal(@YES));
expect(testRequest.fuelRange).to(equal(@YES));
expect(testRequest.gps).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@YES));
expect(testRequest.headLampStatus).to(equal(@YES));
expect(testRequest.instantFuelConsumption).to(equal(@YES));
expect(testRequest.myKey).to(equal(@YES));
@@ -153,151 +158,163 @@ describe(@"initializers", ^{
context(@"init", ^{
SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] init];
- expect(testRequest.accPedalPosition).to(beNil());
- expect(testRequest.airbagStatus).to(beNil());
- expect(testRequest.beltStatus).to(beNil());
- expect(testRequest.bodyInformation).to(beNil());
- expect(testRequest.cloudAppVehicleID).to(beNil());
- expect(testRequest.clusterModeStatus).to(beNil());
- expect(testRequest.deviceStatus).to(beNil());
- expect(testRequest.driverBraking).to(beNil());
- expect(testRequest.eCallInfo).to(beNil());
- expect(testRequest.electronicParkBrakeStatus).to(beNil());
- expect(testRequest.emergencyEvent).to(beNil());
- expect(testRequest.engineOilLife).to(beNil());
- expect(testRequest.engineTorque).to(beNil());
- expect(testRequest.externalTemperature).to(beNil());
- expect(testRequest.fuelLevel).to(beNil());
- expect(testRequest.fuelLevel_State).to(beNil());
- expect(testRequest.fuelRange).to(beNil());
- expect(testRequest.gps).to(beNil());
- expect(testRequest.headLampStatus).to(beNil());
- expect(testRequest.instantFuelConsumption).to(beNil());
- expect(testRequest.myKey).to(beNil());
- expect(testRequest.odometer).to(beNil());
- expect(testRequest.prndl).to(beNil());
- expect(testRequest.rpm).to(beNil());
- expect(testRequest.speed).to(beNil());
- expect(testRequest.steeringWheelAngle).to(beNil());
- expect(testRequest.tirePressure).to(beNil());
- expect(testRequest.turnSignal).to(beNil());
- expect(testRequest.wiperStatus).to(beNil());
+ it(@"should set all the parameters to nil", ^{
+ expect(testRequest.accPedalPosition).to(beNil());
+ expect(testRequest.airbagStatus).to(beNil());
+ expect(testRequest.beltStatus).to(beNil());
+ expect(testRequest.bodyInformation).to(beNil());
+ expect(testRequest.cloudAppVehicleID).to(beNil());
+ expect(testRequest.clusterModeStatus).to(beNil());
+ expect(testRequest.deviceStatus).to(beNil());
+ expect(testRequest.driverBraking).to(beNil());
+ expect(testRequest.eCallInfo).to(beNil());
+ expect(testRequest.electronicParkBrakeStatus).to(beNil());
+ expect(testRequest.emergencyEvent).to(beNil());
+ expect(testRequest.engineOilLife).to(beNil());
+ expect(testRequest.engineTorque).to(beNil());
+ expect(testRequest.externalTemperature).to(beNil());
+ expect(testRequest.fuelLevel).to(beNil());
+ expect(testRequest.fuelLevel_State).to(beNil());
+ expect(testRequest.fuelRange).to(beNil());
+ expect(testRequest.gps).to(beNil());
+ expect(testRequest.handsOffSteering).to(beNil());
+ expect(testRequest.headLampStatus).to(beNil());
+ expect(testRequest.instantFuelConsumption).to(beNil());
+ expect(testRequest.myKey).to(beNil());
+ expect(testRequest.odometer).to(beNil());
+ expect(testRequest.prndl).to(beNil());
+ expect(testRequest.rpm).to(beNil());
+ expect(testRequest.speed).to(beNil());
+ expect(testRequest.steeringWheelAngle).to(beNil());
+ expect(testRequest.tirePressure).to(beNil());
+ expect(testRequest.turnSignal).to(beNil());
+ expect(testRequest.wiperStatus).to(beNil());
+ });
});
context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus:", ^{
- SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData 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];
+ SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES fuelLevel:@YES fuelLevel_State:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES prndl:@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 eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES handsOffSteering:@YES];
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@YES));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.cloudAppVehicleID).to(equal(@YES));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@YES));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@YES));
- expect(testRequest.fuelRange).to(equal(@YES));
- expect(testRequest.gps).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));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@YES));
- expect(testRequest.wiperStatus).to(equal(@YES));
+ it(@"should set all the parameters to YES", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@YES));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@YES));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@YES));
+ expect(testRequest.gps).to(equal(@YES));
+ 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));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@YES));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ });
});
context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus:", ^{
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES electronicParkBrakeStatus:YES emergencyEvent:YES engineOilLife:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES fuelRange:YES gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES turnSignal:YES wiperStatus:YES];
+#pragma clang diagnostic pop
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@YES));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.cloudAppVehicleID).to(equal(@NO));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@YES));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@YES));
- expect(testRequest.fuelRange).to(equal(@YES));
- expect(testRequest.gps).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));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@YES));
- expect(testRequest.wiperStatus).to(equal(@YES));
- #pragma clang diagnostic pop
+ it(@"expect all properties to be set properly", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.cloudAppVehicleID).to(equal(@NO));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@YES));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@YES));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@YES));
+ expect(testRequest.gps).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));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@YES));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@NO));
+ });
});
context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus:", ^{
- #pragma clang diagnostic push
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES emergencyEvent:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES gps:YES headLampStatus:NO instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES wiperStatus:YES];
+#pragma clang diagnostic pop
- expect(testRequest.accPedalPosition).to(equal(@YES));
- expect(testRequest.airbagStatus).to(equal(@YES));
- expect(testRequest.beltStatus).to(equal(@YES));
- expect(testRequest.bodyInformation).to(equal(@YES));
- expect(testRequest.clusterModeStatus).to(equal(@YES));
- expect(testRequest.deviceStatus).to(equal(@YES));
- expect(testRequest.driverBraking).to(equal(@YES));
- expect(testRequest.eCallInfo).to(equal(@YES));
- expect(testRequest.electronicParkBrakeStatus).to(equal(@NO));
- expect(testRequest.emergencyEvent).to(equal(@YES));
- expect(testRequest.engineOilLife).to(equal(@NO));
- expect(testRequest.engineTorque).to(equal(@YES));
- expect(testRequest.externalTemperature).to(equal(@YES));
- expect(testRequest.fuelLevel).to(equal(@YES));
- expect(testRequest.fuelLevel_State).to(equal(@YES));
- expect(testRequest.fuelRange).to(equal(@NO));
- expect(testRequest.gps).to(equal(@YES));
- expect(testRequest.headLampStatus).to(equal(@NO));
- expect(testRequest.instantFuelConsumption).to(equal(@YES));
- expect(testRequest.myKey).to(equal(@YES));
- expect(testRequest.odometer).to(equal(@YES));
- expect(testRequest.prndl).to(equal(@YES));
- expect(testRequest.rpm).to(equal(@YES));
- expect(testRequest.speed).to(equal(@YES));
- expect(testRequest.steeringWheelAngle).to(equal(@YES));
- expect(testRequest.tirePressure).to(equal(@YES));
- expect(testRequest.turnSignal).to(equal(@NO));
- expect(testRequest.wiperStatus).to(equal(@YES));
- #pragma clang diagnostic pop
+ it(@"expect all properties to be set properly", ^{
+ expect(testRequest.accPedalPosition).to(equal(@YES));
+ expect(testRequest.airbagStatus).to(equal(@YES));
+ expect(testRequest.beltStatus).to(equal(@YES));
+ expect(testRequest.bodyInformation).to(equal(@YES));
+ expect(testRequest.clusterModeStatus).to(equal(@YES));
+ expect(testRequest.deviceStatus).to(equal(@YES));
+ expect(testRequest.driverBraking).to(equal(@YES));
+ expect(testRequest.eCallInfo).to(equal(@YES));
+ expect(testRequest.electronicParkBrakeStatus).to(equal(@NO));
+ expect(testRequest.emergencyEvent).to(equal(@YES));
+ expect(testRequest.engineOilLife).to(equal(@NO));
+ expect(testRequest.engineTorque).to(equal(@YES));
+ expect(testRequest.externalTemperature).to(equal(@YES));
+ expect(testRequest.fuelLevel).to(equal(@YES));
+ expect(testRequest.fuelLevel_State).to(equal(@YES));
+ expect(testRequest.fuelRange).to(equal(@NO));
+ expect(testRequest.gps).to(equal(@YES));
+ expect(testRequest.handsOffSteering).to(equal(@NO));
+ expect(testRequest.headLampStatus).to(equal(@NO));
+ expect(testRequest.instantFuelConsumption).to(equal(@YES));
+ expect(testRequest.myKey).to(equal(@YES));
+ expect(testRequest.odometer).to(equal(@YES));
+ expect(testRequest.prndl).to(equal(@YES));
+ expect(testRequest.rpm).to(equal(@YES));
+ expect(testRequest.speed).to(equal(@YES));
+ expect(testRequest.steeringWheelAngle).to(equal(@YES));
+ expect(testRequest.tirePressure).to(equal(@YES));
+ expect(testRequest.turnSignal).to(equal(@NO));
+ expect(testRequest.wiperStatus).to(equal(@YES));
+ });
});
- context(@"Should set and get Generic Network Signal Data", ^{
+ context(@"should set and get OEM Custom Vehicle Data", ^{
SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] init];
-
[testRequest setOEMCustomVehicleData:@"customVehicleData" withVehicleDataState:NO];
[testRequest setOEMCustomVehicleData:@"customVehicleData1" withVehicleDataState:YES];
- expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(beFalse());
- expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(beTrue());
-
+ it(@"should set all the custom data properly", ^{
+ expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(equal(@NO));
+ expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(equal(@YES));
+ });
});
});
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m
index 72df4207b..75541a125 100644
--- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m
@@ -15,40 +15,41 @@
QuickSpecBegin(SDLGetVehicleDataResponseSpec)
-describe(@"Getter/Setter Tests", ^ {
- __block SDLGPSData* gps = nil;
- __block SDLTireStatus* tires = nil;
- __block SDLBeltStatus* belt = nil;
- __block SDLBodyInformation* body = nil;
- __block SDLDeviceStatus* device = nil;
- __block SDLHeadLampStatus* headLamp = nil;
- __block SDLECallInfo* eCall = nil;
- __block SDLAirbagStatus* airbag = nil;
- __block SDLEmergencyEvent* event = nil;
- __block SDLClusterModeStatus* clusterMode = nil;
- __block SDLMyKey* myKey = nil;
- __block SDLFuelRange* fuelRange = nil;
- __block NSString* vin = nil;
- __block NSString* cloudAppVehicleID = nil;
+describe(@"getter/setter tests", ^ {
+ SDLGPSData* gps = [[SDLGPSData alloc] init];
+ SDLTireStatus* tires = [[SDLTireStatus alloc] init];
+ SDLBeltStatus* belt = [[SDLBeltStatus alloc] init];
+ SDLBodyInformation* body = [[SDLBodyInformation alloc] init];
+ SDLDeviceStatus* device = [[SDLDeviceStatus alloc] init];
+ SDLHeadLampStatus* headLamp = [[SDLHeadLampStatus alloc] init];
+ SDLECallInfo* eCall = [[SDLECallInfo alloc] init];
+ SDLAirbagStatus* airbag = [[SDLAirbagStatus alloc] init];
+ SDLEmergencyEvent* event = [[SDLEmergencyEvent alloc] init];
+ SDLClusterModeStatus* clusterMode = [[SDLClusterModeStatus alloc] init];
+ SDLMyKey* myKey = [[SDLMyKey alloc] init];
+ SDLFuelRange* fuelRange = [[SDLFuelRange alloc] init];
+ NSString *const vin = @"6574839201a";
+ NSString *const cloudAppVehicleID = @"cloudAppVehicleID";
+ const float speed = 123.45;
+ const NSUInteger rpm = 42;
+ const float fuelLevel = 10.3;
+ SDLComponentVolumeStatus fuelLevel_State = SDLComponentVolumeStatusAlert;
+ const float instantFuelConsumption = 4000.63;
+ NSArray *fuelRangeArray = @[fuelRange, fuelRange];
+ const float externalTemperature = -10.5;
+ SDLTurnSignal turnSignal = SDLTurnSignalOff;
+ SDLPRNDL prndl = SDLPRNDLDrive;
+ NSUInteger odometer = 100500;
+ SDLVehicleDataEventStatus driverBraking = SDLVehicleDataEventStatusYes;
+ SDLWiperStatus wiperStatus = SDLWiperStatusStalled;
+ const float engineTorque = -200.124;
+ const float accPedalPosition = 99.99999999;
+ const float steeringWheelAngle = M_PI_4;
+ const float engineOilLife = 34.45;
+ SDLElectronicParkBrakeStatus electronicParkBrakeStatus = SDLElectronicParkBrakeStatusDriveActive;
+ const BOOL handsOffSteering = YES;
- beforeEach(^{
- gps = [[SDLGPSData alloc] init];
- tires = [[SDLTireStatus alloc] init];
- belt = [[SDLBeltStatus alloc] init];
- body = [[SDLBodyInformation alloc] init];
- device = [[SDLDeviceStatus alloc] init];
- headLamp = [[SDLHeadLampStatus alloc] init];
- eCall = [[SDLECallInfo alloc] init];
- airbag = [[SDLAirbagStatus alloc] init];
- event = [[SDLEmergencyEvent alloc] init];
- clusterMode = [[SDLClusterModeStatus alloc] init];
- myKey = [[SDLMyKey alloc] init];
- fuelRange = [[SDLFuelRange alloc] init];
- vin = @"6574839201a";
- cloudAppVehicleID = @"cloudAppVehicleID";
- });
-
- it(@"Should set and get correctly", ^ {
+ it(@"should set and get correctly", ^ {
SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] init];
testResponse.accPedalPosition = @0;
@@ -69,6 +70,7 @@ describe(@"Getter/Setter Tests", ^ {
testResponse.fuelLevel_State = SDLComponentVolumeStatusFault;
testResponse.fuelRange = @[fuelRange, fuelRange];
testResponse.gps = gps;
+ testResponse.handsOffSteering = @YES;
testResponse.headLampStatus = headLamp;
testResponse.instantFuelConsumption = @40.7;
testResponse.myKey = myKey;
@@ -100,6 +102,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.fuelLevel_State).to(equal(SDLComponentVolumeStatusFault));
expect(testResponse.fuelRange).to(equal(@[fuelRange, fuelRange]));
expect(testResponse.gps).to(equal(gps));
+ expect(testResponse.handsOffSteering).to(equal(@YES));
expect(testResponse.headLampStatus).to(equal(headLamp));
expect(testResponse.instantFuelConsumption).to(equal(@40.7));
expect(testResponse.myKey).to(equal(myKey));
@@ -114,8 +117,8 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.wiperStatus).to(equal(SDLWiperStatusAutomaticHigh));
});
- it(@"Should get correctly when initialized", ^ {
- NSMutableDictionary* dict = [@{SDLRPCParameterNameNotification:
+ it(@"should get correctly when initialized", ^ {
+ NSDictionary* dict = @{SDLRPCParameterNameNotification:
@{SDLRPCParameterNameParameters:
@{
SDLRPCParameterNameAccelerationPedalPosition:@0,
@@ -147,8 +150,10 @@ describe(@"Getter/Setter Tests", ^ {
SDLRPCParameterNameTirePressure:tires,
SDLRPCParameterNameTurnSignal:SDLTurnSignalOff,
SDLRPCParameterNameVIN:vin,
- SDLRPCParameterNameWiperStatus:SDLWiperStatusAutomaticHigh},
- SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetVehicleData}} mutableCopy];
+ SDLRPCParameterNameWiperStatus:SDLWiperStatusAutomaticHigh,
+ SDLRPCParameterNameHandsOffSteering:@YES
+ },
+ SDLRPCParameterNameOperationName:SDLRPCFunctionNameGetVehicleData}};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] initWithDictionary:dict];
@@ -172,6 +177,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.fuelLevel_State).to(equal(SDLComponentVolumeStatusFault));
expect(testResponse.fuelRange).to(equal(@[fuelRange]));
expect(testResponse.gps).to(equal(gps));
+ expect(testResponse.handsOffSteering).to(equal(@YES));
expect(testResponse.headLampStatus).to(equal(headLamp));
expect(testResponse.instantFuelConsumption).to(equal(@40.7));
expect(testResponse.myKey).to(equal(myKey));
@@ -186,7 +192,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.wiperStatus).to(equal(SDLWiperStatusAutomaticHigh));
});
- it(@"Should return nil if not set", ^ {
+ it(@"should return nil if not set", ^ {
SDLGetVehicleDataResponse* testResponse = [[SDLGetVehicleDataResponse alloc] init];
expect(testResponse.accPedalPosition).to(beNil());
@@ -207,6 +213,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.fuelLevel_State).to(beNil());
expect(testResponse.fuelRange).to(beNil());
expect(testResponse.gps).to(beNil());
+ expect(testResponse.handsOffSteering).to(beNil());
expect(testResponse.headLampStatus).to(beNil());
expect(testResponse.instantFuelConsumption).to(beNil());
expect(testResponse.myKey).to(beNil());
@@ -221,7 +228,44 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.wiperStatus).to(beNil());
});
- it(@"Should set and get Generic Network Signal Data", ^{
+ context(@"initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:", ^{
+ SDLGetVehicleDataResponse *testResponse = [[SDLGetVehicleDataResponse alloc] initWithGps:gps speed:speed rpm:@(rpm) fuelLevel:fuelLevel fuelLevel_State:fuelLevel_State instantFuelConsumption:instantFuelConsumption fuelRange:fuelRangeArray externalTemperature:externalTemperature turnSignal:turnSignal vin:vin prndl:prndl tirePressure:tires odometer:@(odometer) beltStatus:belt bodyInformation:body deviceStatus:device driverBraking:driverBraking wiperStatus:wiperStatus headLampStatus:headLamp engineTorque:engineTorque accPedalPosition:accPedalPosition steeringWheelAngle:steeringWheelAngle engineOilLife:engineOilLife electronicParkBrakeStatus:electronicParkBrakeStatus cloudAppVehicleID:cloudAppVehicleID eCallInfo:eCall airbagStatus:airbag emergencyEvent:event clusterModeStatus:clusterMode myKey:myKey handsOffSteering:@(handsOffSteering)];
+ it(@"should get correctly when initialized", ^{
+ expect(testResponse.accPedalPosition).to(equal(@(accPedalPosition)));
+ expect(testResponse.airbagStatus).to(equal(airbag));
+ expect(testResponse.beltStatus).to(equal(belt));
+ expect(testResponse.bodyInformation).to(equal(body));
+ expect(testResponse.cloudAppVehicleID).to(equal(cloudAppVehicleID));
+ expect(testResponse.clusterModeStatus).to(equal(clusterMode));
+ expect(testResponse.deviceStatus).to(equal(device));
+ expect(testResponse.driverBraking).to(equal(driverBraking));
+ expect(testResponse.eCallInfo).to(equal(eCall));
+ expect(testResponse.electronicParkBrakeStatus).to(equal(electronicParkBrakeStatus));
+ expect(testResponse.emergencyEvent).to(equal(event));
+ expect(testResponse.engineOilLife).to(equal(@(engineOilLife)));
+ expect(testResponse.engineTorque).to(equal(@(engineTorque)));
+ expect(testResponse.externalTemperature).to(equal(@(externalTemperature)));
+ expect(testResponse.fuelLevel).to(equal(@(fuelLevel)));
+ expect(testResponse.fuelLevel_State).to(equal(fuelLevel_State));
+ expect(testResponse.fuelRange).to(equal(fuelRangeArray));
+ expect(testResponse.gps).to(equal(gps));
+ expect(testResponse.handsOffSteering).to(equal(@(handsOffSteering)));
+ expect(testResponse.headLampStatus).to(equal(headLamp));
+ expect(testResponse.instantFuelConsumption).to(equal(@(instantFuelConsumption)));
+ expect(testResponse.myKey).to(equal(myKey));
+ expect(testResponse.odometer).to(equal(@(odometer)));
+ expect(testResponse.prndl).to(equal(prndl));
+ expect(testResponse.rpm).to(equal(@(rpm)));
+ expect(testResponse.speed).to(equal(@(speed)));
+ expect(testResponse.steeringWheelAngle).to(equal((steeringWheelAngle)));
+ expect(testResponse.tirePressure).to(equal(tires));
+ expect(testResponse.turnSignal).to(equal(turnSignal));
+ expect(testResponse.vin).to(equal(vin));
+ expect(testResponse.wiperStatus).to(equal(wiperStatus));
+ });
+ });
+
+ it(@"should set and get OEM Custom Vehicle Data", ^{
SDLGetVehicleDataResponse *testRequest = [[SDLGetVehicleDataResponse alloc] init];
[testRequest setOEMCustomVehicleData:@"customVehicleData" withVehicleDataState:@"oemVehicleData"];
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m
index 1b8dc5b6d..a7d3b1fb1 100644
--- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m
@@ -22,7 +22,7 @@ SDLVehicleDataResult* customOEMvehicleDataResult = [[SDLVehicleDataResult alloc]
describe(@"Getter/Setter Tests", ^ {
- it(@"Should set and get correctly", ^ {
+ it(@"should set and get correctly", ^ {
SDLSubscribeVehicleDataResponse* testResponse = [[SDLSubscribeVehicleDataResponse alloc] init];
testResponse.accPedalPosition = vehicleDataResult;
@@ -43,6 +43,7 @@ describe(@"Getter/Setter Tests", ^ {
testResponse.fuelLevel_State = vehicleDataResult;
testResponse.fuelRange = vehicleDataResult;
testResponse.gps = vehicleDataResult;
+ testResponse.handsOffSteering = vehicleDataResult;
testResponse.headLampStatus = vehicleDataResult;
testResponse.instantFuelConsumption = vehicleDataResult;
testResponse.myKey = vehicleDataResult;
@@ -73,6 +74,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult));
expect(testResponse.fuelRange).to(equal(vehicleDataResult));
expect(testResponse.gps).to(equal(vehicleDataResult));
+ expect(testResponse.handsOffSteering).to(equal(vehicleDataResult));
expect(testResponse.headLampStatus).to(equal(vehicleDataResult));
expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult));
expect(testResponse.myKey).to(equal(vehicleDataResult));
@@ -86,7 +88,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.wiperStatus).to(equal(vehicleDataResult));
});
- it(@"Should get correctly when initialized", ^ {
+ it(@"should get correctly when initialized", ^ {
NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameResponse:
@{SDLRPCParameterNameParameters:
@{SDLRPCParameterNameAccelerationPedalPosition:vehicleDataResult,
@@ -117,7 +119,9 @@ describe(@"Getter/Setter Tests", ^ {
SDLRPCParameterNameSteeringWheelAngle:vehicleDataResult,
SDLRPCParameterNameTirePressure:vehicleDataResult,
SDLRPCParameterNameTurnSignal:vehicleDataResult,
- SDLRPCParameterNameWiperStatus:vehicleDataResult},
+ SDLRPCParameterNameWiperStatus:vehicleDataResult,
+ SDLRPCParameterNameHandsOffSteering:vehicleDataResult
+ },
SDLRPCParameterNameOperationName:SDLRPCFunctionNameSubscribeVehicleData}};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -142,6 +146,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult));
expect(testResponse.fuelRange).to(equal(vehicleDataResult));
expect(testResponse.gps).to(equal(vehicleDataResult));
+ expect(testResponse.handsOffSteering).to(equal(vehicleDataResult));
expect(testResponse.headLampStatus).to(equal(vehicleDataResult));
expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult));
expect(testResponse.myKey).to(equal(vehicleDataResult));
@@ -155,7 +160,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.wiperStatus).to(equal(vehicleDataResult));
});
- it(@"Should return nil if not set", ^ {
+ it(@"should return nil if not set", ^ {
SDLSubscribeVehicleDataResponse* testResponse = [[SDLSubscribeVehicleDataResponse alloc] init];
expect(testResponse.accPedalPosition).to(beNil());
@@ -176,6 +181,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.fuelLevel_State).to(beNil());
expect(testResponse.fuelRange).to(beNil());
expect(testResponse.gps).to(beNil());
+ expect(testResponse.handsOffSteering).to(beNil());
expect(testResponse.headLampStatus).to(beNil());
expect(testResponse.instantFuelConsumption).to(beNil());
expect(testResponse.myKey).to(beNil());
@@ -189,7 +195,7 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.wiperStatus).to(beNil());
});
- it(@"Should set and get Generic Network Signal Data", ^{
+ it(@"should set and get OEM Custom Vehicle Data", ^{
SDLSubscribeVehicleDataResponse *testRequest = [[SDLSubscribeVehicleDataResponse alloc] init];
[testRequest setOEMCustomVehicleData:@"customOEMVehicleData" withVehicleDataState:customOEMvehicleDataResult];
@@ -198,4 +204,43 @@ describe(@"Getter/Setter Tests", ^ {
});
});
+describe(@"convenience init test", ^ {
+ context(@"initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:handsOffSteering:", ^{
+ SDLSubscribeVehicleDataResponse *testResponse = [[SDLSubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult fuelLevel:vehicleDataResult fuelLevel_State:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult externalTemperature:vehicleDataResult turnSignal:vehicleDataResult prndl: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 eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult handsOffSteering:vehicleDataResult];
+
+ it(@"expect all the params to be vehicleDataResult", ^{
+ expect(testResponse.accPedalPosition).to(equal(vehicleDataResult));
+ expect(testResponse.airbagStatus).to(equal(vehicleDataResult));
+ expect(testResponse.beltStatus).to(equal(vehicleDataResult));
+ expect(testResponse.bodyInformation).to(equal(vehicleDataResult));
+ expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult));
+ expect(testResponse.clusterModes).to(equal(vehicleDataResult));
+ expect(testResponse.deviceStatus).to(equal(vehicleDataResult));
+ expect(testResponse.driverBraking).to(equal(vehicleDataResult));
+ expect(testResponse.eCallInfo).to(equal(vehicleDataResult));
+ expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult));
+ expect(testResponse.emergencyEvent).to(equal(vehicleDataResult));
+ expect(testResponse.engineOilLife).to(equal(vehicleDataResult));
+ expect(testResponse.engineTorque).to(equal(vehicleDataResult));
+ expect(testResponse.externalTemperature).to(equal(vehicleDataResult));
+ expect(testResponse.fuelLevel).to(equal(vehicleDataResult));
+ expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult));
+ expect(testResponse.fuelRange).to(equal(vehicleDataResult));
+ expect(testResponse.gps).to(equal(vehicleDataResult));
+ expect(testResponse.handsOffSteering).to(equal(vehicleDataResult));
+ expect(testResponse.headLampStatus).to(equal(vehicleDataResult));
+ expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult));
+ expect(testResponse.myKey).to(equal(vehicleDataResult));
+ expect(testResponse.odometer).to(equal(vehicleDataResult));
+ expect(testResponse.prndl).to(equal(vehicleDataResult));
+ expect(testResponse.rpm).to(equal(vehicleDataResult));
+ 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.wiperStatus).to(equal(vehicleDataResult));
+ });
+ });
+});
+
QuickSpecEnd
diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m
index 3f6302e4b..db6c5d99d 100644
--- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m
+++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m
@@ -19,8 +19,8 @@ QuickSpecBegin(SDLUnsubscribeVehicleDataResponseSpec)
SDLVehicleDataResult* vehicleDataResult = [[SDLVehicleDataResult alloc] init];
SDLVehicleDataResult* customOEMvehicleDataResult = [[SDLVehicleDataResult alloc] initWithCustomOEMDataType:@"customOEMVehicleData" resultCode:SDLVehicleDataResultCodeSuccess];
-describe(@"Getter/Setter Tests", ^ {
- it(@"Should set and get correctly", ^ {
+describe(@"getter/setter tests", ^ {
+ it(@"should set and get correctly", ^ {
SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] init];
testResponse.gps = vehicleDataResult;
@@ -52,6 +52,7 @@ describe(@"Getter/Setter Tests", ^ {
testResponse.electronicParkBrakeStatus = vehicleDataResult;
testResponse.turnSignal = vehicleDataResult;
testResponse.cloudAppVehicleID = vehicleDataResult;
+ testResponse.handsOffSteering = vehicleDataResult;
expect(testResponse.gps).to(equal(vehicleDataResult));
expect(testResponse.speed).to(equal(vehicleDataResult));
@@ -82,10 +83,11 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult));
expect(testResponse.turnSignal).to(equal(vehicleDataResult));
expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult));
+ expect(testResponse.handsOffSteering).to(equal(vehicleDataResult));
});
- it(@"Should get correctly when initialized", ^ {
- NSMutableDictionary<NSString *, id> *dict = [@{SDLRPCParameterNameResponse:
+ it(@"should get correctly when initialized", ^ {
+ NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameResponse:
@{SDLRPCParameterNameParameters:
@{SDLRPCParameterNameGPS:vehicleDataResult,
SDLRPCParameterNameSpeed:vehicleDataResult,
@@ -115,9 +117,10 @@ describe(@"Getter/Setter Tests", ^ {
SDLRPCParameterNameMyKey:vehicleDataResult,
SDLRPCParameterNameElectronicParkBrakeStatus:vehicleDataResult,
SDLRPCParameterNameTurnSignal:vehicleDataResult,
- SDLRPCParameterNameCloudAppVehicleID:vehicleDataResult
+ SDLRPCParameterNameCloudAppVehicleID:vehicleDataResult,
+ SDLRPCParameterNameHandsOffSteering:vehicleDataResult
},
- SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}} mutableCopy];
+ SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithDictionary:dict];
@@ -152,9 +155,10 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult));
expect(testResponse.turnSignal).to(equal(vehicleDataResult));
expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult));
+ expect(testResponse.handsOffSteering).to(equal(vehicleDataResult));
});
- it(@"Should return nil if not set", ^ {
+ it(@"should return nil if not set", ^ {
SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] init];
expect(testResponse.gps).to(beNil());
@@ -186,9 +190,47 @@ describe(@"Getter/Setter Tests", ^ {
expect(testResponse.electronicParkBrakeStatus).to(beNil());
expect(testResponse.turnSignal).to(beNil());
expect(testResponse.cloudAppVehicleID).to(beNil());
+ expect(testResponse.handsOffSteering).to(beNil());
});
- it(@"Should set and get Generic Network Signal Data", ^{
+ context(@"initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:handsOffSteering:", ^{
+ it(@"expect all properties to be vehicleDataResult", ^ {
+ SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult fuelLevel:vehicleDataResult fuelLevel_State:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult externalTemperature:vehicleDataResult turnSignal:vehicleDataResult prndl: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 eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult handsOffSteering:vehicleDataResult];
+
+ expect(testResponse.gps).to(equal(vehicleDataResult));
+ expect(testResponse.speed).to(equal(vehicleDataResult));
+ expect(testResponse.rpm).to(equal(vehicleDataResult));
+ expect(testResponse.fuelLevel).to(equal(vehicleDataResult));
+ expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult));
+ expect(testResponse.fuelRange).to(equal(vehicleDataResult));
+ expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult));
+ expect(testResponse.externalTemperature).to(equal(vehicleDataResult));
+ expect(testResponse.prndl).to(equal(vehicleDataResult));
+ expect(testResponse.tirePressure).to(equal(vehicleDataResult));
+ expect(testResponse.odometer).to(equal(vehicleDataResult));
+ expect(testResponse.beltStatus).to(equal(vehicleDataResult));
+ expect(testResponse.bodyInformation).to(equal(vehicleDataResult));
+ expect(testResponse.deviceStatus).to(equal(vehicleDataResult));
+ expect(testResponse.driverBraking).to(equal(vehicleDataResult));
+ expect(testResponse.wiperStatus).to(equal(vehicleDataResult));
+ expect(testResponse.headLampStatus).to(equal(vehicleDataResult));
+ expect(testResponse.engineOilLife).to(equal(vehicleDataResult));
+ expect(testResponse.engineTorque).to(equal(vehicleDataResult));
+ expect(testResponse.accPedalPosition).to(equal(vehicleDataResult));
+ expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult));
+ expect(testResponse.eCallInfo).to(equal(vehicleDataResult));
+ expect(testResponse.airbagStatus).to(equal(vehicleDataResult));
+ expect(testResponse.emergencyEvent).to(equal(vehicleDataResult));
+ expect(testResponse.clusterModes).to(equal(vehicleDataResult));
+ expect(testResponse.myKey).to(equal(vehicleDataResult));
+ expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult));
+ expect(testResponse.turnSignal).to(equal(vehicleDataResult));
+ expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult));
+ expect(testResponse.handsOffSteering).to(equal(vehicleDataResult));
+ });
+ });
+
+ it(@"should set and get OEM Custom Vehicle Data", ^{
SDLUnsubscribeVehicleDataResponse *testRequest = [[SDLUnsubscribeVehicleDataResponse alloc] init];
[testRequest setOEMCustomVehicleData:@"customOEMVehicleData" withVehicleDataState:customOEMvehicleDataResult];