diff options
author | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2020-08-06 09:39:26 +0300 |
---|---|---|
committer | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2020-08-06 11:30:19 +0300 |
commit | 0d0382314049a0196a533723eb1525c21dbb597a (patch) | |
tree | 265e9843ed46471fa42084c264ef60c4653b199b | |
parent | 706c1de93e4841034e34f66e765751d5938ae3bf (diff) | |
download | sdl_ios-0d0382314049a0196a533723eb1525c21dbb597a.tar.gz |
sdl-0253 "New vehicle data StabilityControlsStatus": code review, revert extra changes to the develop branch.
26 files changed, 958 insertions, 1789 deletions
diff --git a/SmartDeviceLink/SDLGetVehicleData.h b/SmartDeviceLink/SDLGetVehicleData.h index 06e96453c..a3632f181 100644 --- a/SmartDeviceLink/SDLGetVehicleData.h +++ b/SmartDeviceLink/SDLGetVehicleData.h @@ -1,150 +1,124 @@ -/* - * 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. - */ +// SDLGetVehicleData.h +// -#import "SDLRPCRequest.h" - -@class SDLFuelRange; -NS_ASSUME_NONNULL_BEGIN +#import "SDLRPCRequest.h" /** - * Non periodic vehicle data read request. + * Requests current values of specific published vehicle data items. * - * @since SDL 2.0.0 + * Function Group: Location, VehicleInfo and DrivingChara + * HMILevel needs to be FULL, LIMITED or BACKGROUND + * Since SmartDeviceLink 2.0 + * See SDLSubscribeVehicleData, SDLUnsubscribeVehicleData */ + +NS_ASSUME_NONNULL_BEGIN + @interface SDLGetVehicleData : SDLRPCRequest /** * Convenience init for getting data for all possible vehicle data items. * - * @param accelerationPedalPosition Get accelerationPedalPosition data - * @param airbagStatus Get airbagStatus data - * @param beltStatus Get beltStatus data - * @param bodyInformation Get bodyInformation data - * @param clusterModeStatus Get clusterModeStatus data - * @param deviceStatus Get deviceStatus data - * @param driverBraking Get driverBraking data - * @param eCallInfo Get eCallInfo data - * @param emergencyEvent Get emergencyEvent data - * @param engineTorque Get engineTorque data - * @param externalTemperature Get externalTemperature data - * @param fuelLevel Get fuelLevel data - * @param fuelLevelState Get fuelLevelState data - * @param gps Get gps data - * @param headLampStatus Get headLampStatus data - * @param instantFuelConsumption Get instantFuelConsumption data - * @param myKey Get myKey data - * @param odometer Get odometer data - * @param prndl Get prndl data - * @param rpm Get rpm data - * @param speed Get speed data - * @param steeringWheelAngle Get steeringWheelAngle data - * @param tirePressure Get tirePressure data - * @param vin Get vin data - * @param wiperStatus Get wiperStatus data - * @return A SDLGetVehicleData object + * @param accelerationPedalPosition Get accelerationPedalPosition data + * @param airbagStatus Get airbagStatus data + * @param beltStatus Get beltStatus data + * @param bodyInformation Get bodyInformation data + * @param clusterModeStatus Get clusterModeStatus data + * @param deviceStatus Get deviceStatus data + * @param driverBraking Get driverBraking data + * @param eCallInfo Get eCallInfo data + * @param emergencyEvent Get emergencyEvent data + * @param engineTorque Get engineTorque data + * @param externalTemperature Get externalTemperature data + * @param fuelLevel Get fuelLevel data + * @param fuelLevelState Get fuelLevelState data + * @param gps Get gps data + * @param headLampStatus Get headLampStatus data + * @param instantFuelConsumption Get instantFuelConsumption data + * @param myKey Get myKey data + * @param odometer Get odometer data + * @param prndl Get prndl data + * @param rpm Get rpm data + * @param speed Get speed data + * @param steeringWheelAngle Get steeringWheelAngle data + * @param tirePressure Get tirePressure data + * @param vin Get vin data + * @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 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:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); /** * Convenience init for getting data for all possible vehicle data items. * - * @param accelerationPedalPosition Get accelerationPedalPosition data - * @param airbagStatus Get airbagStatus data - * @param beltStatus Get beltStatus data - * @param bodyInformation Get bodyInformation data - * @param clusterModeStatus Get clusterModeStatus data - * @param deviceStatus Get deviceStatus data - * @param driverBraking Get driverBraking data - * @param eCallInfo Get eCallInfo data - * @param electronicParkBrakeStatus Get electronicParkBrakeStatus data - * @param emergencyEvent Get emergencyEvent data - * @param engineOilLife Get engineOilLife data - * @param engineTorque Get engineTorque data - * @param externalTemperature Get externalTemperature data - * @param fuelLevel Get fuelLevel data - * @param fuelLevelState Get fuelLevelState data - * @param fuelRange Get fuelRange data - * @param gps Get gps data - * @param headLampStatus Get headLampStatus data - * @param instantFuelConsumption Get instantFuelConsumption data - * @param myKey Get myKey data - * @param odometer Get odometer data - * @param prndl Get prndl data - * @param rpm Get rpm data - * @param speed Get speed data - * @param steeringWheelAngle Get steeringWheelAngle data - * @param tirePressure Get tirePressure data - * @param turnSignal Get turnSignal data - * @param vin Get vin data - * @param wiperStatus Get wiperStatus data - * @return A SDLGetVehicleData object + * @param accelerationPedalPosition Get accelerationPedalPosition data + * @param airbagStatus Get airbagStatus data + * @param beltStatus Get beltStatus data + * @param bodyInformation Get bodyInformation data + * @param clusterModeStatus Get clusterModeStatus data + * @param deviceStatus Get deviceStatus data + * @param driverBraking Get driverBraking data + * @param eCallInfo Get eCallInfo data + * @param electronicParkBrakeStatus Get electronicParkBrakeStatus data + * @param emergencyEvent Get emergencyEvent data + * @param engineOilLife Get engineOilLife data + * @param engineTorque Get engineTorque data + * @param externalTemperature Get externalTemperature data + * @param fuelLevel Get fuelLevel data + * @param fuelLevelState Get fuelLevelState data + * @param fuelRange Get fuelRange data + * @param gps Get gps data + * @param headLampStatus Get headLampStatus data + * @param instantFuelConsumption Get instantFuelConsumption data + * @param myKey Get myKey data + * @param odometer Get odometer data + * @param prndl Get prndl data + * @param rpm Get rpm data + * @param speed Get speed data + * @param steeringWheelAngle Get steeringWheelAngle data + * @param tirePressure Get tirePressure data + * @param turnSignal Get turnSignal data + * @param vin Get vin data + * @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 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:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); /** * Convenience init for getting data for all possible vehicle data items. * - * @param accelerationPedalPosition Get accelerationPedalPosition data - * @param airbagStatus Get airbagStatus data - * @param beltStatus Get beltStatus data - * @param bodyInformation Get bodyInformation data - * @param cloudAppVehicleID Get cloudAppVehicleID data - * @param clusterModeStatus Get clusterModeStatus data - * @param deviceStatus Get deviceStatus data - * @param driverBraking Get driverBraking data - * @param eCallInfo Get eCallInfo data - * @param electronicParkBrakeStatus Get electronicParkBrakeStatus data - * @param emergencyEvent Get emergencyEvent data - * @param engineOilLife Get engineOilLife data - * @param engineTorque Get engineTorque data - * @param externalTemperature Get externalTemperature data - * @param fuelLevel Get fuelLevel data - * @param fuelLevelState Get fuelLevelState data - * @param fuelRange Get fuelRange data - * @param gps Get gps data - * @param headLampStatus Get headLampStatus data - * @param instantFuelConsumption Get instantFuelConsumption data - * @param myKey Get myKey data - * @param odometer Get odometer data - * @param prndl Get prndl data - * @param rpm Get rpm data - * @param speed Get speed data - * @param steeringWheelAngle Get steeringWheelAngle data - * @param tirePressure Get tirePressure data - * @param turnSignal Get turnSignal data - * @param vin Get vin data - * @param wiperStatus Get wiperStatus data - * @return A SDLGetVehicleData object + * @param accelerationPedalPosition Get accelerationPedalPosition data + * @param airbagStatus Get airbagStatus data + * @param beltStatus Get beltStatus data + * @param bodyInformation Get bodyInformation data + * @param cloudAppVehicleID Get cloudAppVehicleID data + * @param clusterModeStatus Get clusterModeStatus data + * @param deviceStatus Get deviceStatus data + * @param driverBraking Get driverBraking data + * @param eCallInfo Get eCallInfo data + * @param electronicParkBrakeStatus Get electronicParkBrakeStatus data + * @param emergencyEvent Get emergencyEvent data + * @param engineOilLife Get engineOilLife data + * @param engineTorque Get engineTorque data + * @param externalTemperature Get externalTemperature data + * @param fuelLevel Get fuelLevel data + * @param fuelLevelState Get fuelLevelState data + * @param fuelRange Get fuelRange data + * @param gps Get gps data + * @param headLampStatus Get headLampStatus data + * @param instantFuelConsumption Get instantFuelConsumption data + * @param myKey Get myKey data + * @param odometer Get odometer data + * @param prndl Get prndl data + * @param rpm Get rpm data + * @param speed Get speed data + * @param steeringWheelAngle Get steeringWheelAngle data + * @param tirePressure Get tirePressure data + * @param turnSignal Get turnSignal data + * @param vin Get vin data + * @param wiperStatus Get wiperStatus data + * @return A SDLGetVehicleData object */ - (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal vin:(BOOL)vin wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:vin:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); @@ -188,218 +162,156 @@ NS_ASSUME_NONNULL_BEGIN /** * A boolean value. If true, requests GPS data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *gps; /** * A boolean value. If true, requests Speed data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *speed; /** * A boolean value. If true, requests RPM data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *rpm; /** * A boolean value. If true, requests Fuel Level data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelLevel; /** * A boolean value. If true, requests Fuel Level State data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelLevel_State; /** * A boolean value. If true, requests Fuel Range data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelRange; /** * A boolean value. If true, requests Instant Fuel Consumption data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *instantFuelConsumption; /** * A boolean value. If true, requests External Temperature data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *externalTemperature; /** * A boolean value. If true, requests the Vehicle Identification Number. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *vin; /** * A boolean value. If true, requests PRNDL data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *prndl; /** * A boolean value. If true, requests Tire Pressure data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *tirePressure; /** * A boolean value. If true, requests Odometer data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *odometer; /** * A boolean value. If true, requests Belt Status data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *beltStatus; /** * A boolean value. If true, requests Body Information data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *bodyInformation; /** * A boolean value. If true, requests Device Status data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *deviceStatus; /** * A boolean value. If true, requests Driver Braking data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *driverBraking; /** * A boolean value. If true, requests Wiper Status data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *wiperStatus; /** * A boolean value. If true, requests Head Lamp Status data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *headLampStatus; /** * A boolean value. If true, requests Engine Oil Life data. - * - * Optional. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *engineOilLife; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *engineOilLife; /** * A boolean value. If true, requests Engine Torque data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *engineTorque; /** * A boolean value. If true, requests Acc Pedal Position data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *accPedalPosition; /** * A boolean value. If true, requests Steering Wheel Angle data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *steeringWheelAngle; /** * A boolean value. If true, requests Emergency Call Info data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *eCallInfo; /** * A boolean value. If true, requests Air Bag Status data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *airbagStatus; /** * A boolean value. If true, requests Emergency Event (if it occurred) data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *emergencyEvent; /** * A boolean value. If true, requests Cluster Mode Status data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *clusterModeStatus; /** * A boolean value. If true, requests MyKey data. - * - * Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *myKey; /** A boolean value. If true, requests Electronic Parking Brake status data. - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *electronicParkBrakeStatus; /** A boolean value. If true, requests Turn Signal data. - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *turnSignal; /** A boolean value. If true, requests the Cloud App Vehicle ID. - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *cloudAppVehicleID; /** - * A boolean value. If true, requests StabilityControlsStatus data. - * - * @since SDL 7.0.0 + A boolean value. If true, requests StabilityControlsStatus data. */ @property (nullable, strong, nonatomic) NSNumber<SDLBool> *stabilityControlsStatus; diff --git a/SmartDeviceLink/SDLGetVehicleData.m b/SmartDeviceLink/SDLGetVehicleData.m index b441ab668..63a113a34 100644 --- a/SmartDeviceLink/SDLGetVehicleData.m +++ b/SmartDeviceLink/SDLGetVehicleData.m @@ -1,39 +1,12 @@ -/* - * 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. - */ +// SDLGetVehicleData.m +// + -#import "NSMutableDictionary+Store.h" #import "SDLGetVehicleData.h" -#import "SDLRPCFunctionNames.h" + +#import "NSMutableDictionary+Store.h" #import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" NS_ASSUME_NONNULL_BEGIN @@ -106,8 +79,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)gps { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:NSNumber.class error:nil]; } - (void)setSpeed:(nullable NSNumber<SDLBool> *)speed { @@ -115,8 +87,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)speed { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class error:nil]; } - (void)setRpm:(nullable NSNumber<SDLBool> *)rpm { @@ -124,8 +95,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)rpm { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class error:nil]; } - (void)setFuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel { @@ -133,8 +103,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class error:nil]; } - (void)setFuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State { @@ -142,8 +111,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel_State { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:NSNumber.class error:nil]; } - (void)setFuelRange:(nullable NSNumber<SDLBool> *)fuelRange { @@ -151,8 +119,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelRange { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:NSNumber.class error:nil]; } - (void)setInstantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption { @@ -160,8 +127,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)instantFuelConsumption { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class error:nil]; } - (void)setExternalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature { @@ -169,8 +135,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)externalTemperature { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class error:nil]; } - (void)setVin:(nullable NSNumber<SDLBool> *)vin { @@ -178,8 +143,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)vin { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameVIN ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameVIN ofClass:NSNumber.class error:nil]; } - (void)setPrndl:(nullable NSNumber<SDLBool> *)prndl { @@ -187,8 +151,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)prndl { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:NSNumber.class error:nil]; } - (void)setTirePressure:(nullable NSNumber<SDLBool> *)tirePressure { @@ -196,8 +159,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)tirePressure { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:NSNumber.class error:nil]; } - (void)setOdometer:(nullable NSNumber<SDLBool> *)odometer { @@ -205,8 +167,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)odometer { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class error:nil]; } - (void)setBeltStatus:(nullable NSNumber<SDLBool> *)beltStatus { @@ -214,8 +175,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)beltStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:NSNumber.class error:nil]; } - (void)setBodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation { @@ -223,8 +183,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)bodyInformation { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:NSNumber.class error:nil]; } - (void)setDeviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus { @@ -232,8 +191,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)deviceStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:NSNumber.class error:nil]; } - (void)setDriverBraking:(nullable NSNumber<SDLBool> *)driverBraking { @@ -241,8 +199,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)driverBraking { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:NSNumber.class error:nil]; } - (void)setWiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus { @@ -250,8 +207,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)wiperStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:NSNumber.class error:nil]; } - (void)setHeadLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus { @@ -259,8 +215,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)headLampStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:NSNumber.class error:nil]; } - (void)setEngineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife { @@ -268,8 +223,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineOilLife { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class error:nil]; } - (void)setEngineTorque:(nullable NSNumber<SDLBool> *)engineTorque { @@ -277,8 +231,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineTorque { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class error:nil]; } - (void)setAccPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition { @@ -286,8 +239,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)accPedalPosition { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class error:nil]; } - (void)setSteeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle { @@ -295,8 +247,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)steeringWheelAngle { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class error:nil]; } - (void)setECallInfo:(nullable NSNumber<SDLBool> *)eCallInfo { @@ -304,8 +255,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)eCallInfo { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:NSNumber.class error:nil]; } - (void)setAirbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus { @@ -313,8 +263,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)airbagStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:NSNumber.class error:nil]; } - (void)setEmergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent { @@ -322,8 +271,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)emergencyEvent { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:NSNumber.class error:nil]; } - (void)setClusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus { @@ -331,8 +279,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)clusterModeStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:NSNumber.class error:nil]; } - (void)setMyKey:(nullable NSNumber<SDLBool> *)myKey { @@ -340,8 +287,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)myKey { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:NSNumber.class error:nil]; } - (void)setElectronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { @@ -349,8 +295,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:NSNumber.class error:nil]; } - (void)setTurnSignal:(nullable NSNumber<SDLBool> *)turnSignal { @@ -358,8 +303,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)turnSignal { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:NSNumber.class error:nil]; } - (void)setCloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID { @@ -367,8 +311,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)cloudAppVehicleID { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameCloudAppVehicleID ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameCloudAppVehicleID ofClass:NSNumber.class error:nil]; } - (void)setStabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus { @@ -385,8 +328,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)getOEMCustomVehicleData:(NSString *)vehicleDataName { - NSError *error = nil; - return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:nil]; } @end diff --git a/SmartDeviceLink/SDLGetVehicleDataResponse.h b/SmartDeviceLink/SDLGetVehicleDataResponse.h index 2590b807f..a965ef9f0 100644 --- a/SmartDeviceLink/SDLGetVehicleDataResponse.h +++ b/SmartDeviceLink/SDLGetVehicleDataResponse.h @@ -1,39 +1,11 @@ -/* - * 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. - */ +// SDLGetVehicleDataResponse.h +// + +#import "SDLRPCResponse.h" #import "SDLComponentVolumeStatus.h" #import "SDLElectronicParkBrakeStatus.h" #import "SDLPRNDL.h" -#import "SDLRPCResponse.h" #import "SDLTurnSignal.h" #import "SDLVehicleDataEventStatus.h" #import "SDLWiperStatus.h" @@ -52,11 +24,15 @@ @class SDLStabilityControlsStatus; @class SDLTireStatus; -NS_ASSUME_NONNULL_BEGIN /** - * @since SDL 2.0.0 + * Response to SDLGetVehicleData + * + * Since SmartDeviceLink 2.0 */ + +NS_ASSUME_NONNULL_BEGIN + @interface SDLGetVehicleDataResponse : SDLRPCResponse /** @@ -99,36 +75,26 @@ NS_ASSUME_NONNULL_BEGIN /** The car current GPS coordinates - - Optional. */ @property (nullable, strong, nonatomic) SDLGPSData *gps; /** The vehicle speed in kilometers per hour - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLFloat> *speed; /** The number of revolutions per minute of the engine. - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLInt> *rpm; /** The fuel level in the tank (percentage) - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLFloat> *fuelLevel; /** The fuel level state - - Optional. */ @property (nullable, strong, nonatomic) SDLComponentVolumeStatus fuelLevel_State; @@ -141,169 +107,121 @@ NS_ASSUME_NONNULL_BEGIN /** The instantaneous fuel consumption in microlitres - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLFloat> *instantFuelConsumption; /** The external temperature in degrees celsius. - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLFloat> *externalTemperature; /** The Vehicle Identification Number - - Optional. */ @property (nullable, strong, nonatomic) NSString *vin; /** The current gear shift state of the user's vehicle - - Optional. */ @property (nullable, strong, nonatomic) SDLPRNDL prndl; /** The current pressure warnings for the user's vehicle - - Optional. */ @property (nullable, strong, nonatomic) SDLTireStatus *tirePressure; /** Odometer reading in km - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLInt> *odometer; /** The status of the seat belts - - Optional. */ @property (nullable, strong, nonatomic) SDLBeltStatus *beltStatus; /** The body information including power modes - - Optional. */ @property (nullable, strong, nonatomic) SDLBodyInformation *bodyInformation; /** The IVI system status including signal and battery strength - - Optional. */ @property (nullable, strong, nonatomic) SDLDeviceStatus *deviceStatus; /** The status of the brake pedal - - Optional. */ @property (nullable, strong, nonatomic) SDLVehicleDataEventStatus driverBraking; /** The status of the wipers - - Optional. */ @property (nullable, strong, nonatomic) SDLWiperStatus wiperStatus; /** Status of the head lamps - - Optional. */ @property (nullable, strong, nonatomic) SDLHeadLampStatus *headLampStatus; /** The estimated percentage (0% - 100%) of remaining oil life of the engine - - Optional. */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *engineOilLife; +@property (strong, nonatomic, nullable) NSNumber<SDLFloat> *engineOilLife; /** Torque value for engine (in Nm) on non-diesel variants - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLFloat> *engineTorque; /** Accelerator pedal position (percentage depressed) - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLFloat> *accPedalPosition; /** Current angle of the steering wheel (in deg) - - Optional. */ @property (nullable, strong, nonatomic) NSNumber<SDLFloat> *steeringWheelAngle; /** Emergency Call notification and confirmation data - - Optional. */ @property (nullable, strong, nonatomic) SDLECallInfo *eCallInfo; /** The status of the air bags - - Optional. */ @property (nullable, strong, nonatomic) SDLAirbagStatus *airbagStatus; /** Information related to an emergency event (and if it occurred) - - Optional. */ @property (nullable, strong, nonatomic) SDLEmergencyEvent *emergencyEvent; /** The status modes of the cluster - - Optional. */ @property (nullable, strong, nonatomic) SDLClusterModeStatus *clusterModeStatus; /** Information related to the MyKey feature - - Optional. */ @property (nullable, strong, nonatomic) SDLMyKey *myKey; /** The status of the electronic parking brake - - Optional. */ @property (nullable, strong, nonatomic) SDLElectronicParkBrakeStatus electronicParkBrakeStatus; /** The status of the turn signal - - Optional. */ @property (nullable, strong, nonatomic) SDLTurnSignal turnSignal; /** The cloud app vehicle ID - - Optional. */ @property (nullable, strong, nonatomic) NSString *cloudAppVehicleID; diff --git a/SmartDeviceLink/SDLGetVehicleDataResponse.m b/SmartDeviceLink/SDLGetVehicleDataResponse.m index 6941b514e..574863ee0 100644 --- a/SmartDeviceLink/SDLGetVehicleDataResponse.m +++ b/SmartDeviceLink/SDLGetVehicleDataResponse.m @@ -1,58 +1,25 @@ -/* - * 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. - */ +// SDLGetVehicleDataResponse.m +// + #import "SDLGetVehicleDataResponse.h" + #import "NSMutableDictionary+Store.h" -#import "SDLWiperStatus.h" +#import "SDLAirbagStatus.h" +#import "SDLBeltStatus.h" #import "SDLBodyInformation.h" #import "SDLClusterModeStatus.h" -#import "SDLComponentVolumeStatus.h" -#import "SDLPRNDL.h" -#import "SDLVehicleDataEventStatus.h" -#import "SDLMyKey.h" #import "SDLDeviceStatus.h" -#import "SDLTireStatus.h" -#import "SDLBeltStatus.h" -#import "SDLStabilityControlsStatus.h" #import "SDLECallInfo.h" -#import "SDLTurnSignal.h" -#import "SDLFuelRange.h" -#import "SDLAirbagStatus.h" -#import "SDLHeadLampStatus.h" #import "SDLEmergencyEvent.h" -#import "SDLElectronicParkBrakeStatus.h" +#import "SDLFuelRange.h" #import "SDLGPSData.h" -#import "SDLRPCFunctionNames.h" +#import "SDLHeadLampStatus.h" +#import "SDLMyKey.h" #import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" +#import "SDLStabilityControlsStatus.h" +#import "SDLTireStatus.h" NS_ASSUME_NONNULL_BEGIN @@ -113,8 +80,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLGPSData *)gps { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:SDLGPSData.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:SDLGPSData.class error:nil]; } - (void)setSpeed:(nullable NSNumber<SDLFloat> *)speed { @@ -122,8 +88,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)speed { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class error:nil]; } - (void)setRpm:(nullable NSNumber<SDLInt> *)rpm { @@ -131,8 +96,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)rpm { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class error:nil]; } - (void)setFuelLevel:(nullable NSNumber<SDLFloat> *)fuelLevel { @@ -140,8 +104,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)fuelLevel { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class error:nil]; } - (void)setFuelLevel_State:(nullable SDLComponentVolumeStatus)fuelLevel_State { @@ -149,8 +112,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLComponentVolumeStatus)fuelLevel_State { - NSError *error = nil; - return [self.parameters sdl_enumForName:SDLRPCParameterNameFuelLevelState error:&error]; + return [self.parameters sdl_enumForName:SDLRPCParameterNameFuelLevelState error:nil]; } - (void)setInstantFuelConsumption:(nullable NSNumber<SDLFloat> *)instantFuelConsumption { @@ -162,13 +124,11 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSArray<SDLFuelRange *> *)fuelRange { - NSError *error = nil; - return [self.parameters sdl_objectsForName:SDLRPCParameterNameFuelRange ofClass:SDLFuelRange.class error:&error]; + return [self.parameters sdl_objectsForName:SDLRPCParameterNameFuelRange ofClass:SDLFuelRange.class error:nil]; } - (nullable NSNumber<SDLFloat> *)instantFuelConsumption { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class error:nil]; } - (void)setExternalTemperature:(nullable NSNumber<SDLFloat> *)externalTemperature { @@ -176,8 +136,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)externalTemperature { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class error:nil]; } - (void)setVin:(nullable NSString *)vin { @@ -185,8 +144,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)vin { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameVIN ofClass:NSString.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameVIN ofClass:NSString.class error:nil]; } - (void)setPrndl:(nullable SDLPRNDL)prndl { @@ -194,8 +152,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLPRNDL)prndl { - NSError *error = nil; - return [self.parameters sdl_enumForName:SDLRPCParameterNamePRNDL error:&error]; + return [self.parameters sdl_enumForName:SDLRPCParameterNamePRNDL error:nil]; } - (void)setTirePressure:(nullable SDLTireStatus *)tirePressure { @@ -203,8 +160,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLTireStatus *)tirePressure { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:SDLTireStatus.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:SDLTireStatus.class error:nil]; } - (void)setOdometer:(nullable NSNumber<SDLInt> *)odometer { @@ -212,8 +168,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLInt> *)odometer { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class error:nil]; } - (void)setBeltStatus:(nullable SDLBeltStatus *)beltStatus { @@ -221,8 +176,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLBeltStatus *)beltStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:SDLBeltStatus.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:SDLBeltStatus.class error:nil]; } - (void)setBodyInformation:(nullable SDLBodyInformation *)bodyInformation { @@ -230,8 +184,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLBodyInformation *)bodyInformation { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:SDLBodyInformation.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:SDLBodyInformation.class error:nil]; } - (void)setDeviceStatus:(nullable SDLDeviceStatus *)deviceStatus { @@ -239,8 +192,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLDeviceStatus *)deviceStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:SDLDeviceStatus.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:SDLDeviceStatus.class error:nil]; } - (void)setDriverBraking:(nullable SDLVehicleDataEventStatus)driverBraking { @@ -248,8 +200,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataEventStatus)driverBraking { - NSError *error = nil; - return [self.parameters sdl_enumForName:SDLRPCParameterNameDriverBraking error:&error]; + return [self.parameters sdl_enumForName:SDLRPCParameterNameDriverBraking error:nil]; } - (void)setWiperStatus:(nullable SDLWiperStatus)wiperStatus { @@ -257,8 +208,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLWiperStatus)wiperStatus { - NSError *error = nil; - return [self.parameters sdl_enumForName:SDLRPCParameterNameWiperStatus error:&error]; + return [self.parameters sdl_enumForName:SDLRPCParameterNameWiperStatus error:nil]; } - (void)setHeadLampStatus:(nullable SDLHeadLampStatus *)headLampStatus { @@ -266,8 +216,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLHeadLampStatus *)headLampStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:SDLHeadLampStatus.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:SDLHeadLampStatus.class error:nil]; } - (void)setEngineOilLife:(nullable NSNumber<SDLFloat> *)engineOilLife { @@ -275,8 +224,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)engineOilLife { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class error:nil]; } - (void)setEngineTorque:(nullable NSNumber<SDLFloat> *)engineTorque { @@ -284,8 +232,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)engineTorque { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class error:nil]; } - (void)setAccPedalPosition:(nullable NSNumber<SDLFloat> *)accPedalPosition { @@ -293,8 +240,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)accPedalPosition { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class error:nil]; } - (void)setSteeringWheelAngle:(nullable NSNumber<SDLFloat> *)steeringWheelAngle { @@ -302,8 +248,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLFloat> *)steeringWheelAngle { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class error:nil]; } - (void)setECallInfo:(nullable SDLECallInfo *)eCallInfo { @@ -311,8 +256,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLECallInfo *)eCallInfo { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:SDLECallInfo.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:SDLECallInfo.class error:nil]; } - (void)setAirbagStatus:(nullable SDLAirbagStatus *)airbagStatus { @@ -320,8 +264,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLAirbagStatus *)airbagStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:SDLAirbagStatus.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:SDLAirbagStatus.class error:nil]; } - (void)setEmergencyEvent:(nullable SDLEmergencyEvent *)emergencyEvent { @@ -329,8 +272,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLEmergencyEvent *)emergencyEvent { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:SDLEmergencyEvent.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:SDLEmergencyEvent.class error:nil]; } - (void)setClusterModeStatus:(nullable SDLClusterModeStatus *)clusterModeStatus { @@ -338,8 +280,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLClusterModeStatus *)clusterModeStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:SDLClusterModeStatus.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:SDLClusterModeStatus.class error:nil]; } - (void)setMyKey:(nullable SDLMyKey *)myKey { @@ -347,8 +288,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLMyKey *)myKey { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:SDLMyKey.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:SDLMyKey.class error:nil]; } - (void)setElectronicParkBrakeStatus:(nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus { @@ -356,8 +296,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLElectronicParkBrakeStatus)electronicParkBrakeStatus { - NSError *error = nil; - return [self.parameters sdl_enumForName:SDLRPCParameterNameElectronicParkBrakeStatus error:&error]; + return [self.parameters sdl_enumForName:SDLRPCParameterNameElectronicParkBrakeStatus error:nil]; } - (void)setTurnSignal:(nullable SDLTurnSignal)turnSignal { @@ -365,8 +304,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLTurnSignal)turnSignal { - NSError *error = nil; - return [self.parameters sdl_enumForName:SDLRPCParameterNameTurnSignal error:&error]; + return [self.parameters sdl_enumForName:SDLRPCParameterNameTurnSignal error:nil]; } - (void)setCloudAppVehicleID:(nullable NSString *)cloudAppVehicleID { @@ -374,8 +312,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSString *)cloudAppVehicleID { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameCloudAppVehicleID ofClass:NSString.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameCloudAppVehicleID ofClass:NSString.class error:nil]; } - (void)setStabilityControlsStatus:(nullable SDLStabilityControlsStatus *)stabilityControlsStatus { @@ -392,8 +329,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSObject *)getOEMCustomVehicleData:(NSString *)vehicleDataName { - NSError *error = nil; - return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSObject.class error:&error]; + return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSObject.class error:nil]; } @end diff --git a/SmartDeviceLink/SDLOnVehicleData.h b/SmartDeviceLink/SDLOnVehicleData.h index 55a08ac8c..25824de78 100644 --- a/SmartDeviceLink/SDLOnVehicleData.h +++ b/SmartDeviceLink/SDLOnVehicleData.h @@ -1,39 +1,11 @@ -/* - * 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. - */ +// SDLOnVehicleData.h +// + +#import "SDLRPCNotification.h" #import "SDLComponentVolumeStatus.h" #import "SDLElectronicParkBrakeStatus.h" #import "SDLPRNDL.h" -#import "SDLRPCNotification.h" #import "SDLTurnSignal.h" #import "SDLVehicleDataEventStatus.h" #import "SDLWiperStatus.h" @@ -52,13 +24,15 @@ @class SDLStabilityControlsStatus; @class SDLTireStatus; -NS_ASSUME_NONNULL_BEGIN /** Callback for the periodic and non periodic vehicle data read function. Since SmartDeviceLink 2.0 */ + +NS_ASSUME_NONNULL_BEGIN + @interface SDLOnVehicleData : SDLRPCNotification /** @@ -99,223 +73,161 @@ NS_ASSUME_NONNULL_BEGIN - (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; /** - Accelerator pedal position (percentage depressed) - - Optional. - */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *accPedalPosition; - -/** - The status of the air bags - - Optional. + The car current GPS coordinates */ -@property (nullable, strong, nonatomic) SDLAirbagStatus *airbagStatus; +@property (nullable, strong, nonatomic) SDLGPSData *gps; /** - The status of the seat belts - - Optional. + The vehicle speed in kilometers per hour */ -@property (nullable, strong, nonatomic) SDLBeltStatus *beltStatus; +@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *speed; /** - The body information including power modes - - Optional. + The number of revolutions per minute of the engine. */ -@property (nullable, strong, nonatomic) SDLBodyInformation *bodyInformation; +@property (nullable, strong, nonatomic) NSNumber<SDLInt> *rpm; /** - The cloud app vehicle ID - - Optional. + The fuel level in the tank (percentage) */ -@property (nullable, strong, nonatomic) NSString *cloudAppVehicleID; +@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *fuelLevel; /** - The status modes of the cluster - - Optional. + The fuel level state */ -@property (nullable, strong, nonatomic) SDLClusterModeStatus *clusterModeStatus; +@property (nullable, strong, nonatomic) SDLComponentVolumeStatus fuelLevel_State; /** - The IVI system status including signal and battery strength + The estimate range in KM the vehicle can travel based on fuel level and consumption - Optional. + Optional, Array of length 0 - 100, of SDLFuelRange */ -@property (nullable, strong, nonatomic) SDLDeviceStatus *deviceStatus; +@property (nullable, strong, nonatomic) NSArray<SDLFuelRange *> *fuelRange; /** - The status of the brake pedal - - Optional. + The instantaneous fuel consumption in microlitres */ -@property (nullable, strong, nonatomic) SDLVehicleDataEventStatus driverBraking; +@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *instantFuelConsumption; /** - Emergency Call notification and confirmation data - - Optional. + The external temperature in degrees celsius. */ -@property (nullable, strong, nonatomic) SDLECallInfo *eCallInfo; +@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *externalTemperature; /** - The status of the electronic parking brake - - Optional. + The Vehicle Identification Number */ -@property (nullable, strong, nonatomic) SDLElectronicParkBrakeStatus electronicParkBrakeStatus; +@property (nullable, strong, nonatomic) NSString *vin; /** - Information related to an emergency event (and if it occurred) - - Optional. + The current gear shift state of the user's vehicle */ -@property (nullable, strong, nonatomic) SDLEmergencyEvent *emergencyEvent; +@property (nullable, strong, nonatomic) SDLPRNDL prndl; /** - The estimated percentage (0% - 100%) of remaining oil life of the engine - - Optional. + The current pressure warnings for the user's vehicle */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *engineOilLife; +@property (nullable, strong, nonatomic) SDLTireStatus *tirePressure; /** - Torque value for engine (in Nm) on non-diesel variants - - Optional. + Odometer reading in km */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *engineTorque; +@property (nullable, strong, nonatomic) NSNumber<SDLInt> *odometer; /** - The external temperature in degrees celsius. - - Optional. + The status of the seat belts */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *externalTemperature; +@property (nullable, strong, nonatomic) SDLBeltStatus *beltStatus; /** - The fuel level in the tank (percentage) - - Optional. + The body information including power modes */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *fuelLevel; +@property (nullable, strong, nonatomic) SDLBodyInformation *bodyInformation; /** - The fuel level state - - Optional. + The IVI system status including signal and battery strength */ -@property (nullable, strong, nonatomic) SDLComponentVolumeStatus fuelLevel_State; +@property (nullable, strong, nonatomic) SDLDeviceStatus *deviceStatus; /** - The estimate range in KM the vehicle can travel based on fuel level and consumption - - Optional, Array of length 0 - 100, of SDLFuelRange + The status of the brake pedal */ -@property (nullable, strong, nonatomic) NSArray<SDLFuelRange *> *fuelRange; +@property (nullable, strong, nonatomic) SDLVehicleDataEventStatus driverBraking; /** - The car current GPS coordinates - - Optional. + The status of the wipers */ -@property (nullable, strong, nonatomic) SDLGPSData *gps; +@property (nullable, strong, nonatomic) SDLWiperStatus wiperStatus; /** Status of the head lamps - - Optional. */ @property (nullable, strong, nonatomic) SDLHeadLampStatus *headLampStatus; /** - The instantaneous fuel consumption in microlitres - - Optional. + The estimated percentage (0% - 100%) of remaining oil life of the engine */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *instantFuelConsumption; +@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *engineOilLife; /** - Information related to the MyKey feature - - Optional. + Torque value for engine (in Nm) on non-diesel variants */ -@property (nullable, strong, nonatomic) SDLMyKey *myKey; +@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *engineTorque; /** - Odometer reading in km - - Optional. + Accelerator pedal position (percentage depressed) */ -@property (nullable, strong, nonatomic) NSNumber<SDLInt> *odometer; +@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *accPedalPosition; /** - The current gear shift state of the user's vehicle - - Optional. + Current angle of the steering wheel (in deg) */ -@property (nullable, strong, nonatomic) SDLPRNDL prndl; +@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *steeringWheelAngle; /** - The number of revolutions per minute of the engine. - - Optional. + Emergency Call notification and confirmation data */ -@property (nullable, strong, nonatomic) NSNumber<SDLInt> *rpm; +@property (nullable, strong, nonatomic) SDLECallInfo *eCallInfo; /** - The vehicle speed in kilometers per hour - - Optional. + The status of the air bags */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *speed; +@property (nullable, strong, nonatomic) SDLAirbagStatus *airbagStatus; /** - * See StabilityControlsStatus - * - * Optional. - * - * @since SDL 7.0.0 + Information related to an emergency event (and if it occurred) */ -@property (nullable, strong, nonatomic) SDLStabilityControlsStatus *stabilityControlsStatus; +@property (nullable, strong, nonatomic) SDLEmergencyEvent *emergencyEvent; /** - Current angle of the steering wheel (in deg) - - Optional. + The status modes of the cluster */ -@property (nullable, strong, nonatomic) NSNumber<SDLFloat> *steeringWheelAngle; +@property (nullable, strong, nonatomic) SDLClusterModeStatus *clusterModeStatus; /** - The current pressure warnings for the user's vehicle - - Optional. + Information related to the MyKey feature */ -@property (nullable, strong, nonatomic) SDLTireStatus *tirePressure; +@property (nullable, strong, nonatomic) SDLMyKey *myKey; /** - The status of the turn signal - - Optional. + The status of the electronic parking brake */ -@property (nullable, strong, nonatomic) SDLTurnSignal turnSignal; +@property (nullable, strong, nonatomic) SDLElectronicParkBrakeStatus electronicParkBrakeStatus; /** - The Vehicle Identification Number - - Optional. + See StabilityControlsStatus */ -@property (nullable, strong, nonatomic) NSString *vin; +@property (nullable, strong, nonatomic) SDLStabilityControlsStatus *stabilityControlsStatus; /** - The status of the wipers + The status of the turn signal + */ +@property (nullable, strong, nonatomic) SDLTurnSignal turnSignal; - Optional. +/** + The cloud app vehicle ID */ -@property (nullable, strong, nonatomic) SDLWiperStatus wiperStatus; +@property (nullable, strong, nonatomic) NSString *cloudAppVehicleID; /** Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. diff --git a/SmartDeviceLink/SDLOnVehicleData.m b/SmartDeviceLink/SDLOnVehicleData.m index 2b182bf68..54d7af935 100644 --- a/SmartDeviceLink/SDLOnVehicleData.m +++ b/SmartDeviceLink/SDLOnVehicleData.m @@ -1,58 +1,24 @@ -/* - * 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. - */ +// SDLOnVehicleData.m +// + +#import "SDLOnVehicleData.h" #import "NSMutableDictionary+Store.h" #import "SDLAirbagStatus.h" #import "SDLBeltStatus.h" #import "SDLBodyInformation.h" #import "SDLClusterModeStatus.h" -#import "SDLComponentVolumeStatus.h" #import "SDLDeviceStatus.h" #import "SDLECallInfo.h" -#import "SDLElectronicParkBrakeStatus.h" #import "SDLEmergencyEvent.h" #import "SDLFuelRange.h" #import "SDLGPSData.h" #import "SDLHeadLampStatus.h" #import "SDLMyKey.h" -#import "SDLOnVehicleData.h" -#import "SDLPRNDL.h" -#import "SDLRPCFunctionNames.h" #import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLStabilityControlsStatus.h" #import "SDLTireStatus.h" -#import "SDLTurnSignal.h" -#import "SDLVehicleDataEventStatus.h" -#import "SDLWiperStatus.h" NS_ASSUME_NONNULL_BEGIN @@ -352,7 +318,8 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLStabilityControlsStatus *)stabilityControlsStatus { - return [self.parameters sdl_objectForName:SDLRPCParameterNameStabilityControlsStatus ofClass:SDLStabilityControlsStatus.class error:nil]; + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameStabilityControlsStatus ofClass:SDLStabilityControlsStatus.class error:&error]; } - (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(NSObject *)vehicleDataState { diff --git a/SmartDeviceLink/SDLRPCParameterNames.h b/SmartDeviceLink/SDLRPCParameterNames.h index 02f315356..2641de4de 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.h +++ b/SmartDeviceLink/SDLRPCParameterNames.h @@ -1,35 +1,5 @@ -/* - * 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" @@ -199,6 +169,8 @@ extern SDLRPCParameterName const SDLRPCParameterNameDriverBeltDeployed; extern SDLRPCParameterName const SDLRPCParameterNameDriverBraking; extern SDLRPCParameterName const SDLRPCParameterNameDriverBuckleBelted; extern SDLRPCParameterName const SDLRPCParameterNameDriverCurtainAirbagDeployed; +extern SDLRPCParameterName const SDLRPCParameterNameDriverDistraction; +extern SDLRPCParameterName const SDLRPCParameterNameDriverDistractionCapability; extern SDLRPCParameterName const SDLRPCParameterNameDriverDistractionStatus; extern SDLRPCParameterName const SDLRPCParameterNameDriverDoorAjar; extern SDLRPCParameterName const SDLRPCParameterNameDriverKneeAirbagDeployed; @@ -387,7 +359,6 @@ extern SDLRPCParameterName const SDLRPCParameterNameMassageEnabled; extern SDLRPCParameterName const SDLRPCParameterNameMassageEnabledAvailable; extern SDLRPCParameterName const SDLRPCParameterNameMassageMode; extern SDLRPCParameterName const SDLRPCParameterNameMassageModeAvailable; -extern SDLRPCParameterName const SDLRPCParameterNameMemoryAvailable; extern SDLRPCParameterName const SDLRPCParameterNameMassageZone; extern SDLRPCParameterName const SDLRPCParameterNameMaxBitrate; extern SDLRPCParameterName const SDLRPCParameterNameMaxDuration; @@ -408,10 +379,12 @@ extern SDLRPCParameterName const SDLRPCParameterNameMediaTrack; extern SDLRPCParameterName const SDLRPCParameterNameMediaImage; extern SDLRPCParameterName const SDLRPCParameterNameMediaType; extern SDLRPCParameterName const SDLRPCParameterNameMemory; +extern SDLRPCParameterName const SDLRPCParameterNameMemoryAvailable; extern SDLRPCParameterName const SDLRPCParameterNameMenuIcon; extern SDLRPCParameterName const SDLRPCParameterNameMenuId; extern SDLRPCParameterName const SDLRPCParameterNameMenuLayout; extern SDLRPCParameterName const SDLRPCParameterNameMenuLayoutsAvailable; +extern SDLRPCParameterName const SDLRPCParameterNameMenuLength; extern SDLRPCParameterName const SDLRPCParameterNameMenuName; extern SDLRPCParameterName const SDLRPCParameterNameMenuParams; extern SDLRPCParameterName const SDLRPCParameterNameMenuTitle; @@ -622,8 +595,8 @@ extern SDLRPCParameterName const SDLRPCParameterNameSourceAvailable; extern SDLRPCParameterName const SDLRPCParameterNameSpaceAvailable; extern SDLRPCParameterName const SDLRPCParameterNameSpeechCapabilities; extern SDLRPCParameterName const SDLRPCParameterNameSpeed; -extern SDLRPCParameterName const SDLRPCParameterNameStabilityControlsStatus; extern SDLRPCParameterName const SDLRPCParameterNameRGBColorSpaceAvailable; +extern SDLRPCParameterName const SDLRPCParameterNameStabilityControlsStatus; extern SDLRPCParameterName const SDLRPCParameterNameStartTime; extern SDLRPCParameterName const SDLRPCParameterNameState; extern SDLRPCParameterName const SDLRPCParameterNameStateAvailable; @@ -640,6 +613,7 @@ extern SDLRPCParameterName const SDLRPCParameterNameSteeringWheelAngle; extern SDLRPCParameterName const SDLRPCParameterNameStereoAudioOutputMuted; extern SDLRPCParameterName const SDLRPCParameterNameSubAdministrativeArea; extern SDLRPCParameterName const SDLRPCParameterNameSubLocality; +extern SDLRPCParameterName const SDLRPCParameterNameSubMenuDepth; extern SDLRPCParameterName const SDLRPCParameterNameSubscribe; extern SDLRPCParameterName const SDLRPCParameterNameSubThoroughfare; extern SDLRPCParameterName const SDLRPCParameterNameSuccess; diff --git a/SmartDeviceLink/SDLRPCParameterNames.m b/SmartDeviceLink/SDLRPCParameterNames.m index 7c66f2031..120572109 100644 --- a/SmartDeviceLink/SDLRPCParameterNames.m +++ b/SmartDeviceLink/SDLRPCParameterNames.m @@ -1,35 +1,5 @@ -/* - * 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" @@ -195,6 +165,8 @@ SDLRPCParameterName const SDLRPCParameterNameDriverBeltDeployed = @"driverBeltDe SDLRPCParameterName const SDLRPCParameterNameDriverBraking = @"driverBraking"; SDLRPCParameterName const SDLRPCParameterNameDriverBuckleBelted = @"driverBuckleBelted"; SDLRPCParameterName const SDLRPCParameterNameDriverCurtainAirbagDeployed = @"driverCurtainAirbagDeployed"; +SDLRPCParameterName const SDLRPCParameterNameDriverDistraction = @"driverDistraction"; +SDLRPCParameterName const SDLRPCParameterNameDriverDistractionCapability = @"driverDistractionCapability"; SDLRPCParameterName const SDLRPCParameterNameDriverDistractionStatus = @"driverDistractionStatus"; SDLRPCParameterName const SDLRPCParameterNameDriverDoorAjar = @"driverDoorAjar"; SDLRPCParameterName const SDLRPCParameterNameDriverKneeAirbagDeployed = @"driverKneeAirbagDeployed"; @@ -405,6 +377,7 @@ SDLRPCParameterName const SDLRPCParameterNameMenuIcon = @"menuIcon"; SDLRPCParameterName const SDLRPCParameterNameMenuId = @"menuID"; SDLRPCParameterName const SDLRPCParameterNameMenuLayout = @"menuLayout"; SDLRPCParameterName const SDLRPCParameterNameMenuLayoutsAvailable = @"menuLayoutsAvailable"; +SDLRPCParameterName const SDLRPCParameterNameMenuLength = @"menuLength"; SDLRPCParameterName const SDLRPCParameterNameMenuName = @"menuName"; SDLRPCParameterName const SDLRPCParameterNameMenuParams = @"menuParams"; SDLRPCParameterName const SDLRPCParameterNameMenuTitle = @"menuTitle"; @@ -617,8 +590,8 @@ SDLRPCParameterName const SDLRPCParameterNameSourceAvailable = @"sourceAvailable SDLRPCParameterName const SDLRPCParameterNameSpaceAvailable = @"spaceAvailable"; SDLRPCParameterName const SDLRPCParameterNameSpeechCapabilities = @"speechCapabilities"; SDLRPCParameterName const SDLRPCParameterNameSpeed = @"speed"; -SDLRPCParameterName const SDLRPCParameterNameStabilityControlsStatus = @"stabilityControlsStatus"; SDLRPCParameterName const SDLRPCParameterNameRGBColorSpaceAvailable = @"rgbColorSpaceAvailable"; +SDLRPCParameterName const SDLRPCParameterNameStabilityControlsStatus = @"stabilityControlsStatus"; SDLRPCParameterName const SDLRPCParameterNameStartTime = @"startTime"; SDLRPCParameterName const SDLRPCParameterNameState = @"state"; SDLRPCParameterName const SDLRPCParameterNameStateAvailable = @"stateAvailable"; @@ -635,6 +608,7 @@ SDLRPCParameterName const SDLRPCParameterNameSteeringWheelAngle = @"steeringWhee SDLRPCParameterName const SDLRPCParameterNameStereoAudioOutputMuted = @"stereoAudioOutputMuted"; SDLRPCParameterName const SDLRPCParameterNameSubAdministrativeArea = @"subAdministrativeArea"; SDLRPCParameterName const SDLRPCParameterNameSubLocality = @"subLocality"; +SDLRPCParameterName const SDLRPCParameterNameSubMenuDepth = @"subMenuDepth"; SDLRPCParameterName const SDLRPCParameterNameSubscribe = @"subscribe"; SDLRPCParameterName const SDLRPCParameterNameSubThoroughfare = @"subThoroughfare"; SDLRPCParameterName const SDLRPCParameterNameSuccess = @"success"; diff --git a/SmartDeviceLink/SDLSubscribeVehicleData.h b/SmartDeviceLink/SDLSubscribeVehicleData.h index 26f6e233f..4363bf2ab 100644 --- a/SmartDeviceLink/SDLSubscribeVehicleData.h +++ b/SmartDeviceLink/SDLSubscribeVehicleData.h @@ -1,149 +1,125 @@ -/* - * 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. - */ +// SDLSubscribeVehicleData.h +// -#import "SDLRPCRequest.h" -NS_ASSUME_NONNULL_BEGIN +#import "SDLRPCRequest.h" /** - * Subscribes for specific published data items. The data will be only sent if it has changed. The application will - * be notified by the onVehicleData notification whenever new data is available. To unsubscribe the notifications, - * use unsubscribe with the same subscriptionType. + * Subscribes to specific published vehicle data items. The data will be only sent if it has changed. The application will be notified by the `onVehicleData` notification whenever new data is available. The update rate is dependent on sensors, vehicle architecture and vehicle type. * - * @since SDL 2.0.0 + * @warning A vehicle may only support a subset of the vehicle data items. Be prepared for the situation where a signal is not available on a vehicle. + * + * Function Group: Location, VehicleInfo and DrivingChara + * HMILevel needs to be FULL, LIMITED or BACKGROUND + * Since SmartDeviceLink 2.0 + * See SDLUnsubscribeVehicleData, SDLGetVehicleData */ + +NS_ASSUME_NONNULL_BEGIN + @interface SDLSubscribeVehicleData : SDLRPCRequest /** * Convenience init for subscribing to all possible vehicle data items. * - * @param accelerationPedalPosition Subscribe to accelerationPedalPosition - * @param airbagStatus Subscribe to airbagStatus - * @param beltStatus Subscribe to beltStatus - * @param bodyInformation Subscribe to bodyInformation - * @param clusterModeStatus Subscribe to clusterModeStatus - * @param deviceStatus Subscribe to deviceStatus - * @param driverBraking Subscribe to driverBraking - * @param eCallInfo Subscribe to eCallInfo - * @param emergencyEvent Subscribe to emergencyEvent - * @param engineTorque Subscribe to engineTorque - * @param externalTemperature Subscribe to externalTemperature - * @param fuelLevel Subscribe to fuelLevel - * @param fuelLevelState Subscribe to fuelLevelState - * @param gps Subscribe to gps - * @param headLampStatus Subscribe to headLampStatus - * @param instantFuelConsumption Subscribe to instantFuelConsumption - * @param myKey Subscribe to myKey - * @param odometer Subscribe to odometer - * @param prndl Subscribe to prndl - * @param rpm Subscribe to rpm - * @param speed Subscribe to speed - * @param steeringWheelAngle Subscribe to steeringWheelAngle - * @param tirePressure Subscribe to tirePressure - * @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 initWithGps:(nullable NSNumber<SDLBool> *)gps speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); + * @param accelerationPedalPosition Subscribe to accelerationPedalPosition + * @param airbagStatus Subscribe to airbagStatus + * @param beltStatus Subscribe to beltStatus + * @param bodyInformation Subscribe to bodyInformation + * @param clusterModeStatus Subscribe to clusterModeStatus + * @param deviceStatus Subscribe to deviceStatus + * @param driverBraking Subscribe to driverBraking + * @param eCallInfo Subscribe to eCallInfo + * @param emergencyEvent Subscribe to emergencyEvent + * @param engineTorque Subscribe to engineTorque + * @param externalTemperature Subscribe to externalTemperature + * @param fuelLevel Subscribe to fuelLevel + * @param fuelLevelState Subscribe to fuelLevelState + * @param gps Subscribe to gps + * @param headLampStatus Subscribe to headLampStatus + * @param instantFuelConsumption Subscribe to instantFuelConsumption + * @param myKey Subscribe to myKey + * @param odometer Subscribe to odometer + * @param prndl Subscribe to prndl + * @param rpm Subscribe to rpm + * @param speed Subscribe to speed + * @param steeringWheelAngle Subscribe to steeringWheelAngle + * @param tirePressure Subscribe to tirePressure + * @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 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:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); /** * Convenience init for subscribing to all possible vehicle data items. * - * @param accelerationPedalPosition Subscribe to accelerationPedalPosition - * @param airbagStatus Subscribe to airbagStatus - * @param beltStatus Subscribe to beltStatus - * @param bodyInformation Subscribe to bodyInformation - * @param clusterModeStatus Subscribe to clusterModeStatus - * @param deviceStatus Subscribe to deviceStatus - * @param driverBraking Subscribe to driverBraking - * @param eCallInfo Subscribe to eCallInfo - * @param electronicParkBrakeStatus Subscribe to electronicParkBrakeStatus - * @param emergencyEvent Subscribe to emergencyEvent - * @param engineOilLife Subscribe to engineOilLife - * @param engineTorque Subscribe to engineTorque - * @param externalTemperature Subscribe to externalTemperature - * @param fuelLevel Subscribe to fuelLevel - * @param fuelLevelState Subscribe to fuelLevelState - * @param fuelRange Subscribe to fuelRange - * @param gps Subscribe to gps - * @param headLampStatus Subscribe to headLampStatus - * @param instantFuelConsumption Subscribe to instantFuelConsumption - * @param myKey Subscribe to myKey - * @param odometer Subscribe to odometer - * @param prndl Subscribe to prndl - * @param rpm Subscribe to rpm - * @param speed Subscribe to speed - * @param steeringWheelAngle Subscribe to steeringWheelAngle - * @param tirePressure Subscribe to tirePressure - * @param turnSignal Subscribe to turnSignal - * @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 initWithGps:(nullable NSNumber<SDLBool> *)gps speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); + * @param accelerationPedalPosition Subscribe to accelerationPedalPosition + * @param airbagStatus Subscribe to airbagStatus + * @param beltStatus Subscribe to beltStatus + * @param bodyInformation Subscribe to bodyInformation + * @param clusterModeStatus Subscribe to clusterModeStatus + * @param deviceStatus Subscribe to deviceStatus + * @param driverBraking Subscribe to driverBraking + * @param eCallInfo Subscribe to eCallInfo + * @param electronicParkBrakeStatus Subscribe to electronicParkBrakeStatus + * @param emergencyEvent Subscribe to emergencyEvent + * @param engineOilLife Subscribe to engineOilLife + * @param engineTorque Subscribe to engineTorque + * @param externalTemperature Subscribe to externalTemperature + * @param fuelLevel Subscribe to fuelLevel + * @param fuelLevelState Subscribe to fuelLevelState + * @param fuelRange Subscribe to fuelRange + * @param gps Subscribe to gps + * @param headLampStatus Subscribe to headLampStatus + * @param instantFuelConsumption Subscribe to instantFuelConsumption + * @param myKey Subscribe to myKey + * @param odometer Subscribe to odometer + * @param prndl Subscribe to prndl + * @param rpm Subscribe to rpm + * @param speed Subscribe to speed + * @param steeringWheelAngle Subscribe to steeringWheelAngle + * @param tirePressure Subscribe to tirePressure + * @param turnSignal Subscribe to turnSignal + * @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 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:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); /** * Convenience init for subscribing to all possible vehicle data items. * - * @param accelerationPedalPosition Subscribe to accelerationPedalPosition - * @param airbagStatus Subscribe to airbagStatus - * @param beltStatus Subscribe to beltStatus - * @param bodyInformation Subscribe to bodyInformation - * @param cloudAppVehicleID Subscribe to cloudAppVehicleID - * @param clusterModeStatus Subscribe to clusterModeStatus - * @param deviceStatus Subscribe to deviceStatus - * @param driverBraking Subscribe to driverBraking - * @param eCallInfo Subscribe to eCallInfo - * @param electronicParkBrakeStatus Subscribe to electronicParkBrakeStatus - * @param emergencyEvent Subscribe to emergencyEvent - * @param engineOilLife Subscribe to engineOilLife - * @param engineTorque Subscribe to engineTorque - * @param externalTemperature Subscribe to externalTemperature - * @param fuelLevel Subscribe to fuelLevel - * @param fuelLevelState Subscribe to fuelLevelState - * @param fuelRange Subscribe to fuelRange - * @param gps Subscribe to gps - * @param headLampStatus Subscribe to headLampStatus - * @param instantFuelConsumption Subscribe to instantFuelConsumption - * @param myKey Subscribe to myKey - * @param odometer Subscribe to odometer - * @param prndl Subscribe to prndl - * @param rpm Subscribe to rpm - * @param speed Subscribe to speed - * @param steeringWheelAngle Subscribe to steeringWheelAngle - * @param tirePressure Subscribe to tirePressure - * @param turnSignal Subscribe to turnSignal - * @param wiperStatus Subscribe to wiperStatus - * @return A SDLSubscribeVehicleData object - */ -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:(nullable NSNumber<SDLBool> *)gps speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); + * @param accelerationPedalPosition Subscribe to accelerationPedalPosition + * @param airbagStatus Subscribe to airbagStatus + * @param beltStatus Subscribe to beltStatus + * @param bodyInformation Subscribe to bodyInformation + * @param cloudAppVehicleID Subscribe to cloudAppVehicleID + * @param clusterModeStatus Subscribe to clusterModeStatus + * @param deviceStatus Subscribe to deviceStatus + * @param driverBraking Subscribe to driverBraking + * @param eCallInfo Subscribe to eCallInfo + * @param electronicParkBrakeStatus Subscribe to electronicParkBrakeStatus + * @param emergencyEvent Subscribe to emergencyEvent + * @param engineOilLife Subscribe to engineOilLife + * @param engineTorque Subscribe to engineTorque + * @param externalTemperature Subscribe to externalTemperature + * @param fuelLevel Subscribe to fuelLevel + * @param fuelLevelState Subscribe to fuelLevelState + * @param fuelRange Subscribe to fuelRange + * @param gps Subscribe to gps + * @param headLampStatus Subscribe to headLampStatus + * @param instantFuelConsumption Subscribe to instantFuelConsumption + * @param myKey Subscribe to myKey + * @param odometer Subscribe to odometer + * @param prndl Subscribe to prndl + * @param rpm Subscribe to rpm + * @param speed Subscribe to speed + * @param steeringWheelAngle Subscribe to steeringWheelAngle + * @param tirePressure Subscribe to tirePressure + * @param turnSignal Subscribe to turnSignal + * @param wiperStatus Subscribe to wiperStatus + * @return A SDLSubscribeVehicleData object + */ +- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); /** * Convenience init for subscribing to all possible vehicle data items. @@ -183,216 +159,154 @@ NS_ASSUME_NONNULL_BEGIN - (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 stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey; /** - * A boolean value. If true, subscribes Acc Pedal Position data. - * - * Optional. + * A boolean value. If true, subscribes GPS data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *accPedalPosition; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *gps; /** - * A boolean value. If true, subscribes Airbag Status data. - * - * Optional. + * A boolean value. If true, subscribes Speed data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *airbagStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *speed; /** - * A boolean value. If true, subscribes Belt Status data. - * - * Optional. + * A boolean value. If true, subscribes RPM data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *beltStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *rpm; /** - * A boolean value. If true, subscribes Body Information data. - * - * Optional. + * A boolean value. If true, subscribes Fuel Level data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *bodyInformation; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelLevel; /** - * A boolean value. If true, subscribes to the cloud app vehicle ID. - * - * Optional. + * A boolean value. If true, subscribes Fuel Level State data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *cloudAppVehicleID; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelLevel_State; /** - * A boolean value. If true, subscribes Cluster Mode Status data. - * - * Optional. + * A boolean value. If true, subscribes Fuel Range data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *clusterModeStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelRange; /** - * A boolean value. If true, subscribes Device Status data. - * - * Optional. + * A boolean value. If true, subscribes Instant Fuel Consumption data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *deviceStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *instantFuelConsumption; /** - * A boolean value. If true, subscribes Driver Braking data. - * - * Optional. + * A boolean value. If true, subscribes External Temperature data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *driverBraking; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *externalTemperature; /** - * A boolean value. If true, subscribes eCall Info data. - * - * Optional. + * A boolean value. If true, subscribes PRNDL data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *eCallInfo; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *prndl; /** - * A boolean value. If true, subscribes to the electronic parking brake status. - * - * Optional. + * A boolean value. If true, subscribes Tire Pressure status data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *electronicParkBrakeStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *tirePressure; /** - * A boolean value. If true, subscribes Emergency Event data. - * - * Optional. + * A boolean value. If true, subscribes Odometer data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *emergencyEvent; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *odometer; /** - * A boolean value. If true, subscribes to Engine Oil Life data. - * - * Optional. + * A boolean value. If true, subscribes Belt Status data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *engineOilLife; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *beltStatus; /** - * A boolean value. If true, subscribes Engine Torque data. - * - * Optional. + * A boolean value. If true, subscribes Body Information data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *engineTorque; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *bodyInformation; /** - * A boolean value. If true, subscribes External Temperature data. - * - * Optional. + * A boolean value. If true, subscribes Device Status data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *externalTemperature; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *deviceStatus; /** - * A boolean value. If true, subscribes Fuel Level data. - * - * Optional. + * A boolean value. If true, subscribes Driver Braking data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelLevel; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *driverBraking; /** - * A boolean value. If true, subscribes Fuel Level State data. - * - * Optional. + * A boolean value. If true, subscribes Wiper Status data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelLevel_State; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *wiperStatus; /** - * A boolean value. If true, subscribes Fuel Range data. - * - * Optional. + * A boolean value. If true, subscribes Head Lamp Status data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelRange; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *headLampStatus; /** - * A boolean value. If true, subscribes GPS data. - * - * Optional. + * A boolean value. If true, subscribes to Engine Oil Life data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *gps; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *engineOilLife; /** - * A boolean value. If true, subscribes Head Lamp Status data. - * - * Optional. + * A boolean value. If true, subscribes Engine Torque data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *headLampStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *engineTorque; /** - * A boolean value. If true, subscribes Instant Fuel Consumption data. - * - * Optional. + * A boolean value. If true, subscribes Acc Pedal Position data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *instantFuelConsumption; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *accPedalPosition; /** - * A boolean value. If true, subscribes myKey data. - * - * Optional. + * See StabilityControlsStatus */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *myKey; +@property (nullable, strong, nonatomic) NSNumber<SDLBool> *stabilityControlsStatus; /** - * A boolean value. If true, subscribes Odometer data. - * - * Optional. + * A boolean value. If true, subscribes Steering Wheel Angle data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *odometer; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *steeringWheelAngle; /** - * A boolean value. If true, subscribes PRNDL data. - * - * Optional. + * A boolean value. If true, subscribes eCall Info data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *prndl; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *eCallInfo; /** - * A boolean value. If true, subscribes RPM data. - * - * Optional. + * A boolean value. If true, subscribes Airbag Status data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *rpm; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *airbagStatus; /** - * A boolean value. If true, subscribes Speed data. - * - * Optional. + * A boolean value. If true, subscribes Emergency Event data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *speed; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *emergencyEvent; /** - * See StabilityControlsStatus - * - * Optional. - * - * @since SDL 7.0.0 + * A boolean value. If true, subscribes Cluster Mode Status data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *stabilityControlsStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *clusterModeStatus; /** - * A boolean value. If true, subscribes Steering Wheel Angle data. - * - * Optional. + * A boolean value. If true, subscribes myKey data. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *steeringWheelAngle; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *myKey; /** - * A boolean value. If true, subscribes Tire Pressure status data. - * - * Optional. + * A boolean value. If true, subscribes to the electronic parking brake status. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *tirePressure; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *electronicParkBrakeStatus; /** * A boolean value. If true, subscribes to the turn signal status. - * - * Optional. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *turnSignal; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *turnSignal; /** - * A boolean value. If true, subscribes Wiper Status data. - * - * Optional. + * A boolean value. If true, subscribes to the cloud app vehicle ID. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *wiperStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *cloudAppVehicleID; /** Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. @@ -414,6 +328,8 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable NSNumber<SDLBool> *)getOEMCustomVehicleData:(NSString *)vehicleDataName; + + @end NS_ASSUME_NONNULL_END diff --git a/SmartDeviceLink/SDLSubscribeVehicleData.m b/SmartDeviceLink/SDLSubscribeVehicleData.m index a0a71ebe8..4cd04ae3f 100644 --- a/SmartDeviceLink/SDLSubscribeVehicleData.m +++ b/SmartDeviceLink/SDLSubscribeVehicleData.m @@ -2,10 +2,11 @@ // +#import "SDLSubscribeVehicleData.h" + #import "NSMutableDictionary+Store.h" -#import "SDLRPCFunctionNames.h" #import "SDLRPCParameterNames.h" -#import "SDLSubscribeVehicleData.h" +#import "SDLRPCFunctionNames.h" NS_ASSUME_NONNULL_BEGIN @@ -14,7 +15,8 @@ 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 self; } @@ -75,8 +77,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)gps { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:NSNumber.class error:nil]; } - (void)setSpeed:(nullable NSNumber<SDLBool> *)speed { @@ -84,8 +85,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)speed { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:NSNumber.class error:nil]; } - (void)setRpm:(nullable NSNumber<SDLBool> *)rpm { @@ -93,8 +93,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)rpm { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:NSNumber.class error:nil]; } - (void)setFuelLevel:(nullable NSNumber<SDLBool> *)fuelLevel { @@ -102,8 +101,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:NSNumber.class error:nil]; } - (void)setFuelLevel_State:(nullable NSNumber<SDLBool> *)fuelLevel_State { @@ -111,8 +109,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelLevel_State { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:NSNumber.class error:nil]; } - (void)setFuelRange:(nullable NSNumber<SDLBool> *)fuelRange { @@ -120,8 +117,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)fuelRange { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:NSNumber.class error:nil]; } - (void)setInstantFuelConsumption:(nullable NSNumber<SDLBool> *)instantFuelConsumption { @@ -129,8 +125,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)instantFuelConsumption { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:NSNumber.class error:nil]; } - (void)setExternalTemperature:(nullable NSNumber<SDLBool> *)externalTemperature { @@ -138,8 +133,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)externalTemperature { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class error:nil]; } - (void)setPrndl:(nullable NSNumber<SDLBool> *)prndl { @@ -147,8 +141,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)prndl { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:NSNumber.class error:nil]; } - (void)setTirePressure:(nullable NSNumber<SDLBool> *)tirePressure { @@ -156,8 +149,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)tirePressure { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:NSNumber.class error:nil]; } - (void)setOdometer:(nullable NSNumber<SDLBool> *)odometer { @@ -165,8 +157,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)odometer { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:NSNumber.class error:nil]; } - (void)setBeltStatus:(nullable NSNumber<SDLBool> *)beltStatus { @@ -174,8 +165,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)beltStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:NSNumber.class error:nil]; } - (void)setBodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation { @@ -183,8 +173,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)bodyInformation { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:NSNumber.class error:nil]; } - (void)setDeviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus { @@ -192,8 +181,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)deviceStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:NSNumber.class error:nil]; } - (void)setDriverBraking:(nullable NSNumber<SDLBool> *)driverBraking { @@ -201,8 +189,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)driverBraking { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:NSNumber.class error:nil]; } - (void)setWiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus { @@ -210,8 +197,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)wiperStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:NSNumber.class error:nil]; } - (void)setHeadLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus { @@ -219,8 +205,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)headLampStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:NSNumber.class error:nil]; } - (void)setEngineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife { @@ -228,8 +213,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineOilLife { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:NSNumber.class error:nil]; } - (void)setEngineTorque:(nullable NSNumber<SDLBool> *)engineTorque { @@ -237,8 +221,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)engineTorque { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:NSNumber.class error:nil]; } - (void)setAccPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition { @@ -246,8 +229,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)accPedalPosition { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:NSNumber.class error:nil]; } - (void)setSteeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle { @@ -255,8 +237,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)steeringWheelAngle { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:NSNumber.class error:nil]; } - (void)setECallInfo:(nullable NSNumber<SDLBool> *)eCallInfo { @@ -264,8 +245,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)eCallInfo { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:NSNumber.class error:nil]; } - (void)setAirbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus { @@ -273,8 +253,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)airbagStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:NSNumber.class error:nil]; } - (void)setEmergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent { @@ -282,8 +261,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)emergencyEvent { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:NSNumber.class error:nil]; } - (void)setClusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus { @@ -291,8 +269,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)clusterModeStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameClusterModeStatus ofClass:NSNumber.class error:nil]; } - (void)setMyKey:(nullable NSNumber<SDLBool> *)myKey { @@ -300,8 +277,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)myKey { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:NSNumber.class error:nil]; } - (void)setElectronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { @@ -309,8 +285,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)electronicParkBrakeStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:NSNumber.class error:nil]; } - (void)setTurnSignal:(nullable NSNumber<SDLBool> *)turnSignal { @@ -318,8 +293,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)turnSignal { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:NSNumber.class error:nil]; } - (void)setCloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID { @@ -327,8 +301,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)cloudAppVehicleID { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameCloudAppVehicleID ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameCloudAppVehicleID ofClass:NSNumber.class error:nil]; } - (void)setStabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus { @@ -345,8 +318,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)getOEMCustomVehicleData:(NSString *)vehicleDataName { - NSError *error = nil; - return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:vehicleDataName ofClass:NSNumber.class error:nil]; } @end diff --git a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.h b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.h index 092eecdfd..5da0cd5d4 100644 --- a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.h +++ b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.h @@ -1,39 +1,17 @@ -/* - * 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. - */ +// SDLSubscribeVehicleDataResponse.h +// #import "SDLRPCResponse.h" @class SDLVehicleDataResult; + +/** + Response to SDLSubscribeVehicleData + + Since SmartDeviceLink 2.0 + */ + NS_ASSUME_NONNULL_BEGIN @interface SDLSubscribeVehicleDataResponse : SDLRPCResponse @@ -76,214 +54,212 @@ NS_ASSUME_NONNULL_BEGIN - (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 stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey; /** - The result of requesting to subscribe to the accelerator pedal position (percentage depressed) + The result of requesting to subscribe to the GPSData. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *accPedalPosition; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *gps; /** - The result of requesting to subscribe to the airbag status + The result of requesting to subscribe to the vehicle speed in kilometers per hour. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *airbagStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *speed; /** - The result of requesting to subscribe to the status of the seat belts. + The result of requesting to subscribe to the number of revolutions per minute of the engine. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *beltStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *rpm; /** - The result of requesting to subscribe to the body information including power modes. + The result of requesting to subscribe to the fuel level in the tank (percentage) Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *bodyInformation; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelLevel; /** - The result of requesting to subscribe to the cloud app vehicle ID + The result of requesting to subscribe to the fuel level state. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *cloudAppVehicleID; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelLevel_State; /** - The result of requesting to subscribe to the cluster modes + The result of requesting to subscribe to the fuel range. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *clusterModes; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelRange; /** - The result of requesting to subscribe to the device status including signal and battery strength. + The result of requesting to subscribe to the instantaneous fuel consumption in microlitres. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *deviceStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *instantFuelConsumption; /** - The result of requesting to subscribe to the status of the brake pedal. + The result of requesting to subscribe to the external temperature in degrees celsius. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *driverBraking; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *externalTemperature; /** - The result of requesting to subscribe to the emergency call info + The result of requesting to subscribe to the PRNDL status. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *eCallInfo; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *prndl; /** - The result of requesting to subscribe to the electronic parking brake status + The result of requesting to subscribe to the tireStatus. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *electronicParkBrakeStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *tirePressure; /** - The result of requesting to subscribe to the emergency event + The result of requesting to subscribe to the odometer in km. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *emergencyEvent; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *odometer; /** - The result of requesting to subscribe to the estimated percentage of remaining oil life of the engine. + The result of requesting to subscribe to the status of the seat belts. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *engineOilLife; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *beltStatus; /** - The result of requesting to subscribe to the torque value for engine (in Nm) on non-diesel variants. + The result of requesting to subscribe to the body information including power modes. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *engineTorque; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *bodyInformation; /** - The result of requesting to subscribe to the external temperature in degrees celsius. + The result of requesting to subscribe to the device status including signal and battery strength. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *externalTemperature; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *deviceStatus; /** - The result of requesting to subscribe to the fuel level in the tank (percentage) + The result of requesting to subscribe to the status of the brake pedal. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *fuelLevel; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *driverBraking; /** - The result of requesting to subscribe to the fuel level state. + The result of requesting to subscribe to the status of the wipers. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *fuelLevel_State; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *wiperStatus; /** - The result of requesting to subscribe to the fuel range. + The result of requesting to subscribe to the status of the head lamps. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *fuelRange; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *headLampStatus; /** - The result of requesting to subscribe to the GPSData. + The result of requesting to subscribe to the estimated percentage of remaining oil life of the engine. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *gps; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *engineOilLife; /** - The result of requesting to subscribe to the status of the head lamps. + The result of requesting to subscribe to the torque value for engine (in Nm) on non-diesel variants. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *headLampStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *engineTorque; /** - The result of requesting to subscribe to the instantaneous fuel consumption in microlitres. + The result of requesting to subscribe to the accelerator pedal position (percentage depressed) Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *instantFuelConsumption; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *accPedalPosition; /** - The result of requesting to subscribe to the myKey status - - Optional + See StabilityControlsStatus */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *myKey; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *stabilityControlsStatus; /** - The result of requesting to subscribe to the odometer in km. + The result of requesting to subscribe to the current angle of the steering wheel (in deg) Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *odometer; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *steeringWheelAngle; /** - The result of requesting to subscribe to the PRNDL status. + The result of requesting to subscribe to the emergency call info Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *prndl; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *eCallInfo; /** - The result of requesting to subscribe to the number of revolutions per minute of the engine. + The result of requesting to subscribe to the airbag status Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *rpm; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *airbagStatus; /** - The result of requesting to subscribe to the vehicle speed in kilometers per hour. + The result of requesting to subscribe to the emergency event Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *speed; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *emergencyEvent; /** - * See StabilityControlsStatus - * - * @since SDL 7.0.0 + The result of requesting to subscribe to the cluster modes + + Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *stabilityControlsStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *clusterModes; /** - The result of requesting to subscribe to the current angle of the steering wheel (in deg) + The result of requesting to subscribe to the myKey status Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *steeringWheelAngle; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *myKey; /** - The result of requesting to subscribe to the tireStatus. + The result of requesting to subscribe to the electronic parking brake status Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *tirePressure; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *electronicParkBrakeStatus; /** The result of requesting to subscribe to the turn signal Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *turnSignal; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *turnSignal; /** - The result of requesting to subscribe to the status of the wipers. + The result of requesting to subscribe to the cloud app vehicle ID Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *wiperStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *cloudAppVehicleID; /** Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. diff --git a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m index 876a566c3..21781904f 100644 --- a/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m +++ b/SmartDeviceLink/SDLSubscribeVehicleDataResponse.m @@ -1,39 +1,12 @@ -/* - * 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. - */ +// SDLSubscribeVehicleDataResponse.m +// + + +#import "SDLSubscribeVehicleDataResponse.h" #import "NSMutableDictionary+Store.h" -#import "SDLRPCFunctionNames.h" #import "SDLRPCParameterNames.h" -#import "SDLSubscribeVehicleDataResponse.h" +#import "SDLRPCFunctionNames.h" #import "SDLVehicleDataResult.h" NS_ASSUME_NONNULL_BEGIN @@ -326,7 +299,8 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)stabilityControlsStatus { - return [self.parameters sdl_objectForName:SDLRPCParameterNameStabilityControlsStatus ofClass:SDLVehicleDataResult.class error:nil]; + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameStabilityControlsStatus ofClass:SDLVehicleDataResult.class error:&error]; } - (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(SDLVehicleDataResult *)vehicleDataState { diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.h b/SmartDeviceLink/SDLUnsubscribeVehicleData.h index 183dbe5c2..05b02d22f 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleData.h +++ b/SmartDeviceLink/SDLUnsubscribeVehicleData.h @@ -1,145 +1,125 @@ -/* - * 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. - */ +// SDLUnsubscribeVehicleData.h +// -#import "SDLRPCRequest.h" -NS_ASSUME_NONNULL_BEGIN +#import "SDLRPCRequest.h" /** - * This function is used to unsubscribe the notifications from the subscribeVehicleData function. + * This function is used to unsubscribe the notifications from the + * subscribeVehicleData function + * <p> + * Function Group: Location, VehicleInfo and DrivingChara + * <p> + * <b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b> + * </p> * - * @since SDL 2.0.0 + * @since SmartDeviceLink 2.0<br/> + * See SDLSubscribeVehicleData SDLGetVehicleData */ + +NS_ASSUME_NONNULL_BEGIN + @interface SDLUnsubscribeVehicleData : SDLRPCRequest /** * Convenience init for unsubscribing to all possible vehicle data items. * - * @param accelerationPedalPosition Unsubscribe to accelerationPedalPosition - * @param airbagStatus Unsubscribe to airbagStatus - * @param beltStatus Unsubscribe to beltStatus - * @param bodyInformation Unsubscribe to bodyInformation - * @param clusterModeStatus Unsubscribe to clusterModeStatus - * @param deviceStatus Unsubscribe to deviceStatus - * @param driverBraking Unsubscribe to driverBraking - * @param eCallInfo Unsubscribe to eCallInfo - * @param emergencyEvent Unsubscribe to emergencyEvent - * @param engineTorque Unsubscribe to engineTorque - * @param externalTemperature Unsubscribe to externalTemperature - * @param fuelLevel Unsubscribe to fuelLevel - * @param fuelLevelState Unsubscribe to fuelLevelState - * @param gps Unsubscribe to gps - * @param headLampStatus Unsubscribe to headLampStatus - * @param instantFuelConsumption Unsubscribe to instantFuelConsumption - * @param myKey Unsubscribe to myKey - * @param odometer Unsubscribe to odometer - * @param prndl Unsubscribe to prndl - * @param rpm Unsubscribe to rpm - * @param speed Unsubscribe to speed - * @param steeringWheelAngle Unsubscribe to steeringWheelAngle - * @param tirePressure Unsubscribe to tirePressure - * @param wiperStatus Unsubscribe to wiperStatus - * @return A SDLUnsubscribeVehicleData object + * @param accelerationPedalPosition Unsubscribe to accelerationPedalPosition + * @param airbagStatus Unsubscribe to airbagStatus + * @param beltStatus Unsubscribe to beltStatus + * @param bodyInformation Unsubscribe to bodyInformation + * @param clusterModeStatus Unsubscribe to clusterModeStatus + * @param deviceStatus Unsubscribe to deviceStatus + * @param driverBraking Unsubscribe to driverBraking + * @param eCallInfo Unsubscribe to eCallInfo + * @param emergencyEvent Unsubscribe to emergencyEvent + * @param engineTorque Unsubscribe to engineTorque + * @param externalTemperature Unsubscribe to externalTemperature + * @param fuelLevel Unsubscribe to fuelLevel + * @param fuelLevelState Unsubscribe to fuelLevelState + * @param gps Unsubscribe to gps + * @param headLampStatus Unsubscribe to headLampStatus + * @param instantFuelConsumption Unsubscribe to instantFuelConsumption + * @param myKey Unsubscribe to myKey + * @param odometer Unsubscribe to odometer + * @param prndl Unsubscribe to prndl + * @param rpm Unsubscribe to rpm + * @param speed Unsubscribe to speed + * @param steeringWheelAngle Unsubscribe to steeringWheelAngle + * @param tirePressure Unsubscribe to tirePressure + * @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 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:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); /** * Convenience init for unsubscribing to all possible vehicle data items. * - * @param accelerationPedalPosition Unsubscribe to accelerationPedalPosition - * @param airbagStatus Unsubscribe to airbagStatus - * @param beltStatus Unsubscribe to beltStatus - * @param bodyInformation Unsubscribe to bodyInformation - * @param clusterModeStatus Unsubscribe to clusterModeStatus - * @param deviceStatus Unsubscribe to deviceStatus - * @param driverBraking Unsubscribe to driverBraking - * @param eCallInfo Unsubscribe to eCallInfo - * @param electronicParkBrakeStatus Unsubscribe to electronicParkBrakeStatus - * @param emergencyEvent Unsubscribe to emergencyEvent - * @param engineOilLife Unsubscribe to engineOilLife - * @param engineTorque Unsubscribe to engineTorque - * @param externalTemperature Unsubscribe to externalTemperature - * @param fuelLevel Unsubscribe to fuelLevel - * @param fuelLevelState Unsubscribe to fuelLevelState - * @param fuelRange Unsubscribe to fuelRange - * @param gps Unsubscribe to gps - * @param headLampStatus Unsubscribe to headLampStatus - * @param instantFuelConsumption Unsubscribe to instantFuelConsumption - * @param myKey Unsubscribe to myKey - * @param odometer Unsubscribe to odometer - * @param prndl Unsubscribe to prndl - * @param rpm Unsubscribe to rpm - * @param speed Unsubscribe to speed - * @param steeringWheelAngle Unsubscribe to steeringWheelAngle - * @param tirePressure Unsubscribe to tirePressure - * @param turnSignal Unsubscribe to turnSignal - * @param wiperStatus Unsubscribe to wiperStatus - * @return A SDLUnsubscribeVehicleData object + * @param accelerationPedalPosition Unsubscribe to accelerationPedalPosition + * @param airbagStatus Unsubscribe to airbagStatus + * @param beltStatus Unsubscribe to beltStatus + * @param bodyInformation Unsubscribe to bodyInformation + * @param clusterModeStatus Unsubscribe to clusterModeStatus + * @param deviceStatus Unsubscribe to deviceStatus + * @param driverBraking Unsubscribe to driverBraking + * @param eCallInfo Unsubscribe to eCallInfo + * @param electronicParkBrakeStatus Unsubscribe to electronicParkBrakeStatus + * @param emergencyEvent Unsubscribe to emergencyEvent + * @param engineOilLife Unsubscribe to engineOilLife + * @param engineTorque Unsubscribe to engineTorque + * @param externalTemperature Unsubscribe to externalTemperature + * @param fuelLevel Unsubscribe to fuelLevel + * @param fuelLevelState Unsubscribe to fuelLevelState + * @param fuelRange Unsubscribe to fuelRange + * @param gps Unsubscribe to gps + * @param headLampStatus Unsubscribe to headLampStatus + * @param instantFuelConsumption Unsubscribe to instantFuelConsumption + * @param myKey Unsubscribe to myKey + * @param odometer Unsubscribe to odometer + * @param prndl Unsubscribe to prndl + * @param rpm Unsubscribe to rpm + * @param speed Unsubscribe to speed + * @param steeringWheelAngle Unsubscribe to steeringWheelAngle + * @param tirePressure Unsubscribe to tirePressure + * @param turnSignal Unsubscribe to turnSignal + * @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 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:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); /** * Convenience init for unsubscribing to all possible vehicle data items. * - * @param accelerationPedalPosition Unsubscribe to accelerationPedalPosition - * @param airbagStatus Unsubscribe to airbagStatus - * @param beltStatus Unsubscribe to beltStatus - * @param bodyInformation Unsubscribe to bodyInformation - * @param cloudAppVehicleID Unsubscribe to cloudAppVehicleID - * @param clusterModeStatus Unsubscribe to clusterModeStatus - * @param deviceStatus Unsubscribe to deviceStatus - * @param driverBraking Unsubscribe to driverBraking - * @param eCallInfo Unsubscribe to eCallInfo - * @param electronicParkBrakeStatus Unsubscribe to electronicParkBrakeStatus - * @param emergencyEvent Unsubscribe to emergencyEvent - * @param engineOilLife Unsubscribe to engineOilLife - * @param engineTorque Unsubscribe to engineTorque - * @param externalTemperature Unsubscribe to externalTemperature - * @param fuelLevel Unsubscribe to fuelLevel - * @param fuelLevelState Unsubscribe to fuelLevelState - * @param fuelRange Unsubscribe to fuelRange - * @param gps Unsubscribe to gps - * @param headLampStatus Unsubscribe to headLampStatus - * @param instantFuelConsumption Unsubscribe to instantFuelConsumption - * @param myKey Unsubscribe to myKey - * @param odometer Unsubscribe to odometer - * @param prndl Unsubscribe to prndl - * @param rpm Unsubscribe to rpm - * @param speed Unsubscribe to speed - * @param steeringWheelAngle Unsubscribe to steeringWheelAngle - * @param tirePressure Unsubscribe to tirePressure - * @param turnSignal Unsubscribe to turnSignal - * @param wiperStatus Unsubscribe to wiperStatus - * @return A SDLUnsubscribeVehicleData object + * @param accelerationPedalPosition Unsubscribe to accelerationPedalPosition + * @param airbagStatus Unsubscribe to airbagStatus + * @param beltStatus Unsubscribe to beltStatus + * @param bodyInformation Unsubscribe to bodyInformation + * @param cloudAppVehicleID Unsubscribe to cloudAppVehicleID + * @param clusterModeStatus Unsubscribe to clusterModeStatus + * @param deviceStatus Unsubscribe to deviceStatus + * @param driverBraking Unsubscribe to driverBraking + * @param eCallInfo Unsubscribe to eCallInfo + * @param electronicParkBrakeStatus Unsubscribe to electronicParkBrakeStatus + * @param emergencyEvent Unsubscribe to emergencyEvent + * @param engineOilLife Unsubscribe to engineOilLife + * @param engineTorque Unsubscribe to engineTorque + * @param externalTemperature Unsubscribe to externalTemperature + * @param fuelLevel Unsubscribe to fuelLevel + * @param fuelLevelState Unsubscribe to fuelLevelState + * @param fuelRange Unsubscribe to fuelRange + * @param gps Unsubscribe to gps + * @param headLampStatus Unsubscribe to headLampStatus + * @param instantFuelConsumption Unsubscribe to instantFuelConsumption + * @param myKey Unsubscribe to myKey + * @param odometer Unsubscribe to odometer + * @param prndl Unsubscribe to prndl + * @param rpm Unsubscribe to rpm + * @param speed Unsubscribe to speed + * @param steeringWheelAngle Unsubscribe to steeringWheelAngle + * @param tirePressure Unsubscribe to tirePressure + * @param turnSignal Unsubscribe to turnSignal + * @param wiperStatus Unsubscribe to wiperStatus + * @return A SDLUnsubscribeVehicleData object */ - (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation cloudAppVehicleID:(BOOL)cloudAppVehicleID clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:stabilityControlsStatus:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); @@ -181,216 +161,154 @@ NS_ASSUME_NONNULL_BEGIN - (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 stabilityControlsStatus:(nullable NSNumber<SDLBool> *)stabilityControlsStatus eCallInfo:(nullable NSNumber<SDLBool> *)eCallInfo airbagStatus:(nullable NSNumber<SDLBool> *)airbagStatus emergencyEvent:(nullable NSNumber<SDLBool> *)emergencyEvent clusterModeStatus:(nullable NSNumber<SDLBool> *)clusterModeStatus myKey:(nullable NSNumber<SDLBool> *)myKey; /** - * If true, unsubscribes from Acc Pedal Position - * - * Optional. + * If true, unsubscribes from GPS */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *accPedalPosition; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *gps; /** - * If true, unsubscribes from Airbag Status - * - * Optional. + * If true, unsubscribes from Speed */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *airbagStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *speed; /** - * If true, unsubscribes from Belt Status - * - * Optional. + * If true, unsubscribes from RPM */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *beltStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *rpm; /** - * If true, unsubscribes from Body Information - * - * Optional. + * If true, unsubscribes from Fuel Level */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *bodyInformation; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelLevel; /** - A boolean value. If true, unsubscribes to the Cloud App Vehicle ID - - Optional. + * If true, unsubscribes from Fuel Level State */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *cloudAppVehicleID; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelLevel_State; /** - * If true, unsubscribes from Cluster Mode Status - * - * Optional. + * If true, unsubscribes from Fuel Range */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *clusterModeStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelRange; /** - * If true, unsubscribes from Device Status - * - * Optional. + * If true, unsubscribes from Instant Fuel Consumption */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *deviceStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *instantFuelConsumption; /** - * If true, unsubscribes from Driver Braking - * - * Optional. + * If true, unsubscribes from External Temperature */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *driverBraking; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *externalTemperature; /** - * If true, unsubscribes from eCallInfo - * - * Optional. + * If true, unsubscribes from PRNDL */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *eCallInfo; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *prndl; /** - A boolean value. If true, unsubscribes to the Electronic Parking Brake Status - - Optional. + * If true, unsubscribes from Tire Pressure */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *electronicParkBrakeStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *tirePressure; /** - * If true, unsubscribes from Emergency Event - * - * Optional. + * If true, unsubscribes from Odometer */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *emergencyEvent; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *odometer; /** - * If true, unsubscribes from Engine Oil Life - * - * Optional. + * If true, unsubscribes from Belt Status */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *engineOilLife; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *beltStatus; /** - * If true, unsubscribes from Engine Torque - * - * Optional. + * If true, unsubscribes from Body Information */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *engineTorque; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *bodyInformation; /** - * If true, unsubscribes from External Temperature - * - * Optional. + * If true, unsubscribes from Device Status */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *externalTemperature; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *deviceStatus; /** - * If true, unsubscribes from Fuel Level - * - * Optional. + * If true, unsubscribes from Driver Braking */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelLevel; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *driverBraking; /** - * If true, unsubscribes from Fuel Level State - * - * Optional. + * If true, unsubscribes from Wiper Status */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelLevel_State; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *wiperStatus; /** - * If true, unsubscribes from Fuel Range - * - * Optional. + * If true, unsubscribes from Head Lamp Status */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *fuelRange; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *headLampStatus; /** - * If true, unsubscribes from GPS - * - * Optional. + * If true, unsubscribes from Engine Oil Life */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *gps; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *engineOilLife; /** - * If true, unsubscribes from Head Lamp Status - * - * Optional. + * If true, unsubscribes from Engine Torque */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *headLampStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *engineTorque; /** - * If true, unsubscribes from Instant Fuel Consumption - * - * Optional. + * If true, unsubscribes from Acc Pedal Position */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *instantFuelConsumption; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *accPedalPosition; /** - * If true, unsubscribes from My Key - * - * Optional. + * See StabilityControlsStatus */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *myKey; +@property (nullable, strong, nonatomic) NSNumber<SDLBool> *stabilityControlsStatus; /** - * If true, unsubscribes from Odometer - * - * Optional. + * If true, unsubscribes from Steering Wheel Angle data */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *odometer; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *steeringWheelAngle; /** - * If true, unsubscribes from PRNDL - * - * Optional. + * If true, unsubscribes from eCallInfo */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *prndl; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *eCallInfo; /** - * If true, unsubscribes from RPM - * - * Optional. + * If true, unsubscribes from Airbag Status */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *rpm; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *airbagStatus; /** - * If true, unsubscribes from Speed - * - * Optional. + * If true, unsubscribes from Emergency Event */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *speed; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *emergencyEvent; /** - * See StabilityControlsStatus - * - * Optional. - * - * @since SDL 7.0.0 + * If true, unsubscribes from Cluster Mode Status */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *stabilityControlsStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *clusterModeStatus; /** - * If true, unsubscribes from Steering Wheel Angle data - * - * Optional. + * If true, unsubscribes from My Key */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *steeringWheelAngle; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *myKey; /** - * If true, unsubscribes from Tire Pressure - * - * Optional. + A boolean value. If true, unsubscribes to the Electronic Parking Brake Status */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *tirePressure; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *electronicParkBrakeStatus; /** A boolean value. If true, unsubscribes to the Turn Signal - - Optional. */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *turnSignal; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *turnSignal; /** - * If true, unsubscribes from Wiper Status - * - * Optional. + A boolean value. If true, unsubscribes to the Cloud App Vehicle ID */ -@property (nullable, strong, nonatomic) NSNumber<SDLBool> *wiperStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *cloudAppVehicleID; /** Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.m b/SmartDeviceLink/SDLUnsubscribeVehicleData.m index bdfc7db04..91c9edda7 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleData.m +++ b/SmartDeviceLink/SDLUnsubscribeVehicleData.m @@ -1,39 +1,12 @@ -/* - * 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. - */ +// SDLUnsubscribeVehicleData.m +// + + +#import "SDLUnsubscribeVehicleData.h" #import "NSMutableDictionary+Store.h" -#import "SDLRPCFunctionNames.h" #import "SDLRPCParameterNames.h" -#import "SDLUnsubscribeVehicleData.h" +#import "SDLRPCFunctionNames.h" NS_ASSUME_NONNULL_BEGIN @@ -337,7 +310,8 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)stabilityControlsStatus { - return [self.parameters sdl_objectForName:SDLRPCParameterNameStabilityControlsStatus ofClass:NSNumber.class error:nil]; + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameStabilityControlsStatus ofClass:NSNumber.class error:&error]; } - (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(BOOL)vehicleDataState { diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h index 8e973f1af..6a5c95e77 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h +++ b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h @@ -1,43 +1,17 @@ -/* - * 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. - */ +// SDLUnsubscribeVehicleDataResponse.h +// #import "SDLRPCResponse.h" @class SDLVehicleDataResult; + NS_ASSUME_NONNULL_BEGIN /** - * @since SDL 2.0.0 + Response to UnsubscribeVehicleData + + since SmartDeviceLink 2.0 */ @interface SDLUnsubscribeVehicleDataResponse : SDLRPCResponse @@ -79,216 +53,212 @@ NS_ASSUME_NONNULL_BEGIN - (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 stabilityControlsStatus:(nullable SDLVehicleDataResult *)stabilityControlsStatus eCallInfo:(nullable SDLVehicleDataResult *)eCallInfo airbagStatus:(nullable SDLVehicleDataResult *)airbagStatus emergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent clusterModes:(nullable SDLVehicleDataResult *)clusterModes myKey:(nullable SDLVehicleDataResult *)myKey; /** - The result of requesting to unsubscribe to the accelerator pedal position (percentage depressed) + The result of requesting to unsubscribe to the GPSData. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *accPedalPosition; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *gps; /** - The result of requesting to unsubscribe to the airbag status + The result of requesting to unsubscribe to the vehicle speed in kilometers per hour. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *airbagStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *speed; /** - The result of requesting to unsubscribe to the status of the seat belts. + The result of requesting to unsubscribe to the number of revolutions per minute of the engine. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *beltStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *rpm; /** - The result of requesting to unsubscribe to the body information including power modes. + The result of requesting to unsubscribe to the fuel level in the tank (percentage) Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *bodyInformation; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelLevel; /** - The result of requesting to unsubscribe to the cloud app vehicle id + The result of requesting to unsubscribe to the fuel level state. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *cloudAppVehicleID; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelLevel_State; /** - The result of requesting to unsubscribe to the cluster modes + The result of requesting to unsubscribe to the fuel range. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *clusterModes; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelRange; /** - The result of requesting to unsubscribe to the device status including signal and battery strength. + The result of requesting to unsubscribe to the instantaneous fuel consumption in microlitres. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *deviceStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *instantFuelConsumption; /** - The result of requesting to unsubscribe to the status of the brake pedal. + The result of requesting to unsubscribe to the external temperature in degrees celsius. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *driverBraking; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *externalTemperature; /** - The result of requesting to unsubscribe to the emergency call info + The result of requesting to unsubscribe to the PRNDL status. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *eCallInfo; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *prndl; /** - The result of requesting to unsubscribe to the electronic parking brake status + The result of requesting to unsubscribe to the tireStatus. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *electronicParkBrakeStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *tirePressure; /** - The result of requesting to unsubscribe to the emergency event + The result of requesting to unsubscribe to the odometer in km. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *emergencyEvent; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *odometer; /** - The result of requesting to unsubscribe to the estimated percentage of remaining oil life of the engine. + The result of requesting to unsubscribe to the status of the seat belts. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *engineOilLife; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *beltStatus; /** - The result of requesting to unsubscribe to the torque value for engine (in Nm) on non-diesel variants. + The result of requesting to unsubscribe to the body information including power modes. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *engineTorque; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *bodyInformation; /** - The result of requesting to unsubscribe to the external temperature in degrees celsius. + The result of requesting to unsubscribe to the device status including signal and battery strength. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *externalTemperature; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *deviceStatus; /** - The result of requesting to unsubscribe to the fuel level in the tank (percentage) + The result of requesting to unsubscribe to the status of the brake pedal. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *fuelLevel; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *driverBraking; /** - The result of requesting to unsubscribe to the fuel level state. + The result of requesting to unsubscribe to the status of the wipers. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *fuelLevel_State; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *wiperStatus; /** - The result of requesting to unsubscribe to the fuel range. + The result of requesting to unsubscribe to the status of the head lamps. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *fuelRange; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *headLampStatus; /** - The result of requesting to unsubscribe to the GPSData. + The result of requesting to unsubscribe to the estimated percentage of remaining oil life of the engine. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *gps; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *engineOilLife; /** - The result of requesting to unsubscribe to the status of the head lamps. + The result of requesting to unsubscribe to the torque value for engine (in Nm) on non-diesel variants. Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *headLampStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *engineTorque; /** - The result of requesting to unsubscribe to the instantaneous fuel consumption in microlitres. + The result of requesting to unsubscribe to the accelerator pedal position (percentage depressed) Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *instantFuelConsumption; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *accPedalPosition; /** - The result of requesting to unsubscribe to the myKey status - - Optional + See StabilityControlsStatus */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *myKey; +@property (nullable, strong, nonatomic) SDLVehicleDataResult *stabilityControlsStatus; /** - The result of requesting to unsubscribe to the odometer in km. + The result of requesting to unsubscribe to the current angle of the steering wheel (in deg) Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *odometer; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *steeringWheelAngle; /** - The result of requesting to unsubscribe to the PRNDL status. + The result of requesting to unsubscribe to the emergency call info Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *prndl; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *eCallInfo; /** - The result of requesting to unsubscribe to the number of revolutions per minute of the engine. + The result of requesting to unsubscribe to the airbag status Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *rpm; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *airbagStatus; /** - The result of requesting to unsubscribe to the vehicle speed in kilometers per hour. + The result of requesting to unsubscribe to the emergency event Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *speed; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *emergencyEvent; /** - * See StabilityControlsStatus - * - * Optional. - * - * @since SDL 7.0.0 + The result of requesting to unsubscribe to the cluster modes + + Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *stabilityControlsStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *clusterModes; /** - The result of requesting to unsubscribe to the current angle of the steering wheel (in deg) + The result of requesting to unsubscribe to the myKey status Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *steeringWheelAngle; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *myKey; /** - The result of requesting to unsubscribe to the tireStatus. + The result of requesting to unsubscribe to the electronic parking brake status Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *tirePressure; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *electronicParkBrakeStatus; /** The result of requesting to unsubscribe to the turn signal Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *turnSignal; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *turnSignal; /** - The result of requesting to unsubscribe to the status of the wipers. + The result of requesting to unsubscribe to the cloud app vehicle id Optional */ -@property (nullable, strong, nonatomic) SDLVehicleDataResult *wiperStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *cloudAppVehicleID; /** Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m index 9edb4598b..8a97454ba 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m +++ b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m @@ -1,39 +1,12 @@ -/* - * 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. - */ +// SDLUnsubscribeVehicleDataResponse.m +// + + +#import "SDLUnsubscribeVehicleDataResponse.h" #import "NSMutableDictionary+Store.h" -#import "SDLRPCFunctionNames.h" #import "SDLRPCParameterNames.h" -#import "SDLUnsubscribeVehicleDataResponse.h" +#import "SDLRPCFunctionNames.h" #import "SDLVehicleDataResult.h" NS_ASSUME_NONNULL_BEGIN @@ -326,7 +299,8 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)stabilityControlsStatus { - return [self.parameters sdl_objectForName:SDLRPCParameterNameStabilityControlsStatus ofClass:SDLVehicleDataResult.class error:nil]; + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameStabilityControlsStatus ofClass:SDLVehicleDataResult.class error:&error]; } - (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(SDLVehicleDataResult *)vehicleDataState { diff --git a/SmartDeviceLink/SDLVehicleDataType.h b/SmartDeviceLink/SDLVehicleDataType.h index a49b71b97..62f0484a1 100644 --- a/SmartDeviceLink/SDLVehicleDataType.h +++ b/SmartDeviceLink/SDLVehicleDataType.h @@ -1,148 +1,113 @@ -/* - * 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. - */ +// SDLVehicleDataType.h +// + #import "SDLEnum.h" /** - * Defines the data types that can be published and subscribed to. - * - * @since SDL 2.0.0 + * Defines the vehicle data types that can be published and/or subscribed to using SDLSubscribeVehicleData. Used in VehicleDataResult */ typedef SDLEnum SDLVehicleDataType SDL_SWIFT_ENUM; /** - Vehicle accleration pedal data - */ -extern SDLVehicleDataType const SDLVehicleDataTypeAccelerationPedal; - -/** - Vehicle airbag status data + GPS vehicle data */ -extern SDLVehicleDataType const SDLVehicleDataTypeAirbagStatus; +extern SDLVehicleDataType const SDLVehicleDataTypeGPS; /** - Vehicle battery voltage data + Vehicle speed data */ -extern SDLVehicleDataType const SDLVehicleDataTypeBatteryVoltage; +extern SDLVehicleDataType const SDLVehicleDataTypeSpeed; /** - Vehicle belt status data + vehicle data StabilityControlsStatus to know if stability controls like ESC, Traction Control etc. are active. */ -extern SDLVehicleDataType const SDLVehicleDataTypeBeltStatus; +extern SDLVehicleDataType const SDLVehicleDataTypeStabilityControlsStatus; /** - Vehicle body info data + Vehicle RPM data */ -extern SDLVehicleDataType const SDLVehicleDataTypeBodyInfo; +extern SDLVehicleDataType const SDLVehicleDataTypeRPM; /** - Vehicle braking data + Vehicle fuel level data */ -extern SDLVehicleDataType const SDLVehicleDataTypeBraking; +extern SDLVehicleDataType const SDLVehicleDataTypeFuelLevel; /** - The cloud application vehicle id. Used by cloud apps to identify a head unit + Vehicle fuel level state data */ -extern SDLVehicleDataType const SDLVehicleDataTypeCloudAppVehicleID; +extern SDLVehicleDataType const SDLVehicleDataTypeFuelLevelState; /** - Vehicle cluster mode status data + Vehicle fuel consumption data */ -extern SDLVehicleDataType const SDLVehicleDataTypeClusterModeStatus; +extern SDLVehicleDataType const SDLVehicleDataTypeFuelConsumption; /** - Vehicle device status data + Vehicle external temperature data */ -extern SDLVehicleDataType const SDLVehicleDataTypeDeviceStatus; +extern SDLVehicleDataType const SDLVehicleDataTypeExternalTemperature; /** - Vehicle emergency call info data + Vehicle VIN data */ -extern SDLVehicleDataType const SDLVehicleDataTypeECallInfo; +extern SDLVehicleDataType const SDLVehicleDataTypeVIN; /** - Vehicle electronic parking brake status data + Vehicle PRNDL data */ -extern SDLVehicleDataType const SDLVehicleDataTypeElectronicParkBrakeStatus; +extern SDLVehicleDataType const SDLVehicleDataTypePRNDL; /** - Vehicle emergency event info + Vehicle tire pressure data */ -extern SDLVehicleDataType const SDLVehicleDataTypeEmergencyEvent; +extern SDLVehicleDataType const SDLVehicleDataTypeTirePressure; /** - Vehicle engine oil life data + Vehicle odometer data */ -extern SDLVehicleDataType const SDLVehicleDataTypeEngineOilLife; +extern SDLVehicleDataType const SDLVehicleDataTypeOdometer; /** - Vehicle engine torque data + Vehicle belt status data */ -extern SDLVehicleDataType const SDLVehicleDataTypeEngineTorque; +extern SDLVehicleDataType const SDLVehicleDataTypeBeltStatus; /** - Vehicle external temperature data + Vehicle body info data */ -extern SDLVehicleDataType const SDLVehicleDataTypeExternalTemperature; +extern SDLVehicleDataType const SDLVehicleDataTypeBodyInfo; /** - Vehicle fuel consumption data + Vehicle device status data */ -extern SDLVehicleDataType const SDLVehicleDataTypeFuelConsumption; +extern SDLVehicleDataType const SDLVehicleDataTypeDeviceStatus; /** - Vehicle fuel level data + Vehicle emergency call info data */ -extern SDLVehicleDataType const SDLVehicleDataTypeFuelLevel; +extern SDLVehicleDataType const SDLVehicleDataTypeECallInfo; /** - Vehicle fuel level state data + Vehicle fuel range data */ -extern SDLVehicleDataType const SDLVehicleDataTypeFuelLevelState; +extern SDLVehicleDataType const SDLVehicleDataTypeFuelRange; /** - Vehicle fuel range data + Vehicle airbag status data */ -extern SDLVehicleDataType const SDLVehicleDataTypeFuelRange; +extern SDLVehicleDataType const SDLVehicleDataTypeAirbagStatus; /** - GPS vehicle data + Vehicle emergency event info */ -extern SDLVehicleDataType const SDLVehicleDataTypeGPS; +extern SDLVehicleDataType const SDLVehicleDataTypeEmergencyEvent; /** - Vehicle headlamp status + Vehicle cluster mode status data */ -extern SDLVehicleDataType const SDLVehicleDataTypeHeadlampStatus; +extern SDLVehicleDataType const SDLVehicleDataTypeClusterModeStatus; /** Vehicle MyKey data @@ -150,38 +115,39 @@ extern SDLVehicleDataType const SDLVehicleDataTypeHeadlampStatus; extern SDLVehicleDataType const SDLVehicleDataTypeMyKey; /** - Custom OEM Vehicle data - - @since SDL 6.0 + Vehicle braking data */ -extern SDLVehicleDataType const SDLVehicleDataTypeOEMVehicleDataType; +extern SDLVehicleDataType const SDLVehicleDataTypeBraking; /** - Vehicle odometer data + Vehicle wiper status data */ -extern SDLVehicleDataType const SDLVehicleDataTypeOdometer; +extern SDLVehicleDataType const SDLVehicleDataTypeWiperStatus; /** - Vehicle PRNDL data + Vehicle headlamp status */ -extern SDLVehicleDataType const SDLVehicleDataTypePRNDL; +extern SDLVehicleDataType const SDLVehicleDataTypeHeadlampStatus; /** - Vehicle RPM data + Vehicle battery voltage data */ -extern SDLVehicleDataType const SDLVehicleDataTypeRPM; +extern SDLVehicleDataType const SDLVehicleDataTypeBatteryVoltage; /** - Vehicle speed data + Vehicle engine oil life data */ -extern SDLVehicleDataType const SDLVehicleDataTypeSpeed; +extern SDLVehicleDataType const SDLVehicleDataTypeEngineOilLife; /** - vehicle data StabilityControlsStatus to know if stability controls like ESC, Traction Control etc. are active. + Vehicle engine torque data + */ +extern SDLVehicleDataType const SDLVehicleDataTypeEngineTorque; - @since SDL 7.0.0 +/** + Vehicle accleration pedal data */ -extern SDLVehicleDataType const SDLVehicleDataTypeStabilityControlsStatus; +extern SDLVehicleDataType const SDLVehicleDataTypeAccelerationPedal; /** Vehicle steering wheel data @@ -189,9 +155,9 @@ extern SDLVehicleDataType const SDLVehicleDataTypeStabilityControlsStatus; extern SDLVehicleDataType const SDLVehicleDataTypeSteeringWheel; /** - Vehicle tire pressure data + Vehicle electronic parking brake status data */ -extern SDLVehicleDataType const SDLVehicleDataTypeTirePressure; +extern SDLVehicleDataType const SDLVehicleDataTypeElectronicParkBrakeStatus; /** Vehicle turn signal data @@ -199,11 +165,13 @@ extern SDLVehicleDataType const SDLVehicleDataTypeTirePressure; extern SDLVehicleDataType const SDLVehicleDataTypeTurnSignal; /** - Vehicle VIN data + The cloud application vehicle id. Used by cloud apps to identify a head unit */ -extern SDLVehicleDataType const SDLVehicleDataTypeVIN; +extern SDLVehicleDataType const SDLVehicleDataTypeCloudAppVehicleID; /** - Vehicle wiper status data + Custom OEM Vehicle data + + Added in SDL 6.0 */ -extern SDLVehicleDataType const SDLVehicleDataTypeWiperStatus; +extern SDLVehicleDataType const SDLVehicleDataTypeOEMVehicleDataType; diff --git a/SmartDeviceLink/SDLVehicleDataType.m b/SmartDeviceLink/SDLVehicleDataType.m index efb17bdf6..24af5fa1b 100644 --- a/SmartDeviceLink/SDLVehicleDataType.m +++ b/SmartDeviceLink/SDLVehicleDataType.m @@ -1,67 +1,40 @@ -/* - * 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. - */ +// SDLVehicleDataType.m +// + #import "SDLVehicleDataType.h" -SDLVehicleDataType const SDLVehicleDataTypeAccelerationPedal = @"VEHICLEDATA_ACCPEDAL"; -SDLVehicleDataType const SDLVehicleDataTypeAirbagStatus = @"VEHICLEDATA_AIRBAGSTATUS"; -SDLVehicleDataType const SDLVehicleDataTypeBatteryVoltage = @"VEHICLEDATA_BATTVOLTAGE"; +SDLVehicleDataType const SDLVehicleDataTypeGPS = @"VEHICLEDATA_GPS"; +SDLVehicleDataType const SDLVehicleDataTypeSpeed = @"VEHICLEDATA_SPEED"; +SDLVehicleDataType const SDLVehicleDataTypeRPM = @"VEHICLEDATA_RPM"; +SDLVehicleDataType const SDLVehicleDataTypeFuelLevel = @"VEHICLEDATA_FUELLEVEL"; +SDLVehicleDataType const SDLVehicleDataTypeFuelLevelState = @"VEHICLEDATA_FUELLEVEL_STATE"; +SDLVehicleDataType const SDLVehicleDataTypeFuelConsumption = @"VEHICLEDATA_FUELCONSUMPTION"; +SDLVehicleDataType const SDLVehicleDataTypeFuelRange = @"VEHICLEDATA_FUELRANGE"; +SDLVehicleDataType const SDLVehicleDataTypeExternalTemperature = @"VEHICLEDATA_EXTERNTEMP"; +SDLVehicleDataType const SDLVehicleDataTypeVIN = @"VEHICLEDATA_VIN"; +SDLVehicleDataType const SDLVehicleDataTypePRNDL = @"VEHICLEDATA_PRNDL"; +SDLVehicleDataType const SDLVehicleDataTypeTirePressure = @"VEHICLEDATA_TIREPRESSURE"; +SDLVehicleDataType const SDLVehicleDataTypeOdometer = @"VEHICLEDATA_ODOMETER"; SDLVehicleDataType const SDLVehicleDataTypeBeltStatus = @"VEHICLEDATA_BELTSTATUS"; SDLVehicleDataType const SDLVehicleDataTypeBodyInfo = @"VEHICLEDATA_BODYINFO"; -SDLVehicleDataType const SDLVehicleDataTypeBraking = @"VEHICLEDATA_BRAKING"; -SDLVehicleDataType const SDLVehicleDataTypeCloudAppVehicleID = @"VEHICLEDATA_CLOUDAPPVEHICLEID"; -SDLVehicleDataType const SDLVehicleDataTypeClusterModeStatus = @"VEHICLEDATA_CLUSTERMODESTATUS"; SDLVehicleDataType const SDLVehicleDataTypeDeviceStatus = @"VEHICLEDATA_DEVICESTATUS"; SDLVehicleDataType const SDLVehicleDataTypeECallInfo = @"VEHICLEDATA_ECALLINFO"; -SDLVehicleDataType const SDLVehicleDataTypeElectronicParkBrakeStatus = @"VEHICLEDATA_ELECTRONICPARKBRAKESTATUS"; +SDLVehicleDataType const SDLVehicleDataTypeAirbagStatus = @"VEHICLEDATA_AIRBAGSTATUS"; SDLVehicleDataType const SDLVehicleDataTypeEmergencyEvent = @"VEHICLEDATA_EMERGENCYEVENT"; +SDLVehicleDataType const SDLVehicleDataTypeClusterModeStatus = @"VEHICLEDATA_CLUSTERMODESTATUS"; +SDLVehicleDataType const SDLVehicleDataTypeMyKey = @"VEHICLEDATA_MYKEY"; +SDLVehicleDataType const SDLVehicleDataTypeBraking = @"VEHICLEDATA_BRAKING"; +SDLVehicleDataType const SDLVehicleDataTypeWiperStatus = @"VEHICLEDATA_WIPERSTATUS"; +SDLVehicleDataType const SDLVehicleDataTypeHeadlampStatus = @"VEHICLEDATA_HEADLAMPSTATUS"; +SDLVehicleDataType const SDLVehicleDataTypeBatteryVoltage = @"VEHICLEDATA_BATTVOLTAGE"; SDLVehicleDataType const SDLVehicleDataTypeEngineOilLife = @"VEHICLEDATA_ENGINEOILLIFE"; SDLVehicleDataType const SDLVehicleDataTypeEngineTorque = @"VEHICLEDATA_ENGINETORQUE"; -SDLVehicleDataType const SDLVehicleDataTypeExternalTemperature = @"VEHICLEDATA_EXTERNTEMP"; -SDLVehicleDataType const SDLVehicleDataTypeFuelConsumption = @"VEHICLEDATA_FUELCONSUMPTION"; -SDLVehicleDataType const SDLVehicleDataTypeFuelLevel = @"VEHICLEDATA_FUELLEVEL"; -SDLVehicleDataType const SDLVehicleDataTypeFuelLevelState = @"VEHICLEDATA_FUELLEVEL_STATE"; -SDLVehicleDataType const SDLVehicleDataTypeFuelRange = @"VEHICLEDATA_FUELRANGE"; -SDLVehicleDataType const SDLVehicleDataTypeGPS = @"VEHICLEDATA_GPS"; -SDLVehicleDataType const SDLVehicleDataTypeHeadlampStatus = @"VEHICLEDATA_HEADLAMPSTATUS"; -SDLVehicleDataType const SDLVehicleDataTypeMyKey = @"VEHICLEDATA_MYKEY"; -SDLVehicleDataType const SDLVehicleDataTypeOEMVehicleDataType = @"VEHICLEDATA_OEM_CUSTOM_DATA"; -SDLVehicleDataType const SDLVehicleDataTypeOdometer = @"VEHICLEDATA_ODOMETER"; -SDLVehicleDataType const SDLVehicleDataTypePRNDL = @"VEHICLEDATA_PRNDL"; -SDLVehicleDataType const SDLVehicleDataTypeRPM = @"VEHICLEDATA_RPM"; -SDLVehicleDataType const SDLVehicleDataTypeSpeed = @"VEHICLEDATA_SPEED"; +SDLVehicleDataType const SDLVehicleDataTypeAccelerationPedal = @"VEHICLEDATA_ACCPEDAL"; SDLVehicleDataType const SDLVehicleDataTypeStabilityControlsStatus = @"VEHICLEDATA_STABILITYCONTROLSSTATUS"; SDLVehicleDataType const SDLVehicleDataTypeSteeringWheel = @"VEHICLEDATA_STEERINGWHEEL"; -SDLVehicleDataType const SDLVehicleDataTypeTirePressure = @"VEHICLEDATA_TIREPRESSURE"; +SDLVehicleDataType const SDLVehicleDataTypeElectronicParkBrakeStatus = @"VEHICLEDATA_ELECTRONICPARKBRAKESTATUS"; SDLVehicleDataType const SDLVehicleDataTypeTurnSignal = @"VEHICLEDATA_TURNSIGNAL"; -SDLVehicleDataType const SDLVehicleDataTypeVIN = @"VEHICLEDATA_VIN"; -SDLVehicleDataType const SDLVehicleDataTypeWiperStatus = @"VEHICLEDATA_WIPERSTATUS"; +SDLVehicleDataType const SDLVehicleDataTypeCloudAppVehicleID = @"VEHICLEDATA_CLOUDAPPVEHICLEID"; +SDLVehicleDataType const SDLVehicleDataTypeOEMVehicleDataType = @"VEHICLEDATA_OEM_CUSTOM_DATA"; + diff --git a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m index f6cc5b917..715b45be9 100644 --- a/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/EnumSpecs/SDLVehicleDataTypeSpec.m @@ -2,49 +2,53 @@ // SDLVehicleDataTypeSpec.m // SmartDeviceLink + #import <Foundation/Foundation.h> -#import <Nimble/Nimble.h> + #import <Quick/Quick.h> +#import <Nimble/Nimble.h> #import "SDLVehicleDataType.h" QuickSpecBegin(SDLVehicleDataTypeSpec) -describe(@"individual enum value tests", ^ { - it(@"should match internal values", ^ { - expect(SDLVehicleDataTypeAccelerationPedal).to(equal(@"VEHICLEDATA_ACCPEDAL")); - expect(SDLVehicleDataTypeAirbagStatus).to(equal(@"VEHICLEDATA_AIRBAGSTATUS")); - expect(SDLVehicleDataTypeBatteryVoltage).to(equal(@"VEHICLEDATA_BATTVOLTAGE")); +describe(@"Individual Enum Value Tests", ^ { + it(@"Should match internal values", ^ { + expect(SDLVehicleDataTypeGPS).to(equal(@"VEHICLEDATA_GPS")); + expect(SDLVehicleDataTypeSpeed).to(equal(@"VEHICLEDATA_SPEED")); + expect(SDLVehicleDataTypeStabilityControlsStatus).to(equal(@"VEHICLEDATA_STABILITYCONTROLSSTATUS")); + expect(SDLVehicleDataTypeRPM).to(equal(@"VEHICLEDATA_RPM")); + expect(SDLVehicleDataTypeFuelLevel).to(equal(@"VEHICLEDATA_FUELLEVEL")); + expect(SDLVehicleDataTypeFuelLevelState).to(equal(@"VEHICLEDATA_FUELLEVEL_STATE")); + expect(SDLVehicleDataTypeFuelConsumption).to(equal(@"VEHICLEDATA_FUELCONSUMPTION")); + expect(SDLVehicleDataTypeFuelRange).to(equal(@"VEHICLEDATA_FUELRANGE")); + expect(SDLVehicleDataTypeExternalTemperature).to(equal(@"VEHICLEDATA_EXTERNTEMP")); + expect(SDLVehicleDataTypeVIN).to(equal(@"VEHICLEDATA_VIN")); + expect(SDLVehicleDataTypePRNDL).to(equal(@"VEHICLEDATA_PRNDL")); + expect(SDLVehicleDataTypeTirePressure).to(equal(@"VEHICLEDATA_TIREPRESSURE")); + expect(SDLVehicleDataTypeOdometer).to(equal(@"VEHICLEDATA_ODOMETER")); expect(SDLVehicleDataTypeBeltStatus).to(equal(@"VEHICLEDATA_BELTSTATUS")); expect(SDLVehicleDataTypeBodyInfo).to(equal(@"VEHICLEDATA_BODYINFO")); - expect(SDLVehicleDataTypeBraking).to(equal(@"VEHICLEDATA_BRAKING")); - expect(SDLVehicleDataTypeCloudAppVehicleID).to(equal(@"VEHICLEDATA_CLOUDAPPVEHICLEID")); - expect(SDLVehicleDataTypeClusterModeStatus).to(equal(@"VEHICLEDATA_CLUSTERMODESTATUS")); expect(SDLVehicleDataTypeDeviceStatus).to(equal(@"VEHICLEDATA_DEVICESTATUS")); expect(SDLVehicleDataTypeECallInfo).to(equal(@"VEHICLEDATA_ECALLINFO")); - expect(SDLVehicleDataTypeElectronicParkBrakeStatus).to(equal(@"VEHICLEDATA_ELECTRONICPARKBRAKESTATUS")); + expect(SDLVehicleDataTypeAirbagStatus).to(equal(@"VEHICLEDATA_AIRBAGSTATUS")); expect(SDLVehicleDataTypeEmergencyEvent).to(equal(@"VEHICLEDATA_EMERGENCYEVENT")); + expect(SDLVehicleDataTypeClusterModeStatus).to(equal(@"VEHICLEDATA_CLUSTERMODESTATUS")); + expect(SDLVehicleDataTypeMyKey).to(equal(@"VEHICLEDATA_MYKEY")); + expect(SDLVehicleDataTypeBraking).to(equal(@"VEHICLEDATA_BRAKING")); + expect(SDLVehicleDataTypeWiperStatus).to(equal(@"VEHICLEDATA_WIPERSTATUS")); + expect(SDLVehicleDataTypeHeadlampStatus).to(equal(@"VEHICLEDATA_HEADLAMPSTATUS")); + expect(SDLVehicleDataTypeBatteryVoltage).to(equal(@"VEHICLEDATA_BATTVOLTAGE")); expect(SDLVehicleDataTypeEngineOilLife).to(equal(@"VEHICLEDATA_ENGINEOILLIFE")); expect(SDLVehicleDataTypeEngineTorque).to(equal(@"VEHICLEDATA_ENGINETORQUE")); - expect(SDLVehicleDataTypeExternalTemperature).to(equal(@"VEHICLEDATA_EXTERNTEMP")); - expect(SDLVehicleDataTypeFuelConsumption).to(equal(@"VEHICLEDATA_FUELCONSUMPTION")); - expect(SDLVehicleDataTypeFuelLevel).to(equal(@"VEHICLEDATA_FUELLEVEL")); - expect(SDLVehicleDataTypeFuelLevelState).to(equal(@"VEHICLEDATA_FUELLEVEL_STATE")); - expect(SDLVehicleDataTypeFuelRange).to(equal(@"VEHICLEDATA_FUELRANGE")); - expect(SDLVehicleDataTypeGPS).to(equal(@"VEHICLEDATA_GPS")); - expect(SDLVehicleDataTypeHeadlampStatus).to(equal(@"VEHICLEDATA_HEADLAMPSTATUS")); - expect(SDLVehicleDataTypeMyKey).to(equal(@"VEHICLEDATA_MYKEY")); - expect(SDLVehicleDataTypeOdometer).to(equal(@"VEHICLEDATA_ODOMETER")); - expect(SDLVehicleDataTypePRNDL).to(equal(@"VEHICLEDATA_PRNDL")); - expect(SDLVehicleDataTypeRPM).to(equal(@"VEHICLEDATA_RPM")); - expect(SDLVehicleDataTypeSpeed).to(equal(@"VEHICLEDATA_SPEED")); - expect(SDLVehicleDataTypeStabilityControlsStatus).to(equal(@"VEHICLEDATA_STABILITYCONTROLSSTATUS")); + expect(SDLVehicleDataTypeAccelerationPedal).to(equal(@"VEHICLEDATA_ACCPEDAL")); expect(SDLVehicleDataTypeSteeringWheel).to(equal(@"VEHICLEDATA_STEERINGWHEEL")); - expect(SDLVehicleDataTypeTirePressure).to(equal(@"VEHICLEDATA_TIREPRESSURE")); + expect(SDLVehicleDataTypeElectronicParkBrakeStatus).to(equal(@"VEHICLEDATA_ELECTRONICPARKBRAKESTATUS")); expect(SDLVehicleDataTypeTurnSignal).to(equal(@"VEHICLEDATA_TURNSIGNAL")); - expect(SDLVehicleDataTypeVIN).to(equal(@"VEHICLEDATA_VIN")); - expect(SDLVehicleDataTypeWiperStatus).to(equal(@"VEHICLEDATA_WIPERSTATUS")); + expect(SDLVehicleDataTypeCloudAppVehicleID).to(equal(@"VEHICLEDATA_CLOUDAPPVEHICLEID")); }); }); QuickSpecEnd + + diff --git a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m index 03d872ad7..475637fc4 100644 --- a/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/NotificationSpecs/SDLOnVehicleDataSpec.m @@ -2,14 +2,16 @@ // SDLOnVehicleDataSpec.m // SmartDeviceLink + #import <Foundation/Foundation.h> -#import <Nimble/Nimble.h> + #import <Quick/Quick.h> +#import <Nimble/Nimble.h> -#import "SDLRPCFunctionNames.h" -#import "SDLRPCParameterNames.h" -#import "SDLStabilityControlsStatus.h" #import "SmartDeviceLink.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" + QuickSpecBegin(SDLOnVehicleDataSpec) @@ -265,9 +267,11 @@ describe(@"getter/setter tests", ^ { 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")); + }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m index a61f88673..cf8580b53 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLGetVehicleDataSpec.m @@ -3,12 +3,13 @@ // SmartDeviceLink #import <Foundation/Foundation.h> -#import <Nimble/Nimble.h> + #import <Quick/Quick.h> +#import <Nimble/Nimble.h> #import "SDLGetVehicleData.h" -#import "SDLRPCFunctionNames.h" #import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLGetVehicleDataSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m index 259a2ea80..4dbb91ee6 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSubscribeVehicleDataSpec.m @@ -2,13 +2,15 @@ // SDLSubscribeVehicleDataSpec.m // SmartDeviceLink + #import <Foundation/Foundation.h> -#import <Nimble/Nimble.h> + #import <Quick/Quick.h> +#import <Nimble/Nimble.h> -#import "SDLRPCFunctionNames.h" -#import "SDLRPCParameterNames.h" #import "SDLSubscribeVehicleData.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLSubscribeVehicleDataSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m index 07acb13b2..0c15f821d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m @@ -2,13 +2,15 @@ // SDLUnsubscribeVehicleDataSpec.m // SmartDeviceLink + #import <Foundation/Foundation.h> -#import <Nimble/Nimble.h> + #import <Quick/Quick.h> +#import <Nimble/Nimble.h> -#import "SDLRPCFunctionNames.h" -#import "SDLRPCParameterNames.h" #import "SDLUnsubscribeVehicleData.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" QuickSpecBegin(SDLUnsubscribeVehicleDataSpec) diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m index ce6b1d1ab..775f28107 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLGetVehicleDataResponseSpec.m @@ -4,8 +4,9 @@ #import <Foundation/Foundation.h> -#import <Nimble/Nimble.h> + #import <Quick/Quick.h> +#import <Nimble/Nimble.h> #import "SmartDeviceLink.h" #import "SDLRPCParameterNames.h" @@ -265,7 +266,7 @@ describe(@"getter/setter tests", ^ { }); }); - it(@"should set and get Generic Network Signal Data", ^{ + 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 990d05f0a..98667406d 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLSubscribeVehicleDataResponseSpec.m @@ -2,16 +2,19 @@ // SDLSubscribeVehicleDataResponseSpec.m // SmartDeviceLink + #import <Foundation/Foundation.h> -#import <Nimble/Nimble.h> + #import <Quick/Quick.h> +#import <Nimble/Nimble.h> -#import "SDLRPCFunctionNames.h" #import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLSubscribeVehicleDataResponse.h" #import "SDLVehicleDataResult.h" #import "SDLVehicleDataResultCode.h" + QuickSpecBegin(SDLSubscribeVehicleDataResponseSpec) SDLVehicleDataResult* vehicleDataResult = [[SDLVehicleDataResult alloc] init]; diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m index 65ada3148..0cd726f33 100644 --- a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m @@ -2,13 +2,15 @@ // SDLUnsubscribeVehicleDataResponseSpec.m // SmartDeviceLink + #import <Foundation/Foundation.h> -#import <Nimble/Nimble.h> + #import <Quick/Quick.h> +#import <Nimble/Nimble.h> -#import "SDLRPCFunctionNames.h" -#import "SDLRPCParameterNames.h" #import "SDLUnsubscribeVehicleDataResponse.h" +#import "SDLRPCParameterNames.h" +#import "SDLRPCFunctionNames.h" #import "SDLVehicleDataResult.h" #import "SDLVehicleDataResultCode.h" |