diff options
author | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2020-08-11 16:29:42 +0300 |
---|---|---|
committer | leonid lokhmatov, Luxoft <zaqqqqqqqq@gmail.com> | 2020-08-11 16:29:42 +0300 |
commit | 8cdba98545db7e9efc9b29002b8be7115b52552f (patch) | |
tree | 22fa75bd98c8ccddd1dc92fa468b31bf28727618 | |
parent | 67611b289f314f2f6e063aaa924caa376d9f4387 (diff) | |
download | sdl_ios-8cdba98545db7e9efc9b29002b8be7115b52552f.tar.gz |
0266 "New vehicle data GearStatus": code review 4, fix Unsubscribe Vehicle Data and connected tests
6 files changed, 654 insertions, 872 deletions
diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.h b/SmartDeviceLink/SDLUnsubscribeVehicleData.h index 0f04612f0..ed97278f2 100644 --- a/SmartDeviceLink/SDLUnsubscribeVehicleData.h +++ b/SmartDeviceLink/SDLUnsubscribeVehicleData.h @@ -1,150 +1,130 @@ -/* - * 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 - */ -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo emergencyEvent:(BOOL)emergencyEvent engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:headLampStatus:instantFuelConsumption:myKey:odometer:gearStatus:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus: instead"); + * @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:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID: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 - */ -- (instancetype)initWithAccelerationPedalPosition:(BOOL)accelerationPedalPosition airbagStatus:(BOOL)airbagStatus beltStatus:(BOOL)beltStatus bodyInformation:(BOOL)bodyInformation clusterModeStatus:(BOOL)clusterModeStatus deviceStatus:(BOOL)deviceStatus driverBraking:(BOOL)driverBraking eCallInfo:(BOOL)eCallInfo electronicParkBrakeStatus:(BOOL)electronicParkBrakeStatus emergencyEvent:(BOOL)emergencyEvent engineOilLife:(BOOL)engineOilLife engineTorque:(BOOL)engineTorque externalTemperature:(BOOL)externalTemperature fuelLevel:(BOOL)fuelLevel fuelLevelState:(BOOL)fuelLevelState fuelRange:(BOOL)fuelRange gps:(BOOL)gps headLampStatus:(BOOL)headLampStatus instantFuelConsumption:(BOOL)instantFuelConsumption myKey:(BOOL)myKey odometer:(BOOL)odometer prndl:(BOOL)prndl rpm:(BOOL)rpm speed:(BOOL)speed steeringWheelAngle:(BOOL)steeringWheelAngle tirePressure:(BOOL)tirePressure turnSignal:(BOOL)turnSignal wiperStatus:(BOOL)wiperStatus __deprecated_msg("Use initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:headLampStatus:instantFuelConsumption:myKey:odometer:gearStatus:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus: instead"); + * @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:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID: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 - */ -- (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 initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gps:headLampStatus:instantFuelConsumption:myKey:odometer:gearStatus:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus: 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 + */ +- (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:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey: instead"); + +/** + * Convenience init for unsubscribing from all possible vehicle data items. * * @param gps - gps * @param speed - speed @@ -180,239 +160,174 @@ 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 gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID 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 GearStatus */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *accPedalPosition; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *gearStatus; /** - * If true, unsubscribes from Airbag Status - * - * Optional. + * If true, unsubscribes from GPS */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *airbagStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *gps; /** - * If true, unsubscribes from Belt Status - * - * Optional. + * If true, unsubscribes from Speed */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *beltStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *speed; /** - * If true, unsubscribes from Body Information - * - * Optional. + * If true, unsubscribes from RPM */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *bodyInformation; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *rpm; /** - A boolean value. If true, unsubscribes to the Cloud App Vehicle ID - - Optional. + * If true, unsubscribes from Fuel Level */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *cloudAppVehicleID; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelLevel; /** - * If true, unsubscribes from Cluster Mode Status - * - * Optional. + * If true, unsubscribes from Fuel Level State */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *clusterModeStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelLevel_State; /** - * If true, unsubscribes from Device Status - * - * Optional. + * If true, unsubscribes from Fuel Range */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *deviceStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelRange; /** - * If true, unsubscribes from Driver Braking - * - * Optional. + * If true, unsubscribes from Instant Fuel Consumption */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *driverBraking; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *instantFuelConsumption; /** - * If true, unsubscribes from eCallInfo - * - * Optional. + * If true, unsubscribes from External Temperature */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *eCallInfo; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *externalTemperature; /** - A boolean value. If true, unsubscribes to the Electronic Parking Brake Status - - Optional. + * If true, unsubscribes from PRNDL */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *electronicParkBrakeStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *prndl __deprecated_msg("use gearStatus instead on 7.0+ RPC version connections"); /** - * If true, unsubscribes from Emergency Event - * - * Optional. + * If true, unsubscribes from Tire Pressure */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *emergencyEvent; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *tirePressure; /** - * If true, unsubscribes from Engine Oil Life - * - * Optional. + * If true, unsubscribes from Odometer */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *engineOilLife; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *odometer; /** - * If true, unsubscribes from Engine Torque - * - * Optional. + * If true, unsubscribes from Belt Status */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *engineTorque; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *beltStatus; /** - * If true, unsubscribes from External Temperature - * - * Optional. + * If true, unsubscribes from Body Information */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *externalTemperature; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *bodyInformation; /** - * If true, unsubscribes from Fuel Level - * - * Optional. + * If true, unsubscribes from Device Status */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelLevel; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *deviceStatus; /** - * If true, unsubscribes from Fuel Level State - * - * Optional. + * If true, unsubscribes from Driver Braking */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelLevel_State; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *driverBraking; /** - * If true, unsubscribes from Fuel Range - * - * Optional. + * If true, unsubscribes from Wiper Status */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *fuelRange; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *wiperStatus; /** - * See GearStatus - * - * Optional. - * - * @since SDL 7.0.0 + * If true, unsubscribes from Head Lamp Status */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *gearStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *headLampStatus; /** - * If true, unsubscribes from GPS - * - * Optional. + * If true, unsubscribes from Engine Oil Life */ -@property (strong, nonatomic, nullable) 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 (strong, nonatomic, nullable) 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 (strong, nonatomic, nullable) NSNumber<SDLBool> *instantFuelConsumption; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *accPedalPosition; /** - * If true, unsubscribes from PRNDL - * - * Optional. - * - * @deprecated - * @since SDL 7.0.0 + * If true, unsubscribes from Steering Wheel Angle data */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *prndl __deprecated_msg("use gearStatus instead"); +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *steeringWheelAngle; /** - * If true, unsubscribes from My Key - * - * Optional. + * If true, unsubscribes from eCallInfo */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *myKey; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *eCallInfo; /** - * If true, unsubscribes from Odometer - * - * Optional. + * If true, unsubscribes from Airbag Status */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *odometer; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *airbagStatus; /** - * If true, unsubscribes from RPM - * - * Optional. + * If true, unsubscribes from Emergency Event */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *rpm; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *emergencyEvent; /** - * If true, unsubscribes from Speed - * - * Optional. + * If true, unsubscribes from Cluster Mode Status */ -@property (strong, nonatomic, nullable) NSNumber<SDLBool> *speed; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *clusterModeStatus; /** - * If true, unsubscribes from Steering Wheel Angle data - * - * Optional. + * If true, unsubscribes from My Key */ -@property (strong, nonatomic, nullable) 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 (strong, nonatomic, nullable) NSNumber<SDLBool> *tirePressure; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *electronicParkBrakeStatus; /** A boolean value. If true, unsubscribes to the Turn Signal - - Optional. */ @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 (strong, nonatomic, nullable) NSNumber<SDLBool> *wiperStatus; +@property (strong, nonatomic, nullable) NSNumber<SDLBool> *cloudAppVehicleID; /** - Gets the OEM custom vehicle data state for any given OEM custom vehicle data name. - - @param vehicleDataName The name of the OEM custom vehicle data item to unsubscribe for. - @return A boolean value indicating if an unsubscribe request will occur for the OEM custom vehicle data item. + Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. + + @param vehicleDataName The name of the OEM custom vehicle data item. + @param vehicleDataState A boolean value. If true, requests an unsubscribes of the OEM custom vehicle data item. Added SmartDeviceLink 6.0 */ -- (nullable NSNumber<SDLBool> *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +- (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(BOOL)vehicleDataState NS_SWIFT_NAME(setOEMCustomVehicleData(name:state:)); /** - Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. - - @param vehicleDataName The name of the OEM custom vehicle data item. - @param vehicleDataState A boolean value. If true, requests an unsubscribes of the OEM custom vehicle data item. + Gets the OEM custom vehicle data state for any given OEM custom vehicle data name. + + @param vehicleDataName The name of the OEM custom vehicle data item to unsubscribe for. + @return A boolean value indicating if an unsubscribe request will occur for the OEM custom vehicle data item. Added SmartDeviceLink 6.0 */ -- (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(BOOL)vehicleDataState NS_SWIFT_NAME(setOEMCustomVehicleData(name:state:)); +- (nullable NSNumber<SDLBool> *)getOEMCustomVehicleData:(NSString *)vehicleDataName; @end diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleData.m b/SmartDeviceLink/SDLUnsubscribeVehicleData.m index b761654d5..853f07f06 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 @@ -86,8 +59,6 @@ NS_ASSUME_NONNULL_BEGIN return self; } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (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 gearStatus:(nullable NSNumber<SDLBool> *)gearStatus tirePressure:(nullable NSNumber<SDLBool> *)tirePressure odometer:(nullable NSNumber<SDLBool> *)odometer beltStatus:(nullable NSNumber<SDLBool> *)beltStatus bodyInformation:(nullable NSNumber<SDLBool> *)bodyInformation deviceStatus:(nullable NSNumber<SDLBool> *)deviceStatus driverBraking:(nullable NSNumber<SDLBool> *)driverBraking wiperStatus:(nullable NSNumber<SDLBool> *)wiperStatus headLampStatus:(nullable NSNumber<SDLBool> *)headLampStatus engineTorque:(nullable NSNumber<SDLBool> *)engineTorque accPedalPosition:(nullable NSNumber<SDLBool> *)accPedalPosition steeringWheelAngle:(nullable NSNumber<SDLBool> *)steeringWheelAngle engineOilLife:(nullable NSNumber<SDLBool> *)engineOilLife electronicParkBrakeStatus:(nullable NSNumber<SDLBool> *)electronicParkBrakeStatus cloudAppVehicleID:(nullable NSNumber<SDLBool> *)cloudAppVehicleID 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 { self = [self init]; if (!self) { @@ -124,15 +95,21 @@ NS_ASSUME_NONNULL_BEGIN self.myKey = myKey; return self; } -#pragma clang diagnostic pop + +- (void)setGearStatus:(nullable NSNumber<SDLBool> *)gearStatus { + [self.parameters sdl_setObject:gearStatus forName:SDLRPCParameterNameGearStatus]; +} + +- (nullable NSNumber<SDLBool> *)gearStatus { + return [self.parameters sdl_objectForName:SDLRPCParameterNameGearStatus ofClass:NSNumber.class error:nil]; +} - (void)setGps:(nullable NSNumber<SDLBool> *)gps { [self.parameters sdl_setObject:gps forName:SDLRPCParameterNameGPS]; } - (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 { @@ -140,8 +117,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 { @@ -149,8 +125,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 { @@ -158,8 +133,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 { @@ -167,8 +141,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 { @@ -176,8 +149,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 { @@ -185,8 +157,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 { @@ -194,17 +165,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable NSNumber<SDLBool> *)externalTemperature { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class error:&error]; -} - -- (void)setGearStatus:(nullable NSNumber<SDLBool> *)gearStatus { - [self.parameters sdl_setObject:gearStatus forName:SDLRPCParameterNameGearStatus]; -} - -- (nullable NSNumber<SDLBool> *)gearStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameGearStatus ofClass:NSNumber.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:NSNumber.class error:nil]; } - (void)setPrndl:(nullable NSNumber<SDLBool> *)prndl { @@ -212,8 +173,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 { @@ -221,8 +181,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 { @@ -230,8 +189,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 { @@ -239,8 +197,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 { @@ -248,8 +205,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 { @@ -257,8 +213,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 { @@ -266,8 +221,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 { @@ -275,8 +229,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 { @@ -284,8 +237,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 { @@ -293,8 +245,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 { @@ -302,8 +253,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 { @@ -311,8 +261,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 { @@ -320,8 +269,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 { @@ -329,8 +277,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 { @@ -338,8 +285,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 { @@ -347,8 +293,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 { @@ -356,8 +301,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 { @@ -365,8 +309,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 { @@ -374,8 +317,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 { @@ -383,8 +325,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 { @@ -392,8 +333,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)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(BOOL)vehicleDataState { @@ -401,8 +341,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/SDLUnsubscribeVehicleDataResponse.h b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.h index eacd4264f..6e5b7cc8e 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 @@ -78,205 +52,198 @@ 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 gearStatus:(nullable SDLVehicleDataResult *)gearStatus tirePressure:(nullable SDLVehicleDataResult *)tirePressure odometer:(nullable SDLVehicleDataResult *)odometer beltStatus:(nullable SDLVehicleDataResult *)beltStatus bodyInformation:(nullable SDLVehicleDataResult *)bodyInformation deviceStatus:(nullable SDLVehicleDataResult *)deviceStatus driverBraking:(nullable SDLVehicleDataResult *)driverBraking wiperStatus:(nullable SDLVehicleDataResult *)wiperStatus headLampStatus:(nullable SDLVehicleDataResult *)headLampStatus engineTorque:(nullable SDLVehicleDataResult *)engineTorque accPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition steeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle engineOilLife:(nullable SDLVehicleDataResult *)engineOilLife electronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus cloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID 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) - - Optional + The result of requesting to unsubscribe to the GearStatus. */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *accPedalPosition; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *gearStatus; /** - The result of requesting to unsubscribe to the airbag status + The result of requesting to unsubscribe to the GPSData. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *airbagStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *gps; /** - The result of requesting to unsubscribe to the status of the seat belts. + The result of requesting to unsubscribe to the vehicle speed in kilometers per hour. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *beltStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *speed; /** - The result of requesting to unsubscribe to the body information including power modes. + The result of requesting to unsubscribe to the number of revolutions per minute of the engine. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *bodyInformation; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *rpm; /** - The result of requesting to unsubscribe to the cloud app vehicle id + The result of requesting to unsubscribe to the fuel level in the tank (percentage) Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *cloudAppVehicleID; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelLevel; /** - The result of requesting to unsubscribe to the cluster modes + The result of requesting to unsubscribe to the fuel level state. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *clusterModes; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelLevel_State; /** - The result of requesting to unsubscribe to the device status including signal and battery strength. + The result of requesting to unsubscribe to the fuel range. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *deviceStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelRange; /** - The result of requesting to unsubscribe to the status of the brake pedal. + The result of requesting to unsubscribe to the instantaneous fuel consumption in microlitres. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *driverBraking; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *instantFuelConsumption; /** - The result of requesting to unsubscribe to the emergency call info + The result of requesting to unsubscribe to the external temperature in degrees celsius. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *eCallInfo; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *externalTemperature; /** - The result of requesting to unsubscribe to the electronic parking brake status + The result of requesting to unsubscribe to the PRNDL status. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *electronicParkBrakeStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *prndl __deprecated_msg("use gearStatus instead"); /** - The result of requesting to unsubscribe to the emergency event + The result of requesting to unsubscribe to the tireStatus. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *emergencyEvent; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *tirePressure; /** - 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 odometer in km. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *engineOilLife; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *odometer; /** - 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 status of the seat belts. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *engineTorque; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *beltStatus; /** - The result of requesting to unsubscribe to the external temperature in degrees celsius. + The result of requesting to unsubscribe to the body information including power modes. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *externalTemperature; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *bodyInformation; /** - The result of requesting to unsubscribe to the fuel level in the tank (percentage) + The result of requesting to unsubscribe to the device status including signal and battery strength. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelLevel; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *deviceStatus; /** - The result of requesting to unsubscribe to the fuel level state. + The result of requesting to unsubscribe to the status of the brake pedal. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelLevel_State; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *driverBraking; /** - The result of requesting to unsubscribe to the fuel range. + The result of requesting to unsubscribe to the status of the wipers. Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *fuelRange; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *wiperStatus; /** - * See GearStatus - * - * Optional. - * - * @since SDL 7.0.0 + The result of requesting to unsubscribe to the status of the head lamps. + + Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *gearStatus; +@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 (strong, nonatomic, nullable) 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 (strong, nonatomic, nullable) 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 (strong, nonatomic, nullable) SDLVehicleDataResult *instantFuelConsumption; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *accPedalPosition; /** - The result of requesting to unsubscribe to the PRNDL status. + The result of requesting to unsubscribe to the current angle of the steering wheel (in deg) Optional - - * @deprecated - * @since SDL 7.0.0 */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *prndl __deprecated_msg("use gearStatus instead"); +@property (strong, nonatomic, nullable) SDLVehicleDataResult *steeringWheelAngle; /** - The result of requesting to unsubscribe to the myKey status + The result of requesting to unsubscribe to the emergency call info Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *myKey; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *eCallInfo; /** - The result of requesting to unsubscribe to the odometer in km. + The result of requesting to unsubscribe to the airbag status Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *odometer; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *airbagStatus; /** - The result of requesting to unsubscribe to the number of revolutions per minute of the engine. + The result of requesting to unsubscribe to the emergency event Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *rpm; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *emergencyEvent; /** - The result of requesting to unsubscribe to the vehicle speed in kilometers per hour. + The result of requesting to unsubscribe to the cluster modes Optional */ -@property (strong, nonatomic, nullable) SDLVehicleDataResult *speed; +@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 (strong, nonatomic, nullable) 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 (strong, nonatomic, nullable) SDLVehicleDataResult *tirePressure; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *electronicParkBrakeStatus; /** The result of requesting to unsubscribe to the turn signal @@ -286,31 +253,31 @@ NS_ASSUME_NONNULL_BEGIN @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 (strong, nonatomic, nullable) SDLVehicleDataResult *wiperStatus; +@property (strong, nonatomic, nullable) SDLVehicleDataResult *cloudAppVehicleID; /** - Gets the OEM custom vehicle data state for any given OEM custom vehicle data name. + Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. @param vehicleDataName The name of the OEM custom vehicle data item. - @return SDLVehicleDataResult object containing custom data type and result code information. + @param vehicleDataState SDLVehicleDataResult object containing custom data type and result code information. Added SmartDeviceLink 6.0 */ -- (nullable SDLVehicleDataResult *)getOEMCustomVehicleData:(NSString *)vehicleDataName; +- (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(SDLVehicleDataResult *)vehicleDataState NS_SWIFT_NAME(setOEMCustomVehicleData(name:state:)); /** - Sets the OEM custom vehicle data state for any given OEM custom vehicle data name. + Gets the OEM custom vehicle data state for any given OEM custom vehicle data name. @param vehicleDataName The name of the OEM custom vehicle data item. - @param vehicleDataState SDLVehicleDataResult object containing custom data type and result code information. + @return SDLVehicleDataResult object containing custom data type and result code information. Added SmartDeviceLink 6.0 */ -- (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(SDLVehicleDataResult *)vehicleDataState NS_SWIFT_NAME(setOEMCustomVehicleData(name:state:)); +- (nullable SDLVehicleDataResult *)getOEMCustomVehicleData:(NSString *)vehicleDataName; @end diff --git a/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m b/SmartDeviceLink/SDLUnsubscribeVehicleDataResponse.m index 287874e4a..ccb9309a8 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 @@ -88,13 +61,21 @@ NS_ASSUME_NONNULL_BEGIN return self; } +- (void)setGearStatus:(nullable SDLVehicleDataResult *)gearStatus { + [self.parameters sdl_setObject:gearStatus forName:SDLRPCParameterNameGearStatus]; +} + +- (nullable SDLVehicleDataResult *)gearStatus { + NSError *error = nil; + return [self.parameters sdl_objectForName:SDLRPCParameterNameGearStatus ofClass:SDLVehicleDataResult.class error:&error]; +} + - (void)setGps:(nullable SDLVehicleDataResult *)gps { [self.parameters sdl_setObject:gps forName:SDLRPCParameterNameGPS]; } - (nullable SDLVehicleDataResult *)gps { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameGPS ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setSpeed:(nullable SDLVehicleDataResult *)speed { @@ -102,8 +83,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)speed { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSpeed ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setRpm:(nullable SDLVehicleDataResult *)rpm { @@ -111,8 +91,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)rpm { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameRPM ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setFuelLevel:(nullable SDLVehicleDataResult *)fuelLevel { @@ -120,8 +99,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)fuelLevel { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevel ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setFuelLevel_State:(nullable SDLVehicleDataResult *)fuelLevel_State { @@ -129,8 +107,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)fuelLevel_State { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelLevelState ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setFuelRange:(nullable SDLVehicleDataResult *)fuelRange { @@ -138,8 +115,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)fuelRange { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameFuelRange ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setInstantFuelConsumption:(nullable SDLVehicleDataResult *)instantFuelConsumption { @@ -147,8 +123,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)instantFuelConsumption { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameInstantFuelConsumption ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setExternalTemperature:(nullable SDLVehicleDataResult *)externalTemperature { @@ -156,17 +131,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)externalTemperature { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:SDLVehicleDataResult.class error:&error]; -} - -- (void)setGearStatus:(nullable SDLVehicleDataResult *)gearStatus { - [self.parameters sdl_setObject:gearStatus forName:SDLRPCParameterNameGearStatus]; -} - -- (nullable SDLVehicleDataResult *)gearStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameGearStatus ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameExternalTemperature ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setPrndl:(nullable SDLVehicleDataResult *)prndl { @@ -174,8 +139,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)prndl { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNamePRNDL ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setTirePressure:(nullable SDLVehicleDataResult *)tirePressure { @@ -183,8 +147,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)tirePressure { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameTirePressure ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setOdometer:(nullable SDLVehicleDataResult *)odometer { @@ -192,8 +155,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)odometer { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameOdometer ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setBeltStatus:(nullable SDLVehicleDataResult *)beltStatus { @@ -201,8 +163,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)beltStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameBeltStatus ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setBodyInformation:(nullable SDLVehicleDataResult *)bodyInformation { @@ -210,8 +171,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)bodyInformation { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameBodyInformation ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setDeviceStatus:(nullable SDLVehicleDataResult *)deviceStatus { @@ -219,8 +179,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)deviceStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameDeviceStatus ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setDriverBraking:(nullable SDLVehicleDataResult *)driverBraking { @@ -228,8 +187,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)driverBraking { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameDriverBraking ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setWiperStatus:(nullable SDLVehicleDataResult *)wiperStatus { @@ -237,8 +195,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)wiperStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameWiperStatus ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setHeadLampStatus:(nullable SDLVehicleDataResult *)headLampStatus { @@ -246,8 +203,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)headLampStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameHeadLampStatus ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setEngineOilLife:(nullable SDLVehicleDataResult *)engineOilLife { @@ -255,8 +211,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)engineOilLife { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineOilLife ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setEngineTorque:(nullable SDLVehicleDataResult *)engineTorque { @@ -264,8 +219,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)engineTorque { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEngineTorque ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setAccPedalPosition:(nullable SDLVehicleDataResult *)accPedalPosition { @@ -273,8 +227,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)accPedalPosition { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameAccelerationPedalPosition ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setSteeringWheelAngle:(nullable SDLVehicleDataResult *)steeringWheelAngle { @@ -282,8 +235,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)steeringWheelAngle { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameSteeringWheelAngle ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setECallInfo:(nullable SDLVehicleDataResult *)eCallInfo { @@ -291,8 +243,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)eCallInfo { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameECallInfo ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setAirbagStatus:(nullable SDLVehicleDataResult *)airbagStatus { @@ -300,8 +251,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)airbagStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameAirbagStatus ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setEmergencyEvent:(nullable SDLVehicleDataResult *)emergencyEvent { @@ -309,8 +259,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)emergencyEvent { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameEmergencyEvent ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setClusterModes:(nullable SDLVehicleDataResult *)clusterModes { @@ -318,8 +267,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)clusterModes { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameClusterModes ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameClusterModes ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setMyKey:(nullable SDLVehicleDataResult *)myKey { @@ -327,8 +275,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)myKey { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameMyKey ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setElectronicParkBrakeStatus:(nullable SDLVehicleDataResult *)electronicParkBrakeStatus { @@ -336,8 +283,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)electronicParkBrakeStatus { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameElectronicParkBrakeStatus ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setTurnSignal:(nullable SDLVehicleDataResult *)turnSignal { @@ -345,8 +291,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)turnSignal { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameTurnSignal ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setCloudAppVehicleID:(nullable SDLVehicleDataResult *)cloudAppVehicleID { @@ -354,8 +299,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)cloudAppVehicleID { - NSError *error = nil; - return [self.parameters sdl_objectForName:SDLRPCParameterNameCloudAppVehicleID ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:SDLRPCParameterNameCloudAppVehicleID ofClass:SDLVehicleDataResult.class error:nil]; } - (void)setOEMCustomVehicleData:(NSString *)vehicleDataName withVehicleDataState:(SDLVehicleDataResult *)vehicleDataState { @@ -363,8 +307,7 @@ NS_ASSUME_NONNULL_BEGIN } - (nullable SDLVehicleDataResult *)getOEMCustomVehicleData:(NSString *)vehicleDataName { - NSError *error = nil; - return [self.parameters sdl_objectForName:vehicleDataName ofClass:SDLVehicleDataResult.class error:&error]; + return [self.parameters sdl_objectForName:vehicleDataName ofClass:SDLVehicleDataResult.class error:nil]; } @end diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m index bcda19e31..179da14cc 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLUnsubscribeVehicleDataSpec.m @@ -2,18 +2,20 @@ // 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) -describe(@"Getter/Setter Tests", ^ { - it(@"Should set and get correctly", ^ { +describe(@"getter/setter tests", ^{ + it(@"should set and get correctly", ^{ SDLUnsubscribeVehicleData* testRequest = [[SDLUnsubscribeVehicleData alloc] init]; testRequest.accPedalPosition = @YES; @@ -33,6 +35,7 @@ describe(@"Getter/Setter Tests", ^ { testRequest.fuelLevel = @YES; testRequest.fuelLevel_State = @YES; testRequest.fuelRange = @YES; + testRequest.gearStatus = @YES; testRequest.gps = @YES; testRequest.headLampStatus = @YES; testRequest.instantFuelConsumption = @YES; @@ -42,7 +45,6 @@ describe(@"Getter/Setter Tests", ^ { #pragma clang diagnostic ignored "-Wdeprecated-declarations" testRequest.prndl = @YES; #pragma clang diagnostic pop - testRequest.gearStatus = @YES; testRequest.rpm = @YES; testRequest.speed = @YES; testRequest.steeringWheelAngle = @YES; @@ -67,6 +69,7 @@ describe(@"Getter/Setter Tests", ^ { expect(testRequest.fuelLevel).to(equal(@YES)); expect(testRequest.fuelLevel_State).to(equal(@YES)); expect(testRequest.fuelRange).to(equal(@YES)); + expect(testRequest.gearStatus).to(equal(@YES)); expect(testRequest.gps).to(equal(@YES)); expect(testRequest.headLampStatus).to(equal(@YES)); expect(testRequest.instantFuelConsumption).to(equal(@YES)); @@ -76,7 +79,6 @@ describe(@"Getter/Setter Tests", ^ { #pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop - expect(testRequest.gearStatus).to(equal(@YES)); expect(testRequest.rpm).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -85,7 +87,7 @@ describe(@"Getter/Setter Tests", ^ { expect(testRequest.wiperStatus).to(equal(@YES)); }); - it(@"Should get correctly when initialized with a dictionary", ^ { + it(@"should get correctly when initialized with a dictionary", ^ { NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameRequest: @{SDLRPCParameterNameParameters: @{SDLRPCParameterNameAccelerationPedalPosition:@YES, @@ -97,7 +99,7 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameDeviceStatus:@YES, SDLRPCParameterNameDriverBraking:@YES, SDLRPCParameterNameECallInfo:@YES, - SDLRPCParameterNameElectronicParkBrakeStatus:@YES, + SDLRPCParameterNameElectronicParkBrakeStatus: @YES, SDLRPCParameterNameEmergencyEvent:@YES, SDLRPCParameterNameEngineOilLife:@YES, SDLRPCParameterNameEngineTorque:@YES, @@ -105,19 +107,22 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameFuelLevel:@YES, SDLRPCParameterNameFuelLevelState:@YES, SDLRPCParameterNameFuelRange:@YES, + SDLRPCParameterNameGearStatus:@YES, SDLRPCParameterNameGPS:@YES, SDLRPCParameterNameHeadLampStatus:@YES, SDLRPCParameterNameInstantFuelConsumption:@YES, SDLRPCParameterNameMyKey:@YES, SDLRPCParameterNameOdometer:@YES, +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLRPCParameterNamePRNDL:@YES, +#pragma clang diagnostic pop SDLRPCParameterNameRPM:@YES, SDLRPCParameterNameSpeed:@YES, SDLRPCParameterNameSteeringWheelAngle:@YES, SDLRPCParameterNameTirePressure:@YES, SDLRPCParameterNameTurnSignal:@YES, SDLRPCParameterNameWiperStatus:@YES, - SDLRPCParameterNameGearStatus:@YES }, SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}}; #pragma clang diagnostic push @@ -142,6 +147,7 @@ describe(@"Getter/Setter Tests", ^ { expect(testRequest.fuelLevel).to(equal(@YES)); expect(testRequest.fuelLevel_State).to(equal(@YES)); expect(testRequest.fuelRange).to(equal(@YES)); + expect(testRequest.gearStatus).to(equal(@YES)); expect(testRequest.gps).to(equal(@YES)); expect(testRequest.headLampStatus).to(equal(@YES)); expect(testRequest.instantFuelConsumption).to(equal(@YES)); @@ -151,7 +157,6 @@ describe(@"Getter/Setter Tests", ^ { #pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop - expect(testRequest.gearStatus).to(equal(@YES)); expect(testRequest.rpm).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); @@ -162,52 +167,53 @@ describe(@"Getter/Setter Tests", ^ { }); describe(@"initializers", ^{ - context(@"init", ^{ - SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] init]; + context(@"init", ^{ + SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] init]; - it (@"expect properties to be nil", ^{ - expect(testRequest.accPedalPosition).to(beNil()); - expect(testRequest.airbagStatus).to(beNil()); - expect(testRequest.beltStatus).to(beNil()); - expect(testRequest.bodyInformation).to(beNil()); - expect(testRequest.cloudAppVehicleID).to(beNil()); - expect(testRequest.clusterModeStatus).to(beNil()); - expect(testRequest.deviceStatus).to(beNil()); - expect(testRequest.driverBraking).to(beNil()); - expect(testRequest.eCallInfo).to(beNil()); - expect(testRequest.electronicParkBrakeStatus).to(beNil()); - expect(testRequest.emergencyEvent).to(beNil()); - expect(testRequest.engineOilLife).to(beNil()); - expect(testRequest.engineTorque).to(beNil()); - expect(testRequest.externalTemperature).to(beNil()); - expect(testRequest.fuelLevel).to(beNil()); - expect(testRequest.fuelLevel_State).to(beNil()); - expect(testRequest.fuelRange).to(beNil()); - expect(testRequest.gps).to(beNil()); - expect(testRequest.headLampStatus).to(beNil()); - expect(testRequest.instantFuelConsumption).to(beNil()); - expect(testRequest.myKey).to(beNil()); - expect(testRequest.odometer).to(beNil()); + it(@"expect all properties to be set properly", ^{ + expect(testRequest.accPedalPosition).to(beNil()); + expect(testRequest.airbagStatus).to(beNil()); + expect(testRequest.beltStatus).to(beNil()); + expect(testRequest.bodyInformation).to(beNil()); + expect(testRequest.cloudAppVehicleID).to(beNil()); + expect(testRequest.clusterModeStatus).to(beNil()); + expect(testRequest.deviceStatus).to(beNil()); + expect(testRequest.driverBraking).to(beNil()); + expect(testRequest.eCallInfo).to(beNil()); + expect(testRequest.electronicParkBrakeStatus).to(beNil()); + expect(testRequest.emergencyEvent).to(beNil()); + expect(testRequest.engineOilLife).to(beNil()); + expect(testRequest.engineTorque).to(beNil()); + expect(testRequest.externalTemperature).to(beNil()); + expect(testRequest.fuelLevel).to(beNil()); + expect(testRequest.fuelLevel_State).to(beNil()); + expect(testRequest.fuelRange).to(beNil()); + expect(testRequest.gearStatus).to(beNil()); + expect(testRequest.gps).to(beNil()); + expect(testRequest.headLampStatus).to(beNil()); + expect(testRequest.instantFuelConsumption).to(beNil()); + expect(testRequest.myKey).to(beNil()); + expect(testRequest.odometer).to(beNil()); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testRequest.prndl).to(beNil()); + expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop - expect(testRequest.gearStatus).to(beNil()); - expect(testRequest.rpm).to(beNil()); - expect(testRequest.speed).to(beNil()); - expect(testRequest.steeringWheelAngle).to(beNil()); - expect(testRequest.tirePressure).to(beNil()); - expect(testRequest.turnSignal).to(beNil()); - expect(testRequest.wiperStatus).to(beNil()); + expect(testRequest.rpm).to(beNil()); + expect(testRequest.speed).to(beNil()); + expect(testRequest.steeringWheelAngle).to(beNil()); + expect(testRequest.tirePressure).to(beNil()); + expect(testRequest.turnSignal).to(beNil()); + expect(testRequest.wiperStatus).to(beNil()); + }); }); -}); + context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus:", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES electronicParkBrakeStatus:YES emergencyEvent:YES engineOilLife:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES fuelRange:YES gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES turnSignal:YES wiperStatus:YES]; #pragma clang diagnostic pop - it (@"expect all properties to set properly", ^{ + it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); expect(testRequest.airbagStatus).to(equal(@YES)); expect(testRequest.beltStatus).to(equal(@YES)); @@ -225,36 +231,80 @@ describe(@"initializers", ^{ expect(testRequest.fuelLevel).to(equal(@YES)); expect(testRequest.fuelLevel_State).to(equal(@YES)); expect(testRequest.fuelRange).to(equal(@YES)); + expect(testRequest.gearStatus).to(beNil()); expect(testRequest.gps).to(equal(@YES)); expect(testRequest.headLampStatus).to(equal(@YES)); expect(testRequest.instantFuelConsumption).to(equal(@YES)); expect(testRequest.myKey).to(equal(@YES)); expect(testRequest.odometer).to(equal(@YES)); - expect(testRequest.gearStatus).to(beNil()); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + expect(testRequest.prndl).to(equal(@YES)); +#pragma clang diagnostic pop expect(testRequest.rpm).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); expect(testRequest.tirePressure).to(equal(@YES)); expect(testRequest.turnSignal).to(equal(@YES)); expect(testRequest.wiperStatus).to(equal(@YES)); + }); + }); + + context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus:", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES cloudAppVehicleID:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES electronicParkBrakeStatus:YES emergencyEvent:YES engineOilLife:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES fuelRange:YES gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES turnSignal:YES wiperStatus:YES]; +#pragma clang diagnostic pop + + it(@"expect all properties to be set properly", ^{ + expect(testRequest.accPedalPosition).to(equal(@YES)); + expect(testRequest.airbagStatus).to(equal(@YES)); + expect(testRequest.beltStatus).to(equal(@YES)); + expect(testRequest.bodyInformation).to(equal(@YES)); + expect(testRequest.cloudAppVehicleID).to(equal(@YES)); + expect(testRequest.clusterModeStatus).to(equal(@YES)); + expect(testRequest.deviceStatus).to(equal(@YES)); + expect(testRequest.driverBraking).to(equal(@YES)); + expect(testRequest.eCallInfo).to(equal(@YES)); + expect(testRequest.electronicParkBrakeStatus).to(equal(@YES)); + expect(testRequest.emergencyEvent).to(equal(@YES)); + expect(testRequest.engineOilLife).to(equal(@YES)); + expect(testRequest.engineTorque).to(equal(@YES)); + expect(testRequest.externalTemperature).to(equal(@YES)); + expect(testRequest.fuelLevel).to(equal(@YES)); + expect(testRequest.fuelLevel_State).to(equal(@YES)); + expect(testRequest.fuelRange).to(equal(@YES)); + expect(testRequest.gearStatus).to(beNil()); + expect(testRequest.gps).to(equal(@YES)); + expect(testRequest.headLampStatus).to(equal(@YES)); + expect(testRequest.instantFuelConsumption).to(equal(@YES)); + expect(testRequest.myKey).to(equal(@YES)); + expect(testRequest.odometer).to(equal(@YES)); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testRequest.prndl).to(equal(@YES)); #pragma clang diagnostic pop + expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.speed).to(equal(@YES)); + expect(testRequest.steeringWheelAngle).to(equal(@YES)); + expect(testRequest.tirePressure).to(equal(@YES)); + expect(testRequest.turnSignal).to(equal(@YES)); + expect(testRequest.wiperStatus).to(equal(@YES)); }); }); - context(@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus:", ^{ + context (@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:emergencyEvent:engineTorque:externalTemperature:fuelLevel:fuelLevelState:gps:headLampStatus:instantFuelConsumption:myKey:odometer:prndl:rpm:speed:steeringWheelAngle:tirePressure:wiperStatus:", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES emergencyEvent:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES gps:YES headLampStatus:YES instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES wiperStatus:YES]; + SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithAccelerationPedalPosition:YES airbagStatus:YES beltStatus:YES bodyInformation:YES clusterModeStatus:YES deviceStatus:YES driverBraking:YES eCallInfo:YES emergencyEvent:YES engineTorque:YES externalTemperature:YES fuelLevel:YES fuelLevelState:YES gps:YES headLampStatus:NO instantFuelConsumption:YES myKey:YES odometer:YES prndl:YES rpm:YES speed:YES steeringWheelAngle:YES tirePressure:YES wiperStatus:YES]; #pragma clang diagnostic pop - it (@"expect all properties to set properly", ^{ + it(@"expect all properties to be set properly", ^{ expect(testRequest.accPedalPosition).to(equal(@YES)); expect(testRequest.airbagStatus).to(equal(@YES)); expect(testRequest.beltStatus).to(equal(@YES)); expect(testRequest.bodyInformation).to(equal(@YES)); + expect(testRequest.cloudAppVehicleID).to(beNil()); expect(testRequest.clusterModeStatus).to(equal(@YES)); expect(testRequest.deviceStatus).to(equal(@YES)); expect(testRequest.driverBraking).to(equal(@YES)); @@ -264,117 +314,79 @@ describe(@"initializers", ^{ expect(testRequest.engineOilLife).to(beNil()); expect(testRequest.engineTorque).to(equal(@YES)); expect(testRequest.externalTemperature).to(equal(@YES)); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testRequest.fuelLevel).to(equal(@YES)); expect(testRequest.fuelLevel_State).to(equal(@YES)); +#pragma clang diagnostic push expect(testRequest.fuelRange).to(beNil()); + expect(testRequest.gearStatus).to(beNil()); expect(testRequest.gps).to(equal(@YES)); - expect(testRequest.headLampStatus).to(equal(@YES)); + expect(testRequest.headLampStatus).to(equal(@NO)); expect(testRequest.instantFuelConsumption).to(equal(@YES)); expect(testRequest.myKey).to(equal(@YES)); expect(testRequest.odometer).to(equal(@YES)); - expect(testRequest.gearStatus).to(beNil()); + expect(testRequest.prndl).to(equal(@YES)); expect(testRequest.rpm).to(equal(@YES)); expect(testRequest.speed).to(equal(@YES)); expect(testRequest.steeringWheelAngle).to(equal(@YES)); expect(testRequest.tirePressure).to(equal(@YES)); expect(testRequest.turnSignal).to(beNil()); expect(testRequest.wiperStatus).to(equal(@YES)); -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testRequest.prndl).to(equal(@YES)); -#pragma clang diagnostic pop }); }); - context (@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gearStatus:gps:headLampStatus:instantFuelConsumption:myKey:odometer:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus:", ^{ - SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES fuelLevel:@YES fuelLevel_State:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES]; - - it (@"Expect all properties are set to YES", ^{ - expect(testRequest.accPedalPosition).to(equal(@YES)); - expect(testRequest.airbagStatus).to(equal(@YES)); - expect(testRequest.beltStatus).to(equal(@YES)); - expect(testRequest.bodyInformation).to(equal(@YES)); - expect(testRequest.cloudAppVehicleID).to(equal(@YES)); - expect(testRequest.clusterModeStatus).to(equal(@YES)); - expect(testRequest.deviceStatus).to(equal(@YES)); - expect(testRequest.driverBraking).to(equal(@YES)); - expect(testRequest.eCallInfo).to(equal(@YES)); - expect(testRequest.electronicParkBrakeStatus).to(equal(@YES)); - expect(testRequest.emergencyEvent).to(equal(@YES)); - expect(testRequest.engineOilLife).to(equal(@YES)); - expect(testRequest.engineTorque).to(equal(@YES)); - expect(testRequest.externalTemperature).to(equal(@YES)); - expect(testRequest.fuelLevel).to(equal(@YES)); - expect(testRequest.fuelLevel_State).to(equal(@YES)); - expect(testRequest.fuelRange).to(equal(@YES)); - expect(testRequest.gps).to(equal(@YES)); - expect(testRequest.headLampStatus).to(equal(@YES)); - expect(testRequest.instantFuelConsumption).to(equal(@YES)); - expect(testRequest.myKey).to(equal(@YES)); - expect(testRequest.odometer).to(equal(@YES)); - expect(testRequest.gearStatus).to(equal(@YES)); - expect(testRequest.rpm).to(equal(@YES)); - expect(testRequest.speed).to(equal(@YES)); - expect(testRequest.steeringWheelAngle).to(equal(@YES)); - expect(testRequest.tirePressure).to(equal(@YES)); - expect(testRequest.turnSignal).to(equal(@YES)); - expect(testRequest.wiperStatus).to(equal(@YES)); + context (@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModeStatus:myKey:handsOffSteering:", ^{ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testRequest.prndl).to(beNil()); + SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithGps:@YES speed:@YES rpm:@YES fuelLevel:@YES fuelLevel_State:@YES instantFuelConsumption:@YES fuelRange:@YES externalTemperature:@YES turnSignal:@YES gearStatus:@YES tirePressure:@YES odometer:@YES beltStatus:@YES bodyInformation:@YES deviceStatus:@YES driverBraking:@YES wiperStatus:@YES headLampStatus:@YES engineTorque:@YES accPedalPosition:@YES steeringWheelAngle:@YES engineOilLife:@YES electronicParkBrakeStatus:@YES cloudAppVehicleID:@YES eCallInfo:@YES airbagStatus:@YES emergencyEvent:@YES clusterModeStatus:@YES myKey:@YES]; #pragma clang diagnostic pop - }); - }); - - - - context (@"initWithAccelerationPedalPosition:airbagStatus:beltStatus:bodyInformation:cloudAppVehicleID:clusterModeStatus:deviceStatus:driverBraking:eCallInfo:electronicParkBrakeStatus:emergencyEvent:engineOilLife:engineTorque:externalTemperature:fuelLevel:fuelLevelState:fuelRange:gearStatus:gps:headLampStatus:instantFuelConsumption:myKey:odometer:rpm:speed:steeringWheelAngle:tirePressure:turnSignal:wiperStatus:", ^{ - SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] initWithGps:@NO speed:@NO rpm:@NO fuelLevel:@NO fuelLevel_State:@NO instantFuelConsumption:@NO fuelRange:@NO externalTemperature:@NO turnSignal:@NO gearStatus:@NO tirePressure:@NO odometer:@NO beltStatus:@NO bodyInformation:@NO deviceStatus:@NO driverBraking:@NO wiperStatus:@NO headLampStatus:@NO engineTorque:@NO accPedalPosition:@NO steeringWheelAngle:@NO engineOilLife:@NO electronicParkBrakeStatus:@NO cloudAppVehicleID:@NO eCallInfo:@NO airbagStatus:@NO emergencyEvent:@NO clusterModeStatus:@NO myKey:@NO]; - it (@"Expect all properties are set to NO", ^{ - expect(testRequest.accPedalPosition).to(equal(@NO)); - expect(testRequest.airbagStatus).to(equal(@NO)); - expect(testRequest.beltStatus).to(equal(@NO)); - expect(testRequest.bodyInformation).to(equal(@NO)); - expect(testRequest.cloudAppVehicleID).to(equal(@NO)); - expect(testRequest.clusterModeStatus).to(equal(@NO)); - expect(testRequest.deviceStatus).to(equal(@NO)); - expect(testRequest.driverBraking).to(equal(@NO)); - expect(testRequest.eCallInfo).to(equal(@NO)); - expect(testRequest.electronicParkBrakeStatus).to(equal(@NO)); - expect(testRequest.emergencyEvent).to(equal(@NO)); - expect(testRequest.engineOilLife).to(equal(@NO)); - expect(testRequest.engineTorque).to(equal(@NO)); - expect(testRequest.externalTemperature).to(equal(@NO)); - expect(testRequest.fuelLevel).to(equal(@NO)); - expect(testRequest.fuelLevel_State).to(equal(@NO)); - expect(testRequest.fuelRange).to(equal(@NO)); - expect(testRequest.gps).to(equal(@NO)); - expect(testRequest.headLampStatus).to(equal(@NO)); - expect(testRequest.instantFuelConsumption).to(equal(@NO)); - expect(testRequest.myKey).to(equal(@NO)); - expect(testRequest.odometer).to(equal(@NO)); - expect(testRequest.gearStatus).to(equal(@NO)); - expect(testRequest.rpm).to(equal(@NO)); - expect(testRequest.speed).to(equal(@NO)); - expect(testRequest.steeringWheelAngle).to(equal(@NO)); - expect(testRequest.tirePressure).to(equal(@NO)); - expect(testRequest.turnSignal).to(equal(@NO)); - expect(testRequest.wiperStatus).to(equal(@NO)); + it(@"expect all properties to be set properly", ^{ + expect(testRequest.accPedalPosition).to(equal(@YES)); + expect(testRequest.airbagStatus).to(equal(@YES)); + expect(testRequest.beltStatus).to(equal(@YES)); + expect(testRequest.bodyInformation).to(equal(@YES)); + expect(testRequest.cloudAppVehicleID).to(equal(@YES)); + expect(testRequest.clusterModeStatus).to(equal(@YES)); + expect(testRequest.deviceStatus).to(equal(@YES)); + expect(testRequest.driverBraking).to(equal(@YES)); + expect(testRequest.eCallInfo).to(equal(@YES)); + expect(testRequest.electronicParkBrakeStatus).to(equal(@YES)); + expect(testRequest.emergencyEvent).to(equal(@YES)); + expect(testRequest.engineOilLife).to(equal(@YES)); + expect(testRequest.engineTorque).to(equal(@YES)); + expect(testRequest.externalTemperature).to(equal(@YES)); + expect(testRequest.fuelLevel).to(equal(@YES)); + expect(testRequest.fuelLevel_State).to(equal(@YES)); + expect(testRequest.fuelRange).to(equal(@YES)); + expect(testRequest.gearStatus).to(equal(@YES)); + expect(testRequest.gps).to(equal(@YES)); + expect(testRequest.headLampStatus).to(equal(@YES)); + expect(testRequest.instantFuelConsumption).to(equal(@YES)); + expect(testRequest.myKey).to(equal(@YES)); + expect(testRequest.odometer).to(equal(@YES)); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" expect(testRequest.prndl).to(beNil()); #pragma clang diagnostic pop + expect(testRequest.rpm).to(equal(@YES)); + expect(testRequest.speed).to(equal(@YES)); + expect(testRequest.steeringWheelAngle).to(equal(@YES)); + expect(testRequest.tirePressure).to(equal(@YES)); + expect(testRequest.turnSignal).to(equal(@YES)); + expect(testRequest.wiperStatus).to(equal(@YES)); }); }); - context(@"Should set and get OEM Custom Vehicle Data", ^{ + context(@"should set and get OEM Custom Vehicle Data", ^{ SDLUnsubscribeVehicleData *testRequest = [[SDLUnsubscribeVehicleData alloc] init]; [testRequest setOEMCustomVehicleData:@"customVehicleData" withVehicleDataState:NO]; [testRequest setOEMCustomVehicleData:@"customVehicleData1" withVehicleDataState:YES]; - it(@"expect all properties to set properly", ^{ - expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(equal(@NO)); - expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(equal(@YES)); + + it(@"expect OEM Custom Vehicle Data to be set properly", ^{ + expect([testRequest getOEMCustomVehicleData:@"customVehicleData"]).to(beFalse()); + expect([testRequest getOEMCustomVehicleData:@"customVehicleData1"]).to(beTrue()); }); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m b/SmartDeviceLinkTests/RPCSpecs/ResponseSpecs/SDLUnsubscribeVehicleDataResponseSpec.m index c079eed34..f4151b6c9 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" @@ -17,238 +19,242 @@ QuickSpecBegin(SDLUnsubscribeVehicleDataResponseSpec) SDLVehicleDataResult* vehicleDataResult = [[SDLVehicleDataResult alloc] init]; SDLVehicleDataResult* customOEMvehicleDataResult = [[SDLVehicleDataResult alloc] initWithCustomOEMDataType:@"customOEMVehicleData" resultCode:SDLVehicleDataResultCodeSuccess]; -describe(@"Getter/Setter Tests", ^ { - it(@"Should set and get correctly", ^ { +describe(@"getter/setter tests", ^ { + it(@"should set and get correctly", ^ { SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] init]; - testResponse.gps = vehicleDataResult; - testResponse.speed = vehicleDataResult; - testResponse.rpm = vehicleDataResult; + testResponse.accPedalPosition = vehicleDataResult; + testResponse.airbagStatus = vehicleDataResult; + testResponse.beltStatus = vehicleDataResult; + testResponse.bodyInformation = vehicleDataResult; + testResponse.cloudAppVehicleID = vehicleDataResult; + testResponse.clusterModes = vehicleDataResult; + testResponse.deviceStatus = vehicleDataResult; + testResponse.driverBraking = vehicleDataResult; + testResponse.eCallInfo = vehicleDataResult; + testResponse.electronicParkBrakeStatus = vehicleDataResult; + testResponse.emergencyEvent = vehicleDataResult; + testResponse.engineOilLife = vehicleDataResult; + testResponse.engineTorque = vehicleDataResult; + testResponse.externalTemperature = vehicleDataResult; testResponse.fuelLevel = vehicleDataResult; testResponse.fuelLevel_State = vehicleDataResult; testResponse.fuelRange = vehicleDataResult; + testResponse.gearStatus = vehicleDataResult; + testResponse.gps = vehicleDataResult; + testResponse.headLampStatus = vehicleDataResult; testResponse.instantFuelConsumption = vehicleDataResult; - testResponse.externalTemperature = vehicleDataResult; -#pragma clang diagnostic push + testResponse.myKey = vehicleDataResult; + testResponse.odometer = vehicleDataResult; #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic push testResponse.prndl = vehicleDataResult; #pragma clang diagnostic pop - testResponse.gearStatus = vehicleDataResult; - testResponse.tirePressure = vehicleDataResult; - testResponse.odometer = vehicleDataResult; - testResponse.beltStatus = vehicleDataResult; - testResponse.bodyInformation = vehicleDataResult; - testResponse.deviceStatus = vehicleDataResult; - testResponse.driverBraking = vehicleDataResult; - testResponse.wiperStatus = vehicleDataResult; - testResponse.headLampStatus = vehicleDataResult; - testResponse.engineOilLife = vehicleDataResult; - testResponse.engineTorque = vehicleDataResult; - testResponse.accPedalPosition = vehicleDataResult; + testResponse.rpm = vehicleDataResult; + testResponse.speed = vehicleDataResult; testResponse.steeringWheelAngle = vehicleDataResult; - testResponse.eCallInfo = vehicleDataResult; - testResponse.airbagStatus = vehicleDataResult; - testResponse.emergencyEvent = vehicleDataResult; - testResponse.clusterModes = vehicleDataResult; - testResponse.myKey = vehicleDataResult; - testResponse.electronicParkBrakeStatus = vehicleDataResult; + testResponse.tirePressure = vehicleDataResult; testResponse.turnSignal = vehicleDataResult; - testResponse.cloudAppVehicleID = vehicleDataResult; - - expect(testResponse.gps).to(equal(vehicleDataResult)); - expect(testResponse.speed).to(equal(vehicleDataResult)); - expect(testResponse.rpm).to(equal(vehicleDataResult)); + testResponse.wiperStatus = vehicleDataResult; + + expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); + expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); + expect(testResponse.beltStatus).to(equal(vehicleDataResult)); + expect(testResponse.bodyInformation).to(equal(vehicleDataResult)); + expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult)); + expect(testResponse.clusterModes).to(equal(vehicleDataResult)); + expect(testResponse.deviceStatus).to(equal(vehicleDataResult)); + expect(testResponse.driverBraking).to(equal(vehicleDataResult)); + expect(testResponse.eCallInfo).to(equal(vehicleDataResult)); + expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult)); + expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); + expect(testResponse.engineOilLife).to(equal(vehicleDataResult)); + expect(testResponse.engineTorque).to(equal(vehicleDataResult)); + expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); expect(testResponse.fuelRange).to(equal(vehicleDataResult)); + expect(testResponse.gearStatus).to(equal(vehicleDataResult)); + expect(testResponse.gps).to(equal(vehicleDataResult)); + expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); - expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); -#pragma clang diagnostic push + expect(testResponse.myKey).to(equal(vehicleDataResult)); + expect(testResponse.odometer).to(equal(vehicleDataResult)); #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic push expect(testResponse.prndl).to(equal(vehicleDataResult)); #pragma clang diagnostic pop - expect(testResponse.gearStatus).to(equal(vehicleDataResult)); - expect(testResponse.tirePressure).to(equal(vehicleDataResult)); - expect(testResponse.odometer).to(equal(vehicleDataResult)); - expect(testResponse.beltStatus).to(equal(vehicleDataResult)); - expect(testResponse.bodyInformation).to(equal(vehicleDataResult)); - expect(testResponse.deviceStatus).to(equal(vehicleDataResult)); - expect(testResponse.driverBraking).to(equal(vehicleDataResult)); - expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); - expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); - expect(testResponse.engineOilLife).to(equal(vehicleDataResult)); - expect(testResponse.engineTorque).to(equal(vehicleDataResult)); - expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); + expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.speed).to(equal(vehicleDataResult)); expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); - expect(testResponse.eCallInfo).to(equal(vehicleDataResult)); - expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); - expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); - expect(testResponse.clusterModes).to(equal(vehicleDataResult)); - expect(testResponse.myKey).to(equal(vehicleDataResult)); - expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult)); + expect(testResponse.tirePressure).to(equal(vehicleDataResult)); expect(testResponse.turnSignal).to(equal(vehicleDataResult)); - expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult)); + expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); }); - it(@"Should get correctly when initialized", ^ { + it(@"should get correctly when initialized", ^ { NSDictionary<NSString *, id> *dict = @{SDLRPCParameterNameResponse: - @{SDLRPCParameterNameParameters: - @{SDLRPCParameterNameGPS:vehicleDataResult, - SDLRPCParameterNameSpeed:vehicleDataResult, - SDLRPCParameterNameRPM:vehicleDataResult, - SDLRPCParameterNameFuelLevel:vehicleDataResult, - SDLRPCParameterNameFuelLevelState:vehicleDataResult, - SDLRPCParameterNameFuelRange:vehicleDataResult, - SDLRPCParameterNameInstantFuelConsumption:vehicleDataResult, - SDLRPCParameterNameExternalTemperature:vehicleDataResult, - SDLRPCParameterNamePRNDL:vehicleDataResult, - SDLRPCParameterNameTirePressure:vehicleDataResult, - SDLRPCParameterNameOdometer:vehicleDataResult, - SDLRPCParameterNameBeltStatus:vehicleDataResult, - SDLRPCParameterNameBodyInformation:vehicleDataResult, - SDLRPCParameterNameDeviceStatus:vehicleDataResult, - SDLRPCParameterNameDriverBraking:vehicleDataResult, - SDLRPCParameterNameWiperStatus:vehicleDataResult, - SDLRPCParameterNameHeadLampStatus:vehicleDataResult, - SDLRPCParameterNameEngineOilLife:vehicleDataResult, - SDLRPCParameterNameEngineTorque:vehicleDataResult, - SDLRPCParameterNameAccelerationPedalPosition:vehicleDataResult, - SDLRPCParameterNameSteeringWheelAngle:vehicleDataResult, - SDLRPCParameterNameECallInfo:vehicleDataResult, - SDLRPCParameterNameAirbagStatus:vehicleDataResult, - SDLRPCParameterNameEmergencyEvent:vehicleDataResult, - SDLRPCParameterNameClusterModes:vehicleDataResult, - SDLRPCParameterNameMyKey:vehicleDataResult, - SDLRPCParameterNameElectronicParkBrakeStatus:vehicleDataResult, - SDLRPCParameterNameTurnSignal:vehicleDataResult, - SDLRPCParameterNameCloudAppVehicleID:vehicleDataResult, - SDLRPCParameterNameGearStatus:vehicleDataResult - }, - SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}}; + @{SDLRPCParameterNameParameters: @{ + SDLRPCParameterNameAccelerationPedalPosition:vehicleDataResult, + SDLRPCParameterNameAirbagStatus:vehicleDataResult, + SDLRPCParameterNameBeltStatus:vehicleDataResult, + SDLRPCParameterNameBodyInformation:vehicleDataResult, + SDLRPCParameterNameCloudAppVehicleID:vehicleDataResult, + SDLRPCParameterNameClusterModes:vehicleDataResult, + SDLRPCParameterNameDeviceStatus:vehicleDataResult, + SDLRPCParameterNameDriverBraking:vehicleDataResult, + SDLRPCParameterNameECallInfo:vehicleDataResult, + SDLRPCParameterNameElectronicParkBrakeStatus:vehicleDataResult, + SDLRPCParameterNameEmergencyEvent:vehicleDataResult, + SDLRPCParameterNameEngineOilLife:vehicleDataResult, + SDLRPCParameterNameEngineTorque:vehicleDataResult, + SDLRPCParameterNameExternalTemperature:vehicleDataResult, + SDLRPCParameterNameFuelLevel:vehicleDataResult, + SDLRPCParameterNameFuelLevelState:vehicleDataResult, + SDLRPCParameterNameFuelRange:vehicleDataResult, + SDLRPCParameterNameGPS:vehicleDataResult, + SDLRPCParameterNameGearStatus:vehicleDataResult, + SDLRPCParameterNameHeadLampStatus:vehicleDataResult, + SDLRPCParameterNameInstantFuelConsumption:vehicleDataResult, + SDLRPCParameterNameMyKey:vehicleDataResult, + SDLRPCParameterNameOdometer:vehicleDataResult, #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithDictionary:dict]; + SDLRPCParameterNamePRNDL:vehicleDataResult, #pragma clang diagnostic pop - - expect(testResponse.gps).to(equal(vehicleDataResult)); - expect(testResponse.speed).to(equal(vehicleDataResult)); - expect(testResponse.rpm).to(equal(vehicleDataResult)); - expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); - expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); - expect(testResponse.fuelRange).to(equal(vehicleDataResult)); - expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); - expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); + SDLRPCParameterNameRPM:vehicleDataResult, + SDLRPCParameterNameSpeed:vehicleDataResult, + SDLRPCParameterNameSteeringWheelAngle:vehicleDataResult, + SDLRPCParameterNameTirePressure:vehicleDataResult, + SDLRPCParameterNameTurnSignal:vehicleDataResult, + SDLRPCParameterNameWiperStatus:vehicleDataResult, + }, + SDLRPCParameterNameOperationName:SDLRPCFunctionNameUnsubscribeVehicleData}}; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - expect(testResponse.prndl).to(equal(vehicleDataResult)); + SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithDictionary:dict]; #pragma clang diagnostic pop - expect(testResponse.gearStatus).to(equal(vehicleDataResult)); - expect(testResponse.tirePressure).to(equal(vehicleDataResult)); - expect(testResponse.odometer).to(equal(vehicleDataResult)); + + expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); + expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); expect(testResponse.beltStatus).to(equal(vehicleDataResult)); expect(testResponse.bodyInformation).to(equal(vehicleDataResult)); + expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult)); + expect(testResponse.clusterModes).to(equal(vehicleDataResult)); expect(testResponse.deviceStatus).to(equal(vehicleDataResult)); expect(testResponse.driverBraking).to(equal(vehicleDataResult)); - expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); - expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); - expect(testResponse.engineOilLife).to(equal(vehicleDataResult)); - expect(testResponse.engineTorque).to(equal(vehicleDataResult)); - expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); - expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); expect(testResponse.eCallInfo).to(equal(vehicleDataResult)); - expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); + expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult)); expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); - expect(testResponse.clusterModes).to(equal(vehicleDataResult)); + expect(testResponse.engineOilLife).to(equal(vehicleDataResult)); + expect(testResponse.engineTorque).to(equal(vehicleDataResult)); + expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); + expect(testResponse.fuelRange).to(equal(vehicleDataResult)); + expect(testResponse.gearStatus).to(equal(vehicleDataResult)); + expect(testResponse.gps).to(equal(vehicleDataResult)); + expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); + expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); expect(testResponse.myKey).to(equal(vehicleDataResult)); - expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult)); + expect(testResponse.odometer).to(equal(vehicleDataResult)); +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic push + expect(testResponse.prndl).to(equal(vehicleDataResult)); +#pragma clang diagnostic pop + expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.speed).to(equal(vehicleDataResult)); + expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); + expect(testResponse.tirePressure).to(equal(vehicleDataResult)); expect(testResponse.turnSignal).to(equal(vehicleDataResult)); - expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult)); + expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); }); - it(@"Should return nil if not set", ^ { + it(@"should return nil if not set", ^ { SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] init]; - - expect(testResponse.gps).to(beNil()); - expect(testResponse.speed).to(beNil()); - expect(testResponse.rpm).to(beNil()); + + expect(testResponse.accPedalPosition).to(beNil()); + expect(testResponse.airbagStatus).to(beNil()); + expect(testResponse.beltStatus).to(beNil()); + expect(testResponse.bodyInformation).to(beNil()); + expect(testResponse.cloudAppVehicleID).to(beNil()); + expect(testResponse.clusterModes).to(beNil()); + expect(testResponse.deviceStatus).to(beNil()); + expect(testResponse.driverBraking).to(beNil()); + expect(testResponse.eCallInfo).to(beNil()); + expect(testResponse.electronicParkBrakeStatus).to(beNil()); + expect(testResponse.emergencyEvent).to(beNil()); + expect(testResponse.engineOilLife).to(beNil()); + expect(testResponse.engineTorque).to(beNil()); + expect(testResponse.externalTemperature).to(beNil()); expect(testResponse.fuelLevel).to(beNil()); expect(testResponse.fuelLevel_State).to(beNil()); expect(testResponse.fuelRange).to(beNil()); + expect(testResponse.gearStatus).to(beNil()); + expect(testResponse.gps).to(beNil()); + expect(testResponse.headLampStatus).to(beNil()); expect(testResponse.instantFuelConsumption).to(beNil()); - expect(testResponse.externalTemperature).to(beNil()); -#pragma clang diagnostic push + expect(testResponse.myKey).to(beNil()); + expect(testResponse.odometer).to(beNil()); #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic push expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop - expect(testResponse.gearStatus).to(beNil()); - expect(testResponse.tirePressure).to(beNil()); - expect(testResponse.odometer).to(beNil()); - expect(testResponse.beltStatus).to(beNil()); - expect(testResponse.bodyInformation).to(beNil()); - expect(testResponse.deviceStatus).to(beNil()); - expect(testResponse.driverBraking).to(beNil()); - expect(testResponse.wiperStatus).to(beNil()); - expect(testResponse.headLampStatus).to(beNil()); - expect(testResponse.engineOilLife).to(beNil()); - expect(testResponse.engineTorque).to(beNil()); - expect(testResponse.accPedalPosition).to(beNil()); + expect(testResponse.rpm).to(beNil()); + expect(testResponse.speed).to(beNil()); expect(testResponse.steeringWheelAngle).to(beNil()); - expect(testResponse.eCallInfo).to(beNil()); - expect(testResponse.airbagStatus).to(beNil()); - expect(testResponse.emergencyEvent).to(beNil()); - expect(testResponse.clusterModes).to(beNil()); - expect(testResponse.myKey).to(beNil()); - expect(testResponse.electronicParkBrakeStatus).to(beNil()); + expect(testResponse.tirePressure).to(beNil()); expect(testResponse.turnSignal).to(beNil()); - expect(testResponse.cloudAppVehicleID).to(beNil()); + expect(testResponse.wiperStatus).to(beNil()); }); - context(@"initWithGps:speed:rpm:fuelLevel:fuelLevel_State:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:gearStatus:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:", ^{ + context(@"initWithGps:speed:rpm:instantFuelConsumption:fuelRange:externalTemperature:turnSignal:prndl:tirePressure:odometer:beltStatus:bodyInformation:deviceStatus:driverBraking:wiperStatus:headLampStatus:engineTorque:accPedalPosition:steeringWheelAngle:engineOilLife:electronicParkBrakeStatus:cloudAppVehicleID:eCallInfo:airbagStatus:emergencyEvent:clusterModes:myKey:gearStatus:", ^{ SDLUnsubscribeVehicleDataResponse* testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] initWithGps:vehicleDataResult speed:vehicleDataResult rpm:vehicleDataResult fuelLevel:vehicleDataResult fuelLevel_State:vehicleDataResult instantFuelConsumption:vehicleDataResult fuelRange:vehicleDataResult externalTemperature:vehicleDataResult turnSignal:vehicleDataResult gearStatus:vehicleDataResult tirePressure:vehicleDataResult odometer:vehicleDataResult beltStatus:vehicleDataResult bodyInformation:vehicleDataResult deviceStatus:vehicleDataResult driverBraking:vehicleDataResult wiperStatus:vehicleDataResult headLampStatus:vehicleDataResult engineTorque:vehicleDataResult accPedalPosition:vehicleDataResult steeringWheelAngle:vehicleDataResult engineOilLife:vehicleDataResult electronicParkBrakeStatus:vehicleDataResult cloudAppVehicleID:vehicleDataResult eCallInfo:vehicleDataResult airbagStatus:vehicleDataResult emergencyEvent:vehicleDataResult clusterModes:vehicleDataResult myKey:vehicleDataResult]; - it(@"Expect all properties to be set properly", ^{ - expect(testResponse.gps).to(equal(vehicleDataResult)); - expect(testResponse.speed).to(equal(vehicleDataResult)); - expect(testResponse.rpm).to(equal(vehicleDataResult)); - expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); - expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); - expect(testResponse.fuelRange).to(equal(vehicleDataResult)); - expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); - expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); - expect(testResponse.gearStatus).to(equal(vehicleDataResult)); - expect(testResponse.tirePressure).to(equal(vehicleDataResult)); - expect(testResponse.odometer).to(equal(vehicleDataResult)); + it(@"expect all properties to be set properly", ^{ + expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); + expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); expect(testResponse.beltStatus).to(equal(vehicleDataResult)); expect(testResponse.bodyInformation).to(equal(vehicleDataResult)); + expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult)); + expect(testResponse.clusterModes).to(equal(vehicleDataResult)); expect(testResponse.deviceStatus).to(equal(vehicleDataResult)); expect(testResponse.driverBraking).to(equal(vehicleDataResult)); - expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); - expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); - expect(testResponse.engineOilLife).to(equal(vehicleDataResult)); - expect(testResponse.engineTorque).to(equal(vehicleDataResult)); - expect(testResponse.accPedalPosition).to(equal(vehicleDataResult)); - expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); expect(testResponse.eCallInfo).to(equal(vehicleDataResult)); - expect(testResponse.airbagStatus).to(equal(vehicleDataResult)); + expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult)); expect(testResponse.emergencyEvent).to(equal(vehicleDataResult)); - expect(testResponse.clusterModes).to(equal(vehicleDataResult)); + expect(testResponse.engineOilLife).to(equal(vehicleDataResult)); + expect(testResponse.engineTorque).to(equal(vehicleDataResult)); + expect(testResponse.externalTemperature).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel).to(equal(vehicleDataResult)); + expect(testResponse.fuelLevel_State).to(equal(vehicleDataResult)); + expect(testResponse.fuelRange).to(equal(vehicleDataResult)); + expect(testResponse.gearStatus).to(equal(vehicleDataResult)); + expect(testResponse.gps).to(equal(vehicleDataResult)); + expect(testResponse.headLampStatus).to(equal(vehicleDataResult)); + expect(testResponse.instantFuelConsumption).to(equal(vehicleDataResult)); expect(testResponse.myKey).to(equal(vehicleDataResult)); - expect(testResponse.electronicParkBrakeStatus).to(equal(vehicleDataResult)); - expect(testResponse.turnSignal).to(equal(vehicleDataResult)); - expect(testResponse.cloudAppVehicleID).to(equal(vehicleDataResult)); -#pragma clang diagnostic push + expect(testResponse.odometer).to(equal(vehicleDataResult)); #pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic push expect(testResponse.prndl).to(beNil()); #pragma clang diagnostic pop + expect(testResponse.rpm).to(equal(vehicleDataResult)); + expect(testResponse.speed).to(equal(vehicleDataResult)); + expect(testResponse.steeringWheelAngle).to(equal(vehicleDataResult)); + expect(testResponse.tirePressure).to(equal(vehicleDataResult)); + expect(testResponse.turnSignal).to(equal(vehicleDataResult)); + expect(testResponse.wiperStatus).to(equal(vehicleDataResult)); }); }); - it(@"Should set and get OEM Custom Vehicle Data", ^{ - SDLUnsubscribeVehicleDataResponse *testResponse = [[SDLUnsubscribeVehicleDataResponse alloc] init]; - - [testResponse setOEMCustomVehicleData:@"customOEMVehicleData" withVehicleDataState:customOEMvehicleDataResult]; + context(@"should set and get OEM Custom Vehicle Data", ^{ + SDLUnsubscribeVehicleDataResponse *testRequest = [[SDLUnsubscribeVehicleDataResponse alloc] init]; + [testRequest setOEMCustomVehicleData:@"customOEMVehicleData" withVehicleDataState:customOEMvehicleDataResult]; - expect([testResponse getOEMCustomVehicleData:@"customOEMVehicleData"]).to(equal(customOEMvehicleDataResult)); + it(@"expect OEM Custom Vehicle Data to be set properly", ^{ + expect([testRequest getOEMCustomVehicleData:@"customOEMVehicleData"]).to(equal(customOEMvehicleDataResult)); + }); }); }); |