diff options
author | kboskin <kboskin> | 2020-12-06 13:00:06 +0200 |
---|---|---|
committer | kboskin <kboskin> | 2020-12-06 13:00:06 +0200 |
commit | e4d9170f69ece9dc2bb26a545d7e82bd3a7539e8 (patch) | |
tree | 8c2fc3287edd039bf2b9d04a254ea944c4fc62d6 | |
parent | def46af9b23a5baf31f8da737d619439e4e5a6e7 (diff) | |
download | sdl_android-e4d9170f69ece9dc2bb26a545d7e82bd3a7539e8.tar.gz |
[0262]
- Implement new structures and tests
27 files changed, 6977 insertions, 6205 deletions
diff --git a/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json b/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json index b31a0e4db..5113e208d 100644 --- a/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json +++ b/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json @@ -35,7 +35,8 @@ "gearStatus": true, "oemCustomVehicleDataName": true, "windowStatus": true, - "stabilityControlsStatus": true + "stabilityControlsStatus": true, + "seatOccupancy": true } }, "response": { @@ -194,7 +195,31 @@ "deviation": 3 } } - ] + ], + "seatOccupancy": { + "seatsOccupied": [ + { + "seatLocation": { + "grid": { + "row": 2, + "col": 3 + } + }, + "conditionActive": true + } + ], + "seatsBelted": [ + { + "seatLocation": { + "grid": { + "row": 2, + "col": 3 + } + }, + "conditionActive": true + } + ] + } } } }
\ No newline at end of file diff --git a/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json b/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json index 51123213c..009efaae6 100644 --- a/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json +++ b/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json @@ -35,7 +35,8 @@ "gearStatus": true, "oemCustomVehicleDataName": true, "windowStatus": true, - "handsOffSteering": true + "handsOffSteering": true, + "seatOccupancy": true } }, "response": { @@ -173,6 +174,10 @@ "windowStatus": { "dataType": "VEHICLEDATA_WINDOWSTATUS", "resultCode": "SUCCESS" + }, + "seatOccupancy": { + "dataType": "VEHICLEDATA_SEATOCCUPANCY", + "resultCode": "SUCCESS" } } } diff --git a/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json b/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json index 7f57869a5..44d0998ea 100644 --- a/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json +++ b/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json @@ -35,7 +35,8 @@ "handsOffSteering": true, "gearStatus": true, "oemCustomVehicleDataName": true, - "windowStatus": true + "windowStatus": true, + "seatOccupancy": true } }, "response": { @@ -173,6 +174,10 @@ "windowStatus": { "dataType": "VEHICLEDATA_WINDOWSTATUS", "resultCode": "SUCCESS" + }, + "seatOccupancy": { + "dataType": "VEHICLEDATA_SEATOCCUPANCY", + "resultCode": "SUCCESS" } } } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java index edf446b3c..9b0d491a7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java @@ -16,104 +16,7 @@ import com.smartdevicelink.managers.screen.menu.VoiceCommand; import com.smartdevicelink.managers.screen.menu.VoiceCommandSelectionListener; import com.smartdevicelink.protocol.SdlProtocol; import com.smartdevicelink.protocol.enums.FunctionID; -import com.smartdevicelink.proxy.rpc.AppInfo; -import com.smartdevicelink.proxy.rpc.AppServiceCapability; -import com.smartdevicelink.proxy.rpc.AppServiceData; -import com.smartdevicelink.proxy.rpc.AppServiceManifest; -import com.smartdevicelink.proxy.rpc.AppServiceRecord; -import com.smartdevicelink.proxy.rpc.AppServicesCapabilities; -import com.smartdevicelink.proxy.rpc.AudioControlCapabilities; -import com.smartdevicelink.proxy.rpc.AudioControlData; -import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities; -import com.smartdevicelink.proxy.rpc.ButtonCapabilities; -import com.smartdevicelink.proxy.rpc.Choice; -import com.smartdevicelink.proxy.rpc.ClimateControlCapabilities; -import com.smartdevicelink.proxy.rpc.ClimateControlData; -import com.smartdevicelink.proxy.rpc.CloudAppProperties; -import com.smartdevicelink.proxy.rpc.Coordinate; -import com.smartdevicelink.proxy.rpc.DIDResult; -import com.smartdevicelink.proxy.rpc.DateTime; -import com.smartdevicelink.proxy.rpc.DeviceInfo; -import com.smartdevicelink.proxy.rpc.DisplayCapabilities; -import com.smartdevicelink.proxy.rpc.DisplayCapability; -import com.smartdevicelink.proxy.rpc.DriverDistractionCapability; -import com.smartdevicelink.proxy.rpc.DynamicUpdateCapabilities; -import com.smartdevicelink.proxy.rpc.EqualizerSettings; -import com.smartdevicelink.proxy.rpc.GearStatus; -import com.smartdevicelink.proxy.rpc.Grid; -import com.smartdevicelink.proxy.rpc.HMICapabilities; -import com.smartdevicelink.proxy.rpc.HMIPermissions; -import com.smartdevicelink.proxy.rpc.HMISettingsControlCapabilities; -import com.smartdevicelink.proxy.rpc.HMISettingsControlData; -import com.smartdevicelink.proxy.rpc.HapticRect; -import com.smartdevicelink.proxy.rpc.Image; -import com.smartdevicelink.proxy.rpc.ImageField; -import com.smartdevicelink.proxy.rpc.ImageResolution; -import com.smartdevicelink.proxy.rpc.KeyboardProperties; -import com.smartdevicelink.proxy.rpc.LightCapabilities; -import com.smartdevicelink.proxy.rpc.LightControlCapabilities; -import com.smartdevicelink.proxy.rpc.LightControlData; -import com.smartdevicelink.proxy.rpc.LightState; -import com.smartdevicelink.proxy.rpc.LocationDetails; -import com.smartdevicelink.proxy.rpc.MassageCushionFirmness; -import com.smartdevicelink.proxy.rpc.MassageModeData; -import com.smartdevicelink.proxy.rpc.MediaServiceData; -import com.smartdevicelink.proxy.rpc.MediaServiceManifest; -import com.smartdevicelink.proxy.rpc.MenuParams; -import com.smartdevicelink.proxy.rpc.MetadataTags; -import com.smartdevicelink.proxy.rpc.ModuleData; -import com.smartdevicelink.proxy.rpc.ModuleInfo; -import com.smartdevicelink.proxy.rpc.NavigationCapability; -import com.smartdevicelink.proxy.rpc.NavigationInstruction; -import com.smartdevicelink.proxy.rpc.NavigationServiceData; -import com.smartdevicelink.proxy.rpc.NavigationServiceManifest; -import com.smartdevicelink.proxy.rpc.OasisAddress; -import com.smartdevicelink.proxy.rpc.ParameterPermissions; -import com.smartdevicelink.proxy.rpc.PermissionItem; -import com.smartdevicelink.proxy.rpc.PhoneCapability; -import com.smartdevicelink.proxy.rpc.PresetBankCapabilities; -import com.smartdevicelink.proxy.rpc.RGBColor; -import com.smartdevicelink.proxy.rpc.RadioControlCapabilities; -import com.smartdevicelink.proxy.rpc.RadioControlData; -import com.smartdevicelink.proxy.rpc.RdsData; -import com.smartdevicelink.proxy.rpc.Rectangle; -import com.smartdevicelink.proxy.rpc.RemoteControlCapabilities; -import com.smartdevicelink.proxy.rpc.ScreenParams; -import com.smartdevicelink.proxy.rpc.SdlMsgVersion; -import com.smartdevicelink.proxy.rpc.SeatControlCapabilities; -import com.smartdevicelink.proxy.rpc.SeatControlData; -import com.smartdevicelink.proxy.rpc.SeatLocation; -import com.smartdevicelink.proxy.rpc.SeatMemoryAction; -import com.smartdevicelink.proxy.rpc.SingleTireStatus; -import com.smartdevicelink.proxy.rpc.SisData; -import com.smartdevicelink.proxy.rpc.SoftButton; -import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities; -import com.smartdevicelink.proxy.rpc.StabilityControlsStatus; -import com.smartdevicelink.proxy.rpc.StartTime; -import com.smartdevicelink.proxy.rpc.StationIDNumber; -import com.smartdevicelink.proxy.rpc.SystemCapability; -import com.smartdevicelink.proxy.rpc.TTSChunk; -import com.smartdevicelink.proxy.rpc.Temperature; -import com.smartdevicelink.proxy.rpc.TemplateColorScheme; -import com.smartdevicelink.proxy.rpc.TemplateConfiguration; -import com.smartdevicelink.proxy.rpc.TextField; -import com.smartdevicelink.proxy.rpc.TouchCoord; -import com.smartdevicelink.proxy.rpc.TouchEvent; -import com.smartdevicelink.proxy.rpc.TouchEventCapabilities; -import com.smartdevicelink.proxy.rpc.Turn; -import com.smartdevicelink.proxy.rpc.VehicleDataResult; -import com.smartdevicelink.proxy.rpc.VehicleType; -import com.smartdevicelink.proxy.rpc.VideoStreamingCapability; -import com.smartdevicelink.proxy.rpc.VideoStreamingFormat; -import com.smartdevicelink.proxy.rpc.VrHelpItem; -import com.smartdevicelink.proxy.rpc.WeatherAlert; -import com.smartdevicelink.proxy.rpc.WeatherData; -import com.smartdevicelink.proxy.rpc.WeatherServiceData; -import com.smartdevicelink.proxy.rpc.WeatherServiceManifest; -import com.smartdevicelink.proxy.rpc.WindowCapability; -import com.smartdevicelink.proxy.rpc.WindowState; -import com.smartdevicelink.proxy.rpc.WindowStatus; -import com.smartdevicelink.proxy.rpc.WindowTypeCapabilities; +import com.smartdevicelink.proxy.rpc.*; import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus; import com.smartdevicelink.proxy.rpc.enums.AppHMIType; import com.smartdevicelink.proxy.rpc.enums.AppInterfaceUnregisteredReason; @@ -427,6 +330,13 @@ public class TestValues { public static final DynamicUpdateCapabilities GENERAL_DYNAMICUPDATECAPABILITIES = new DynamicUpdateCapabilities(); public static final WindowState GENERAL_WINDOWSTATE = new WindowState(); + public static final SeatOccupancy GENERAL_SEAT_OCCUPANCY = new SeatOccupancy(); + public static final List<SeatStatus> GENERAL_SEATS_OCCUPIED = new ArrayList<SeatStatus>(1); + public static final JSONArray JSON_GENERAL_SEATS_OCCUPIED = new JSONArray(); + public static final List<SeatStatus> GENERAL_SEATS_BELTED = new ArrayList<SeatStatus>(1); + public static final JSONArray JSON_GENERAL_SEATS_BELTED = new JSONArray(); + public static final SeatStatus GENERAL_SEAT_STATUS = new SeatStatus(); + public static final SeatLocation GENERAL_SEAT_LOCATION = new SeatLocation(); public static final VehicleDataResult GENERAL_OEM_CUSTOM_VEHICLE_DATA = new VehicleDataResult(); public static final TemplateConfiguration GENERAL_TEMPLATE_CONFIGURATION = new TemplateConfiguration(); @@ -446,7 +356,6 @@ public class TestValues { public static final FuelType GENERAL_FUELTYPE = FuelType.GASOLINE; public static final LockScreenConfig GENERAL_LOCKSCREENCONFIG = new LockScreenConfig(); public static final Grid GENERAL_GRID = new Grid(); - public static final SeatLocation GENERAL_SEAT_LOCATION = new SeatLocation(); public static final ModuleInfo GENERAL_MODULE_INFO = new ModuleInfo(); public static final StabilityControlsStatus GENERAL_STABILITY_CONTROL_STATUS = new StabilityControlsStatus(); public static final VehicleDataStatus GENERAL_ESC_SYSTEM = VehicleDataStatus.ON; @@ -1154,7 +1063,30 @@ public class TestValues { GENERAL_STABILITY_CONTROL_STATUS.setEscSystem(GENERAL_ESC_SYSTEM); GENERAL_STABILITY_CONTROL_STATUS.setTrailerSwayControl(GENERAL_S_WAY_CONTROL); + // SEAT_OCCUPANCY + GENERAL_SEAT_LOCATION.setGrid(GENERAL_LOCATION_GRID); + + GENERAL_SEAT_STATUS.setConditionActive(GENERAL_BOOLEAN); + GENERAL_SEAT_STATUS.setSeatLocation(GENERAL_SEAT_LOCATION); + + GENERAL_SEATS_BELTED.add(GENERAL_SEAT_STATUS); + GENERAL_SEATS_OCCUPIED.add(GENERAL_SEAT_STATUS); + + GENERAL_SEAT_OCCUPANCY.setSeatsBelted(GENERAL_SEATS_BELTED); + GENERAL_SEAT_OCCUPANCY.setSeatsOccupied(GENERAL_SEATS_OCCUPIED); + try { + JSONArray convertedSeatsOccupied = JsonUtils.createJsonArrayOfJsonObjects(GENERAL_SEATS_OCCUPIED, 1); + JSONArray convertedSeatsBelted = JsonUtils.createJsonArrayOfJsonObjects(GENERAL_SEATS_BELTED, 1); + + for (int i = 0; i < convertedSeatsOccupied.length(); i++) { + JSON_GENERAL_SEATS_OCCUPIED.put(convertedSeatsOccupied.get(i)); + } + + for (int i = 0; i < convertedSeatsBelted.length(); i++) { + JSON_GENERAL_SEATS_BELTED.put(convertedSeatsBelted.get(i)); + } + JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, GENERAL_HMILEVEL_LIST); JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_USER_DISALLOWED, GENERAL_HMILEVEL_LIST); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java index 724be920b..2b8343158 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java @@ -3910,6 +3910,49 @@ public class Validator { return approxPosition1.equals(approxPosition2) && deviation1.equals(deviation2); } + public static boolean validateSeatOccupancies(SeatOccupancy item1, SeatOccupancy item2) { + if (item1 == null) { + return (item2 == null); + } + if (item2 == null) { + return (item1 == null); + } + + List<SeatStatus> seatStatuses1 = item1.getSeatsBelted(); + List<SeatStatus> seatsOccupied1 = item1.getSeatsOccupied(); + + List<SeatStatus> seatStatuses2 = item2.getSeatsBelted(); + List<SeatStatus> seatsOccupied2 = item2.getSeatsOccupied(); + + seatsOccupied1.toString(); + + for (SeatStatus seatStatusItem1: seatStatuses1) { + for (SeatStatus seatStatusItem2: seatStatuses2) { + if (seatStatusItem1.getConditionActive() != seatStatusItem2.getConditionActive()){ + return false; + } + + if (!validateGrid(seatStatusItem1.getSeatLocation().getGrid(), seatStatusItem2.getSeatLocation().getGrid())){ + return false; + } + } + } + + for (SeatStatus occupiedStatusItem1: seatsOccupied1) { + for (SeatStatus occupiedStatusItem2: seatsOccupied2) { + if (occupiedStatusItem1.getConditionActive() != occupiedStatusItem2.getConditionActive()){ + return false; + } + + if (!validateGrid(occupiedStatusItem1.getSeatLocation().getGrid(), occupiedStatusItem2.getSeatLocation().getGrid())){ + return false; + } + } + } + + return true; + } + public static boolean validateStabilityControlStatus(StabilityControlsStatus status1, StabilityControlsStatus status2) { if (status1 == null) { return (status2 == null); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java index a13486983..0cf791405 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java @@ -15,6 +15,9 @@ import com.smartdevicelink.proxy.rpc.Grid; import com.smartdevicelink.proxy.rpc.HeadLampStatus; import com.smartdevicelink.proxy.rpc.MyKey; import com.smartdevicelink.proxy.rpc.OnVehicleData; +import com.smartdevicelink.proxy.rpc.SeatLocation; +import com.smartdevicelink.proxy.rpc.SeatOccupancy; +import com.smartdevicelink.proxy.rpc.SeatStatus; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.StabilityControlsStatus; import com.smartdevicelink.proxy.rpc.TireStatus; @@ -226,6 +229,13 @@ public class VehicleDataHelper { //GetVehicleDataResponse data which stores the same things public static final GetVehicleDataResponse VEHICLE_DATA_RESPONSE = new GetVehicleDataResponse(); + // Seat Occupancy + public static final SeatOccupancy SEAT_OCCUPANCY = new SeatOccupancy(); + public static final List<SeatStatus> SEATS_OCCUPIED = new ArrayList<SeatStatus>(1); + public static final List<SeatStatus> SEATS_BELTED = new ArrayList<SeatStatus>(1); + public static final SeatStatus SEAT_STATUS = new SeatStatus(); + public static final SeatLocation SEAT_LOCATION = new SeatLocation(); + static { //TIRE_PRESSURE set up TIRE_PRESSURE.setPressureTellTale(TIRE_PRESSURE_TELL_TALE); @@ -373,6 +383,18 @@ public class VehicleDataHelper { GEAR_STATUS.setUserSelectedGear(USER_SELECTED_GEAR); GEAR_STATUS.setActualGear(ACTUAL_GEAR); + // SEAT_OCCUPANCY + SEAT_LOCATION.setGrid(LOCATION_GRID); + + SEAT_STATUS.setConditionActive(true); + SEAT_STATUS.setSeatLocation(SEAT_LOCATION); + + SEATS_BELTED.add(SEAT_STATUS); + SEATS_OCCUPIED.add(SEAT_STATUS); + + SEAT_OCCUPANCY.setSeatsBelted(SEATS_BELTED); + SEAT_OCCUPANCY.setSeatsOccupied(SEATS_OCCUPIED); + //set up the OnVehicleData object VEHICLE_DATA.setSpeed(SPEED); VEHICLE_DATA.setRpm(RPM); @@ -408,6 +430,7 @@ public class VehicleDataHelper { VEHICLE_DATA.setStabilityControlsStatus(STABILITY_CONTROLS_STATUS); VEHICLE_DATA.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE); VEHICLE_DATA.setHandsOffSteering(HANDS_OFF_STEERING); + VEHICLE_DATA.setSeatOccupancy(SEAT_OCCUPANCY); //set up the GetVehicleDataResponse object VEHICLE_DATA_RESPONSE.setSpeed(SPEED); VEHICLE_DATA_RESPONSE.setRpm(RPM); @@ -443,6 +466,7 @@ public class VehicleDataHelper { VEHICLE_DATA_RESPONSE.setStabilityControlsStatus(STABILITY_CONTROLS_STATUS); VEHICLE_DATA_RESPONSE.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE); VEHICLE_DATA_RESPONSE.setHandsOffSteering(HANDS_OFF_STEERING); + VEHICLE_DATA_RESPONSE.setSeatOccupancy(SEAT_OCCUPANCY); } private VehicleDataHelper() { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatOccupancyTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatOccupancyTests.java new file mode 100644 index 000000000..dbb56ebdd --- /dev/null +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatOccupancyTests.java @@ -0,0 +1,97 @@ +package com.smartdevicelink.test.rpc.datatypes; + +import android.util.Log; + +import com.smartdevicelink.marshal.JsonRPCMarshaller; +import com.smartdevicelink.proxy.rpc.ImageField; +import com.smartdevicelink.proxy.rpc.SeatLocation; +import com.smartdevicelink.proxy.rpc.SeatOccupancy; +import com.smartdevicelink.proxy.rpc.SeatStatus; +import com.smartdevicelink.test.JsonUtils; +import com.smartdevicelink.test.TestValues; +import com.smartdevicelink.test.Validator; + +import junit.framework.TestCase; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; + +public class SeatOccupancyTests extends TestCase { + + private SeatOccupancy msg; + + @Override + public void setUp() { + msg = new SeatOccupancy(); + + msg.setSeatsOccupied(TestValues.GENERAL_SEATS_OCCUPIED); + msg.setSeatsBelted(TestValues.GENERAL_SEATS_BELTED); + } + + /** + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + List<SeatStatus> seatsBelted = msg.getSeatsBelted(); + List<SeatStatus> seatsOccupied = msg.getSeatsOccupied(); + + // Valid Tests + assertEquals(TestValues.MATCH, TestValues.GENERAL_SEATS_BELTED, seatsBelted); + assertEquals(TestValues.MATCH, TestValues.GENERAL_SEATS_OCCUPIED, seatsOccupied); + + // Invalid/Null Tests + SeatOccupancy msg = new SeatOccupancy(); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getSeatsBelted()); + assertNull(TestValues.NULL, msg.getSeatsOccupied()); + } + + public void testJson() { + JSONObject reference = new JSONObject(); + + try { + reference.put(SeatOccupancy.KEY_SEATS_OCCUPIED, TestValues.JSON_GENERAL_SEATS_OCCUPIED); + reference.put(SeatOccupancy.KEY_SEATS_BELTED, TestValues.JSON_GENERAL_SEATS_BELTED); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); + + Iterator<?> iterator = reference.keys(); + while (iterator.hasNext()) { + String key = (String) iterator.next(); + if (key.equals(SeatOccupancy.KEY_SEATS_OCCUPIED)) { + JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); + JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); + + for (int i = 0; i < referenceArray.length(); i++) { + Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); + Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); + assertTrue(TestValues.TRUE, Validator.validateImageFields(new ImageField(hashReference), new ImageField(hashTest))); + } + + } else if (key.equals(SeatOccupancy.KEY_SEATS_BELTED)) { + JSONArray referenceArray = JsonUtils.readJsonArrayFromJsonObject(reference, key); + JSONArray underTestArray = JsonUtils.readJsonArrayFromJsonObject(underTest, key); + assertEquals(TestValues.MATCH, referenceArray.length(), underTestArray.length()); + + for (int i = 0; i < referenceArray.length(); i++) { + Hashtable<String, Object> hashReference = JsonRPCMarshaller.deserializeJSONObject(referenceArray.getJSONObject(i)); + Hashtable<String, Object> hashTest = JsonRPCMarshaller.deserializeJSONObject(underTestArray.getJSONObject(i)); + assertTrue(TestValues.TRUE, Validator.validateImageFields(new ImageField(hashReference), new ImageField(hashTest))); + } + + } + } + } catch (JSONException e) { + fail(TestValues.JSON_FAIL); + } + } +} diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatStatusTests.java new file mode 100644 index 000000000..3b82f8f3f --- /dev/null +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/SeatStatusTests.java @@ -0,0 +1,77 @@ +package com.smartdevicelink.test.rpc.datatypes; + +import com.smartdevicelink.marshal.JsonRPCMarshaller; +import com.smartdevicelink.proxy.rpc.Grid; +import com.smartdevicelink.proxy.rpc.SeatLocation; +import com.smartdevicelink.proxy.rpc.SeatStatus; +import com.smartdevicelink.test.JsonUtils; +import com.smartdevicelink.test.TestValues; +import com.smartdevicelink.test.Validator; + +import junit.framework.TestCase; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Hashtable; +import java.util.Iterator; + +public class SeatStatusTests extends TestCase { + + private SeatStatus msg; + + @Override + public void setUp() { + msg = new SeatStatus(); + + msg.setSeatLocation(TestValues.GENERAL_SEAT_LOCATION); + msg.setConditionActive(TestValues.GENERAL_BOOLEAN); + } + + /** + * Tests the expected values of the RPC message. + */ + public void testRpcValues() { + // Test Values + SeatLocation location = msg.getSeatLocation(); + Boolean conditionActive = msg.getConditionActive(); + + // Valid Tests + assertEquals(TestValues.MATCH, TestValues.GENERAL_SEAT_LOCATION, location); + assertEquals(TestValues.GENERAL_BOOLEAN, (boolean) conditionActive); + + // Invalid/Null Tests + SeatStatus msg = new SeatStatus(); + assertNotNull(TestValues.NOT_NULL, msg); + + assertNull(TestValues.NULL, msg.getSeatLocation()); + assertNull(TestValues.NULL, msg.getConditionActive()); + } + + public void testJson() { + JSONObject reference = new JSONObject(); + + try { + reference.put(SeatStatus.KEY_CONDITION_ACTIVE, TestValues.GENERAL_BOOLEAN); + reference.put(SeatStatus.KEY_SEAT_LOCATION, TestValues.GENERAL_SEAT_LOCATION.serializeJSON()); + + JSONObject underTest = msg.serializeJSON(); + assertEquals(TestValues.MATCH, reference.length(), underTest.length()); + + Iterator<?> iterator = reference.keys(); + while (iterator.hasNext()) { + String key = (String) iterator.next(); + if (key.equals(SeatStatus.KEY_SEAT_LOCATION)) { + Hashtable<String, Object> locationOne = JsonRPCMarshaller.deserializeJSONObject(JsonUtils.readJsonObjectFromJsonObject(reference, key)); + Hashtable<String, Object> locationTwo = JsonRPCMarshaller.deserializeJSONObject(JsonUtils.readJsonObjectFromJsonObject(underTest, key)); + assertTrue(TestValues.TRUE, Validator.validateGrid(new Grid(locationOne), new Grid(locationTwo))); + } else { + assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key)); + + } + } + } catch (JSONException e) { + fail(TestValues.JSON_FAIL); + } + } +} diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java index 1b270a9dd..211fbf252 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java @@ -90,6 +90,8 @@ public class VehicleDataTypeTests extends TestCase { VehicleDataType enumVehicleDataTypeWindowStatus = VehicleDataType.valueForString(example); example = "VEHICLEDATA_STABILITYCONTROLSSTATUS"; VehicleDataType enumVehicleDataStabilityControlsStatus = VehicleDataType.valueForString(example); + example = "VEHICLEDATA_SEATOCCUPANCY"; + VehicleDataType enumVehicleDataSeatOccupancy = VehicleDataType.valueForString(example); assertNotNull("VEHICLEDATA_GPS returned null", enumVehicleDataGps); assertNotNull("VEHICLEDATA_SPEED returned null", enumVehicleDataSpeed); @@ -127,6 +129,7 @@ public class VehicleDataTypeTests extends TestCase { assertNotNull("VEHICLEDATA_WINDOWSTATUS returned null", enumVehicleDataTypeWindowStatus); assertNotNull("VEHICLEDATA_GEARSTATUS returned null", enumVehicleDataGearStatus); assertNotNull("VEHICLEDATA_STABILITYCONTROLSSTATUS returned null", enumVehicleDataStabilityControlsStatus); + assertNotNull("VEHICLEDATA_SEATOCCUPANCY returned null", enumVehicleDataSeatOccupancy); } /** @@ -196,6 +199,7 @@ public class VehicleDataTypeTests extends TestCase { enumTestList.add(VehicleDataType.VEHICLEDATA_OEM_CUSTOM_DATA); enumTestList.add(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING); enumTestList.add(VehicleDataType.VEHICLEDATA_WINDOWSTATUS); + enumTestList.add(VehicleDataType.VEHICLEDATA_SEATOCCUPANCY); enumTestList.add(VehicleDataType.VEHICLEDATA_GEARSTATUS); enumTestList.add(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java index cb60f7572..025d85ada 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java @@ -17,6 +17,7 @@ import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse; import com.smartdevicelink.proxy.rpc.HeadLampStatus; import com.smartdevicelink.proxy.rpc.MyKey; import com.smartdevicelink.proxy.rpc.OnVehicleData; +import com.smartdevicelink.proxy.rpc.SeatOccupancy; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.StabilityControlsStatus; import com.smartdevicelink.proxy.rpc.TireStatus; @@ -107,6 +108,7 @@ public class OnVehicleDataTests extends BaseRpcTests { result.put(OnVehicleData.KEY_GEAR_STATUS, VehicleDataHelper.GEAR_STATUS); result.put(OnVehicleData.KEY_WINDOW_STATUS, VehicleDataHelper.WINDOW_STATUS_LIST); result.put(OnVehicleData.KEY_STABILITY_CONTROLS_STATUS, VehicleDataHelper.STABILITY_CONTROLS_STATUS); + result.put(OnVehicleData.KEY_SEAT_OCCUPANCY, VehicleDataHelper.SEAT_OCCUPANCY); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); } catch (JSONException e) { fail(TestValues.JSON_FAIL); @@ -155,6 +157,7 @@ public class OnVehicleDataTests extends BaseRpcTests { StabilityControlsStatus stabilityControlsStatus = ((OnVehicleData) msg).getStabilityControlsStatus(); Object oemCustomVehicleData = ((OnVehicleData) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); Boolean handsOffSteering = ((OnVehicleData) msg).getHandsOffSteering(); + SeatOccupancy seatOccupancy = ((OnVehicleData) msg).getSeatOccupancy(); // Valid Tests assertEquals(TestValues.MATCH, VehicleDataHelper.SPEED, speed); assertEquals(TestValues.MATCH, VehicleDataHelper.RPM, rpm); @@ -189,6 +192,7 @@ public class OnVehicleDataTests extends BaseRpcTests { assertEquals(TestValues.MATCH, VehicleDataHelper.GEAR_STATUS, gearStatus); assertEquals(TestValues.MATCH, VehicleDataHelper.STABILITY_CONTROLS_STATUS, stabilityControlsStatus); assertEquals(TestValues.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, oemCustomVehicleData); + assertEquals(TestValues.MATCH, VehicleDataHelper.SEAT_OCCUPANCY, seatOccupancy); assertEquals(TestValues.MATCH, VehicleDataHelper.HANDS_OFF_STEERING, handsOffSteering); // Invalid/Null Tests OnVehicleData msg = new OnVehicleData(); @@ -228,6 +232,7 @@ public class OnVehicleDataTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getGearStatus()); assertNull(TestValues.NULL, msg.getStabilityControlsStatus()); + assertNull(TestValues.NULL, msg.getSeatOccupancy()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -251,6 +256,7 @@ public class OnVehicleDataTests extends BaseRpcTests { JSONObject windowStatusObj = new JSONObject(); JSONObject gearStatusObj = new JSONObject(); JSONObject stabilityControlStatusObj = new JSONObject(); + JSONObject seatOccupancyObj = new JSONObject(); JSONArray fuelRangeArrayObj = new JSONArray(); JSONArray windowStatusArrayObj = new JSONArray(); @@ -397,6 +403,10 @@ public class OnVehicleDataTests extends BaseRpcTests { gearStatusObj.put(GearStatus.KEY_TRANSMISSION_TYPE, VehicleDataHelper.TRANSMISSION_TYPE); gearStatusObj.put(GearStatus.KEY_ACTUAL_GEAR, VehicleDataHelper.ACTUAL_GEAR); + // SEAT OCCUPANCY + seatOccupancyObj.put(SeatOccupancy.KEY_SEATS_OCCUPIED, VehicleDataHelper.SEATS_OCCUPIED); + seatOccupancyObj.put(SeatOccupancy.KEY_SEATS_BELTED, VehicleDataHelper.SEATS_BELTED); + reference.put(OnVehicleData.KEY_SPEED, VehicleDataHelper.SPEED); reference.put(OnVehicleData.KEY_RPM, VehicleDataHelper.RPM); reference.put(OnVehicleData.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE); @@ -431,6 +441,7 @@ public class OnVehicleDataTests extends BaseRpcTests { reference.put(OnVehicleData.KEY_GEAR_STATUS, gearStatusObj); reference.put(OnVehicleData.KEY_STABILITY_CONTROLS_STATUS, stabilityControlStatusObj); reference.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); + reference.put(OnVehicleData.KEY_SEAT_OCCUPANCY, seatOccupancyObj); JSONObject underTest = msg.serializeJSON(); //go inside underTest and only return the JSONObject inside the parameters key inside the notification key @@ -528,6 +539,14 @@ public class OnVehicleDataTests extends BaseRpcTests { assertTrue(TestValues.TRUE, Validator.validateGearStatuses( new GearStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)), new GearStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest)))); + } + else if (key.equals(OnVehicleData.KEY_SEAT_OCCUPANCY)) { + JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); + JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); + + assertTrue(TestValues.TRUE, Validator.validateSeatOccupancies( + new SeatOccupancy(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)), + new SeatOccupancy(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest)))); } else if (key.equals(OnVehicleData.KEY_ENGINE_OIL_LIFE)) { assertEquals(JsonUtils.readDoubleFromJsonObject(reference, key), JsonUtils.readDoubleFromJsonObject(underTest, key)); } else if (key.equals(OnVehicleData.KEY_HANDS_OFF_STEERING)) { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java index fe726018f..b7ae57140 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java @@ -65,6 +65,7 @@ public class GetVehicleDataTests extends BaseRpcTests { msg.setWindowStatus(TestValues.GENERAL_BOOLEAN); msg.setGearStatus(TestValues.GENERAL_BOOLEAN); msg.setStabilityControlsStatus(TestValues.GENERAL_BOOLEAN); + msg.setSeatOccupancy(TestValues.GENERAL_BOOLEAN); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); return msg; @@ -118,6 +119,7 @@ public class GetVehicleDataTests extends BaseRpcTests { result.put(GetVehicleData.KEY_GEAR_STATUS, TestValues.GENERAL_BOOLEAN); result.put(GetVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN); result.put(GetVehicleData.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(GetVehicleData.KEY_SEAT_OCCUPANCY, TestValues.GENERAL_BOOLEAN); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { fail(TestValues.JSON_FAIL); @@ -166,6 +168,7 @@ public class GetVehicleDataTests extends BaseRpcTests { assertTrue(TestValues.TRUE, ((GetVehicleData) msg).getWindowStatus()); assertTrue(TestValues.TRUE, ((GetVehicleData) msg).getGearStatus()); assertTrue(TestValues.TRUE, ((GetVehicleData) msg).getStabilityControlsStatus()); + assertTrue(TestValues.TRUE, ((GetVehicleData) msg).getSeatOccupancy()); assertTrue(TestValues.TRUE, ((GetVehicleData) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests @@ -206,6 +209,7 @@ public class GetVehicleDataTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getGearStatus()); assertNull(TestValues.NULL, msg.getStabilityControlsStatus()); + assertNull(TestValues.NULL, msg.getSeatOccupancy()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -261,6 +265,7 @@ public class GetVehicleDataTests extends BaseRpcTests { assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_HANDS_OFF_STEERING), cmd.getHandsOffSteering()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_GEAR_STATUS), cmd.getGearStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_SEAT_OCCUPANCY), cmd.getSeatOccupancy()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_STABILITY_CONTROLS_STATUS), cmd.getStabilityControlsStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java index 528eeb128..dfa05782c 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java @@ -63,6 +63,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { msg.setHandsOffSteering(TestValues.GENERAL_BOOLEAN); msg.setWindowStatus(TestValues.GENERAL_BOOLEAN); msg.setGearStatus(TestValues.GENERAL_BOOLEAN); + msg.setSeatOccupancy(TestValues.GENERAL_BOOLEAN); msg.setStabilityControlsStatus(TestValues.GENERAL_BOOLEAN); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); @@ -116,6 +117,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { result.put(SubscribeVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN); result.put(SubscribeVehicleData.KEY_GEAR_STATUS, TestValues.GENERAL_BOOLEAN); result.put(SubscribeVehicleData.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(SubscribeVehicleData.KEY_SEAT_OCCUPANCY, TestValues.GENERAL_BOOLEAN); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { fail(TestValues.JSON_FAIL); @@ -163,6 +165,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { assertTrue(TestValues.MATCH, ((SubscribeVehicleData) msg).getWindowStatus()); assertTrue(TestValues.MATCH, ((SubscribeVehicleData) msg).getGearStatus()); assertTrue(TestValues.MATCH, ((SubscribeVehicleData) msg).getStabilityControlsStatus()); + assertTrue(TestValues.MATCH, ((SubscribeVehicleData) msg).getSeatOccupancy()); assertTrue(TestValues.MATCH, ((SubscribeVehicleData) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests @@ -202,6 +205,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getGearStatus()); assertNull(TestValues.NULL, msg.getStabilityControlsStatus()); + assertNull(TestValues.NULL, msg.getSeatOccupancy()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -256,6 +260,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests { assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_HANDS_OFF_STEERING), cmd.getHandsOffSteering()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_STABILITY_CONTROLS_STATUS), cmd.getStabilityControlsStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_SEAT_OCCUPANCY), cmd.getSeatOccupancy()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { fail(TestValues.JSON_FAIL); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java index cfe2548f3..7be82808a 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java @@ -67,6 +67,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { msg.setHandsOffSteering(TestValues.GENERAL_BOOLEAN); msg.setWindowStatus(TestValues.GENERAL_BOOLEAN); msg.setStabilityControlsStatus(TestValues.GENERAL_BOOLEAN); + msg.setSeatOccupancy(TestValues.GENERAL_BOOLEAN); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); return msg; @@ -120,6 +121,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { result.put(UnsubscribeVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN); result.put(UnsubscribeVehicleData.KEY_GEAR_STATUS, TestValues.GENERAL_BOOLEAN); result.put(UnsubscribeVehicleData.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_BOOLEAN); + result.put(UnsubscribeVehicleData.KEY_SEAT_OCCUPANCY, TestValues.GENERAL_BOOLEAN); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN); } catch (JSONException e) { fail(TestValues.JSON_FAIL); @@ -167,6 +169,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { assertTrue(TestValues.TRUE, ((UnsubscribeVehicleData) msg).getWindowStatus()); assertTrue(TestValues.TRUE, ((UnsubscribeVehicleData) msg).getGearStatus()); assertTrue(TestValues.TRUE, ((UnsubscribeVehicleData) msg).getStabilityControlsStatus()); + assertTrue(TestValues.TRUE, ((UnsubscribeVehicleData) msg).getSeatOccupancy()); assertTrue(TestValues.TRUE, ((UnsubscribeVehicleData) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests UnsubscribeVehicleData msg = new UnsubscribeVehicleData(); @@ -206,6 +209,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getGearStatus()); assertNull(TestValues.NULL, msg.getStabilityControlsStatus()); + assertNull(TestValues.NULL, msg.getSeatOccupancy()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -262,6 +266,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests { assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_GEAR_STATUS), cmd.getGearStatus()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_STABILITY_CONTROLS_STATUS), cmd.getStabilityControlsStatus()); + assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_SEAT_OCCUPANCY), cmd.getSeatOccupancy()); assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } catch (JSONException e) { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java index 606283cc7..fba799981 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java @@ -16,6 +16,7 @@ import com.smartdevicelink.proxy.rpc.GearStatus; import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse; import com.smartdevicelink.proxy.rpc.HeadLampStatus; import com.smartdevicelink.proxy.rpc.MyKey; +import com.smartdevicelink.proxy.rpc.SeatOccupancy; import com.smartdevicelink.proxy.rpc.SingleTireStatus; import com.smartdevicelink.proxy.rpc.StabilityControlsStatus; import com.smartdevicelink.proxy.rpc.TireStatus; @@ -105,6 +106,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { result.put(GetVehicleDataResponse.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING); result.put(GetVehicleDataResponse.KEY_GEAR_STATUS, VehicleDataHelper.GEAR_STATUS); result.put(GetVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS, VehicleDataHelper.STABILITY_CONTROLS_STATUS); + result.put(GetVehicleDataResponse.KEY_SEAT_OCCUPANCY, VehicleDataHelper.SEAT_OCCUPANCY); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); } catch (JSONException e) { fail(TestValues.JSON_FAIL); @@ -133,6 +135,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { JSONObject fuelRangeObj = new JSONObject(); JSONObject windowStatusObj = new JSONObject(); JSONObject gearStatusObj = new JSONObject(); + JSONObject seatOccupancyObj = new JSONObject(); JSONArray fuelRangeArrayObj = new JSONArray(); JSONArray windowStatusArrayObj = new JSONArray(); @@ -278,6 +281,10 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { windowStatusObj.put(WindowStatus.KEY_STATE, VehicleDataHelper.WINDOW_STATE); windowStatusArrayObj.put(windowStatusObj); + // WINDOW_STATUS + seatOccupancyObj.put(SeatOccupancy.KEY_SEATS_BELTED, VehicleDataHelper.SEATS_BELTED); + seatOccupancyObj.put(SeatOccupancy.KEY_SEATS_OCCUPIED, VehicleDataHelper.SEATS_OCCUPIED); + reference.put(GetVehicleDataResponse.KEY_SPEED, VehicleDataHelper.SPEED); reference.put(GetVehicleDataResponse.KEY_RPM, VehicleDataHelper.RPM); reference.put(GetVehicleDataResponse.KEY_EXTERNAL_TEMPERATURE, VehicleDataHelper.EXTERNAL_TEMPERATURE); @@ -311,6 +318,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { reference.put(GetVehicleDataResponse.KEY_WINDOW_STATUS, windowStatusArrayObj); reference.put(GetVehicleDataResponse.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING); reference.put(GetVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatusObj); + reference.put(GetVehicleDataResponse.KEY_SEAT_OCCUPANCY, seatOccupancyObj); reference.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE); JSONObject underTest = msg.serializeJSON(); @@ -424,6 +432,13 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { assertTrue(TestValues.TRUE, Validator.validateGearStatuses( new GearStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)), new GearStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest)))); + } else if (key.equals(GetVehicleDataResponse.KEY_SEAT_OCCUPANCY)) { + JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); + JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); + + assertTrue(TestValues.TRUE, Validator.validateSeatOccupancies( + new SeatOccupancy(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)), + new SeatOccupancy(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest)))); } else if (key.equals(GetVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS)) { JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key); JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key); @@ -525,6 +540,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { assertEquals(TestValues.MATCH, VehicleDataHelper.GEAR_STATUS, ((GetVehicleDataResponse) msg).getGearStatus()); assertEquals(TestValues.MATCH, VehicleDataHelper.HANDS_OFF_STEERING, ((GetVehicleDataResponse) msg).getHandsOffSteering()); assertEquals(TestValues.MATCH, VehicleDataHelper.STABILITY_CONTROLS_STATUS, ((GetVehicleDataResponse) msg).getStabilityControlsStatus()); + assertEquals(TestValues.MATCH, VehicleDataHelper.SEAT_OCCUPANCY, ((GetVehicleDataResponse) msg).getSeatOccupancy()); assertEquals(TestValues.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, ((GetVehicleDataResponse) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); // Invalid/Null Tests @@ -563,6 +579,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getHandsOffSteering()); assertNull(TestValues.NULL, msg.getStabilityControlsStatus()); assertNull(TestValues.NULL, msg.getWindowStatus()); + assertNull(TestValues.NULL, msg.getSeatOccupancy()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -652,6 +669,10 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { GearStatus cmdStatus = cmd.getGearStatus(); assertTrue(TestValues.TRUE, Validator.validateGearStatuses(gearStatus, cmdStatus)); + JSONObject seatOccupancyObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_SEAT_OCCUPANCY); + SeatOccupancy seatOccupancy = new SeatOccupancy(JsonRPCMarshaller.deserializeJSONObject(seatOccupancyObj)); + assertTrue(TestValues.TRUE, Validator.validateSeatOccupancies(seatOccupancy, cmd.getSeatOccupancy())); + JSONObject myKeyObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_MY_KEY); MyKey myKey = new MyKey(JsonRPCMarshaller.deserializeJSONObject(myKeyObj)); assertTrue(TestValues.TRUE, Validator.validateMyKey(myKey, cmd.getMyKey())); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java index 6f9c9a45c..4d0da0627 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java @@ -70,6 +70,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { msg.setWindowStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal())); msg.setStabilityControlsStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS.ordinal())); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA); + msg.setSeatOccupancy(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SEATOCCUPANCY.ordinal())); return msg; } @@ -128,6 +129,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal()).serializeJSON()); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_SEAT_OCCUPANCY, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SEATOCCUPANCY.ordinal()).serializeJSON()); } catch (JSONException e) { fail(TestValues.JSON_FAIL); } @@ -175,6 +177,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { VehicleDataResult testGearStatus = ((SubscribeVehicleDataResponse) msg).getGearStatus(); VehicleDataResult testStabilityControlStatus = ((SubscribeVehicleDataResponse) msg).getStabilityControlsStatus(); VehicleDataResult testOEMCustomVehicleData = ((SubscribeVehicleDataResponse) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + VehicleDataResult testSeatOccupancy = ((SubscribeVehicleDataResponse) msg).getSeatOccupancy(); // Valid Tests assertTrue(TestValues.TRUE, testResult.equals(TestValues.GENERAL_RESULT)); @@ -211,6 +214,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { assertTrue(TestValues.TRUE, testWindowStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WINDOWSTATUS)); assertTrue(TestValues.TRUE, testStabilityControlStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS)); assertTrue(TestValues.TRUE, testOEMCustomVehicleData.getOEMCustomVehicleDataType().equals(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); + assertTrue(TestValues.TRUE, testSeatOccupancy.getDataType().equals(VehicleDataType.VEHICLEDATA_SEATOCCUPANCY)); // Invalid/Null Tests SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse(); @@ -250,6 +254,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getGearStatus()); assertNull(TestValues.NULL, msg.getStabilityControlsStatus()); + assertNull(TestValues.NULL, msg.getSeatOccupancy()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -405,6 +410,10 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests { JSONObject oemCustomVehicleDataName = JsonUtils.readJsonObjectFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); VehicleDataResult referenceOemCustomData = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(oemCustomVehicleDataName)); assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME))); + + JSONObject seatOccupancy = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_SEAT_OCCUPANCY); + VehicleDataResult referenceSeatOccupancy = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(seatOccupancy)); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceSeatOccupancy, cmd.getSeatOccupancy())); } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java index 1d5504b08..b4de70acc 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java @@ -70,6 +70,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { msg.setWindowStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal())); msg.setHandsOffSteering(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal())); msg.setGearStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GEARSTATUS.ordinal())); + msg.setSeatOccupancy(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SEATOCCUPANCY.ordinal())); msg.setStabilityControlsStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS.ordinal())); msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA); @@ -129,6 +130,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { result.put(SubscribeVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal()).serializeJSON()); + result.put(SubscribeVehicleDataResponse.KEY_SEAT_OCCUPANCY, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_SEATOCCUPANCY.ordinal()).serializeJSON()); result.put(SubscribeVehicleDataResponse.KEY_WINDOW_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal()).serializeJSON()); result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON()); } catch (JSONException e) { @@ -178,6 +180,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { VehicleDataResult testWindowStatus = ((UnsubscribeVehicleDataResponse) msg).getWindowStatus(); VehicleDataResult testStabilityControlStatus = ((UnsubscribeVehicleDataResponse) msg).getStabilityControlsStatus(); VehicleDataResult testOemCustomData = ((UnsubscribeVehicleDataResponse) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME); + VehicleDataResult testKeySeatOccupancy = ((UnsubscribeVehicleDataResponse) msg).getSeatOccupancy(); // Valid Tests assertTrue(TestValues.TRUE, testResult.equals(TestValues.GENERAL_RESULT)); @@ -214,6 +217,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { assertTrue(TestValues.TRUE, testStabilityControlStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS)); assertTrue(TestValues.TRUE, testOemCustomData.getOEMCustomVehicleDataType().equals(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); assertTrue(TestValues.TRUE, testGearStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_GEARSTATUS)); + assertTrue(TestValues.TRUE, testKeySeatOccupancy.getDataType().equals(VehicleDataType.VEHICLEDATA_SEATOCCUPANCY)); // Invalid/Null Tests UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse(); @@ -254,6 +258,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { assertNull(TestValues.NULL, msg.getWindowStatus()); assertNull(TestValues.NULL, msg.getHandsOffSteering()); assertNull(TestValues.NULL, msg.getStabilityControlsStatus()); + assertNull(TestValues.NULL, msg.getSeatOccupancy()); assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)); } @@ -409,6 +414,10 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests { JSONObject stabilityControlsStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS); VehicleDataResult referenceStabilityControlStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(stabilityControlsStatus)); assertTrue(TestValues.TRUE, Validator.validateStabilityControlStatus(referenceStabilityControlStatus, cmd.getStabilityControlsStatus())); + + JSONObject seatOccupancy = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_SEAT_OCCUPANCY); + VehicleDataResult referenceSeatOccupancy = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(seatOccupancy)); + assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceSeatOccupancy, cmd.getSeatOccupancy())); } catch (JSONException e) { e.printStackTrace(); } diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java index 37545d140..985b981d8 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java @@ -1,793 +1,828 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Non periodic vehicle data read request.
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>gps</td>
- * <td>Boolean</td>
- * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData }for details</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>speed</td>
- * <td>Boolean</td>
- * <td>The vehicle speed in kilometers per hour</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>rpm</td>
- * <td>Boolean</td>
- * <td>The number of revolutions per minute of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel</td>
- * <td>Boolean</td>
- * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel_State</td>
- * <td>Boolean</td>
- * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>fuelRange</td>
- * <td>Boolean</td>
- * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0.0</td>
- * </tr>
- * <tr>
- * <td>instantFuelConsumption</td>
- * <td>Boolean</td>
- * <td>The instantaneous fuel consumption in micro litres</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>externalTemperature</td>
- * <td>Boolean</td>
- * <td>The external temperature in degrees celsius</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>vin</td>
- * <td>Boolean</td>
- * <td>Vehicle identification number</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <tr>
- * <td>gearStatus</td>
- * <td>Boolean</td>
- * <td>See GearStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>prndl</td>
- * <td>Boolean</td>
- * <td>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>tirePressure</td>
- * <td>Boolean</td>
- * <td>Tire pressure status</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>odometer</td>
- * <td>Boolean</td>
- * <td>Odometer in km</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>beltStatus</td>
- * <td>Boolean</td>
- * <td>The status of the seat belts</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>bodyInformation</td>
- * <td>Boolean</td>
- * <td>The body information including ignition status and internal temp</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>deviceStatus</td>
- * <td>Boolean</td>
- * <td>The device status including signal and battery strength</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>driverBraking</td>
- * <td>Boolean</td>
- * <td>The status of the brake pedal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>wiperStatus</td>
- * <td>Boolean</td>
- * <td>The status of the wipers</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>headLampStatus</td>
- * <td>Boolean</td>
- * <td>Status of the head lamps</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>engineTorque</td>
- * <td>Boolean</td>
- * <td>Torque value for engine (in Nm) on non-diesel variants</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>engineOilLife</td>
- * <td>Boolean</td>
- * <td>The estimated percentage of remaining oil life of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>accPedalPosition</td>
- * <td>Boolean</td>
- * <td>Accelerator pedal position (percentage depressed)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>steeringWheelAngle</td>
- * <td>Boolean</td>
- * <td>Current angle of the steering wheel (in deg)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>turnSignal</td>
- * <td>Boolean</td>
- * <td>@see TurnSignal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>cloudAppVehicleID</td>
- * <td>Boolean</td>
- * <td>ID for the vehicle when connecting to cloud applications</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.1 </td>
- * <tr>
- * <td>stabilityControlsStatus</td>
- * <td>Boolean</td>
- * <td>See StabilityControlsStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * </tr>
- * <tr>
- * <td>handsOffSteering</td>
- * <td>Boolean</td>
- * <td>To indicate whether driver hands are off the steering wheel</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>windowStatus</td>
- * <td>Boolean</td>
- * <td>See WindowStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * </table>
- *
- *
- * <p><b>Response</b></p>
- *
- * <p> <b>Non-default Result Codes:</b></p>
- * <p> SUCCESS</p>
- * <p> INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p> GENERIC_ERROR</p>
- * <p> REJECTED</p>
- * <p> VEHICLE_DATA_NOT_ALLOWED</p>
- * <p>VEHICLE_DATA_NOT_AVAILABLE</p>
- * <p> USER_DISALLOWED</p>
- *
- * @see SubscribeVehicleData
- * @see UnsubscribeVehicleData
- * @since SmartDeviceLink 2.0
- */
-public class GetVehicleData extends RPCRequest {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_VIN = "vin";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
- public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
- public static final String KEY_WINDOW_STATUS = "windowStatus";
- public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
- public static final String KEY_GEAR_STATUS = "gearStatus";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
-
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
-
- /**
- * Constructs a new GetVehicleData object
- */
-
- public GetVehicleData() {
- super(FunctionID.GET_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>
- * Constructs a new GetVehicleDta object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash The Hashtable to use
- */
-
- public GetVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public GetVehicleData setGps(Boolean gps) {
- setParameters(KEY_GPS, gps);
- return this;
- }
-
- public Boolean getGps() {
- return getBoolean(KEY_GPS);
- }
-
- public GetVehicleData setSpeed(Boolean speed) {
- setParameters(KEY_SPEED, speed);
- return this;
- }
-
- public Boolean getSpeed() {
- return getBoolean(KEY_SPEED);
- }
-
- public GetVehicleData setRpm(Boolean rpm) {
- setParameters(KEY_RPM, rpm);
- return this;
- }
-
- public Boolean getRpm() {
- return getBoolean(KEY_RPM);
- }
-
- /**
- * Sets the fuelLevel.
- *
- * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public GetVehicleData setFuelLevel(Boolean fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- return this;
- }
-
- /**
- * Gets the fuelLevel.
- *
- * @return Boolean The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public Boolean getFuelLevel() {
- return getBoolean(KEY_FUEL_LEVEL);
- }
-
- @Deprecated
- public GetVehicleData setFuelLevelState(Boolean fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- return this;
- }
-
- @Deprecated
- public Boolean getFuelLevelState() {
- return getBoolean(KEY_FUEL_LEVEL_STATE);
- }
-
- public GetVehicleData setInstantFuelConsumption(Boolean instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- return this;
- }
-
- public Boolean getInstantFuelConsumption() {
- return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
- }
-
- public GetVehicleData setFuelRange(Boolean fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- return this;
- }
-
- public Boolean getFuelRange() {
- return getBoolean(KEY_FUEL_RANGE);
- }
-
- public GetVehicleData setExternalTemperature(Boolean externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- return this;
- }
-
- public Boolean getExternalTemperature() {
- return getBoolean(KEY_EXTERNAL_TEMPERATURE);
- }
-
- public GetVehicleData setVin(Boolean vin) {
- setParameters(KEY_VIN, vin);
- return this;
- }
-
- public Boolean getVin() {
- return getBoolean(KEY_VIN);
- }
-
- /**
- * Sets the prndl.
- *
- * @param prndl See PRNDL.
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public GetVehicleData setPrndl(Boolean prndl) {
- setParameters(KEY_PRNDL, prndl);
- return this;
- }
-
- /**
- * Gets the prndl.
- *
- * @return Boolean See PRNDL.
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public Boolean getPrndl() {
- return getBoolean(KEY_PRNDL);
- }
-
- public GetVehicleData setTirePressure(Boolean tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- return this;
- }
-
- public Boolean getTirePressure() {
- return getBoolean(KEY_TIRE_PRESSURE);
- }
-
- public GetVehicleData setOdometer(Boolean odometer) {
- setParameters(KEY_ODOMETER, odometer);
- return this;
- }
-
- public Boolean getOdometer() {
- return getBoolean(KEY_ODOMETER);
- }
-
- public GetVehicleData setBeltStatus(Boolean beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- return this;
- }
-
- public Boolean getBeltStatus() {
- return getBoolean(KEY_BELT_STATUS);
- }
-
- public GetVehicleData setBodyInformation(Boolean bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- return this;
- }
-
- public Boolean getBodyInformation() {
- return getBoolean(KEY_BODY_INFORMATION);
- }
-
- public GetVehicleData setDeviceStatus(Boolean deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- return this;
- }
-
- public Boolean getDeviceStatus() {
- return getBoolean(KEY_DEVICE_STATUS);
- }
-
- public GetVehicleData setDriverBraking(Boolean driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- return this;
- }
-
- public Boolean getDriverBraking() {
- return getBoolean(KEY_DRIVER_BRAKING);
- }
-
- public GetVehicleData setWiperStatus(Boolean wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- return this;
- }
-
- public Boolean getWiperStatus() {
- return getBoolean(KEY_WIPER_STATUS);
- }
-
- public GetVehicleData setHeadLampStatus(Boolean headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- return this;
- }
-
- public Boolean getHeadLampStatus() {
- return getBoolean(KEY_HEAD_LAMP_STATUS);
- }
-
- public GetVehicleData setEngineTorque(Boolean engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- return this;
- }
-
- public Boolean getEngineTorque() {
- return getBoolean(KEY_ENGINE_TORQUE);
- }
-
- public GetVehicleData setEngineOilLife(Boolean engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- return this;
- }
-
- public Boolean getEngineOilLife() {
- return getBoolean(KEY_ENGINE_OIL_LIFE);
- }
-
- public GetVehicleData setAccPedalPosition(Boolean accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- return this;
- }
-
- public Boolean getAccPedalPosition() {
- return getBoolean(KEY_ACC_PEDAL_POSITION);
- }
-
- public GetVehicleData setSteeringWheelAngle(Boolean steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- return this;
- }
-
- public Boolean getSteeringWheelAngle() {
- return getBoolean(KEY_STEERING_WHEEL_ANGLE);
- }
-
- public GetVehicleData setECallInfo(Boolean eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- return this;
- }
-
- public Boolean getECallInfo() {
- return getBoolean(KEY_E_CALL_INFO);
- }
-
-
- public GetVehicleData setAirbagStatus(Boolean airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- return this;
- }
-
- public Boolean getAirbagStatus() {
- return getBoolean(KEY_AIRBAG_STATUS);
- }
-
- public GetVehicleData setEmergencyEvent(Boolean emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- return this;
- }
-
- public Boolean getEmergencyEvent() {
- return getBoolean(KEY_EMERGENCY_EVENT);
- }
-
- public GetVehicleData setClusterModeStatus(Boolean clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- return this;
- }
-
- public Boolean getClusterModeStatus() {
- return getBoolean(KEY_CLUSTER_MODE_STATUS);
- }
-
- public GetVehicleData setMyKey(Boolean myKey) {
- setParameters(KEY_MY_KEY, myKey);
- return this;
- }
-
- public Boolean getMyKey() {
- return getBoolean(KEY_MY_KEY);
- }
-
- /**
- * Sets a boolean value. If true, subscribes turnSignal data
- *
- * @param turnSignal a boolean value
- */
- public GetVehicleData setTurnSignal(Boolean turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the turnSignal data has been subscribed.
- *
- * @return a Boolean value.
- */
- public Boolean getTurnSignal() {
- return getBoolean(KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
- *
- * @param electronicParkBrakeStatus a boolean value
- */
- public GetVehicleData setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus) {
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
- *
- * @return a Boolean value.
- */
- public Boolean getElectronicParkBrakeStatus() {
- return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, gets the cloudAppVehicleID data
- *
- * @param cloudAppVehicleID a boolean value
- */
- public GetVehicleData setCloudAppVehicleID(boolean cloudAppVehicleID) {
- setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the cloudAppVehicleDataID data has been set to retrieve.
- *
- * @return a Boolean value.
- */
- public Boolean getCloudAppVehicleID() {
- return getBoolean(KEY_CLOUD_APP_VEHICLE_ID);
- }
-
- /**
- * Sets a boolean value for OEM Custom VehicleData.
- *
- * @param vehicleDataName a String value
- * @param vehicleDataState a boolean value
- */
- public GetVehicleData setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState) {
- setParameters(vehicleDataName, vehicleDataState);
- return this;
- }
-
- /**
- * Gets a boolean value for OEM Custom VehicleData.
- *
- * @return a Boolean value.
- */
- public Boolean getOEMCustomVehicleData(String vehicleDataName) {
- return getBoolean(vehicleDataName);
- }
-
- /**
- * Sets the windowStatus.
- *
- * @param windowStatus See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public GetVehicleData setWindowStatus(Boolean windowStatus) {
- setParameters(KEY_WINDOW_STATUS, windowStatus);
- return this;
- }
-
- /**
- * Gets the windowStatus.
- *
- * @return Boolean See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getWindowStatus() {
- return getBoolean(KEY_WINDOW_STATUS);
- }
-
- /**
- * Sets the handsOffSteering.
- *
- * @param handsOffSteering To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public GetVehicleData setHandsOffSteering(Boolean handsOffSteering) {
- setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
- return this;
- }
-
- /**
- * Gets the handsOffSteering.
- *
- * @return Boolean To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getHandsOffSteering() {
- return getBoolean(KEY_HANDS_OFF_STEERING);
- }
-
- /**
- * Sets the gearStatus.
- *
- * @param gearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public GetVehicleData setGearStatus(Boolean gearStatus) {
- setParameters(KEY_GEAR_STATUS, gearStatus);
- return this;
- }
-
- /**
- * Gets the gearStatus.
- *
- * @return GearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getGearStatus() {
- return getBoolean(KEY_GEAR_STATUS);
- }
-
- /**
- * Sets the stabilityControlsStatus.
- *
- * @param stabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public GetVehicleData setStabilityControlsStatus(Boolean stabilityControlsStatus) {
- setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
- return this;
- }
-
- /**
- * Gets the stabilityControlsStatus.
- *
- * @return Boolean See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getStabilityControlsStatus() {
- return getBoolean(KEY_STABILITY_CONTROLS_STATUS);
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCRequest; + +import java.util.Hashtable; + +/** + * Non periodic vehicle data read request. + * + * <p><b>Parameter List</b></p> + * <table border="1" rules="all"> + * <tr> + * <th>Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Reg.</th> + * <th>Notes</th> + * <th>Version</th> + * </tr> + * <tr> + * <td>gps</td> + * <td>Boolean</td> + * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData }for details</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>speed</td> + * <td>Boolean</td> + * <td>The vehicle speed in kilometers per hour</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>rpm</td> + * <td>Boolean</td> + * <td>The number of revolutions per minute of the engine</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>fuelLevel</td> + * <td>Boolean</td> + * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>fuelLevel_State</td> + * <td>Boolean</td> + * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>fuelRange</td> + * <td>Boolean</td> + * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0.0</td> + * </tr> + * <tr> + * <td>instantFuelConsumption</td> + * <td>Boolean</td> + * <td>The instantaneous fuel consumption in micro litres</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>externalTemperature</td> + * <td>Boolean</td> + * <td>The external temperature in degrees celsius</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>vin</td> + * <td>Boolean</td> + * <td>Vehicle identification number</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <tr> + * <td>gearStatus</td> + * <td>Boolean</td> + * <td>See GearStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>prndl</td> + * <td>Boolean</td> + * <td>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>tirePressure</td> + * <td>Boolean</td> + * <td>Tire pressure status</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>odometer</td> + * <td>Boolean</td> + * <td>Odometer in km</td> + * <td>N</td> + * <td>Max Length: 500</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>beltStatus</td> + * <td>Boolean</td> + * <td>The status of the seat belts</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>bodyInformation</td> + * <td>Boolean</td> + * <td>The body information including ignition status and internal temp</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>deviceStatus</td> + * <td>Boolean</td> + * <td>The device status including signal and battery strength</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>driverBraking</td> + * <td>Boolean</td> + * <td>The status of the brake pedal</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>wiperStatus</td> + * <td>Boolean</td> + * <td>The status of the wipers</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>headLampStatus</td> + * <td>Boolean</td> + * <td>Status of the head lamps</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>engineTorque</td> + * <td>Boolean</td> + * <td>Torque value for engine (in Nm) on non-diesel variants</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>engineOilLife</td> + * <td>Boolean</td> + * <td>The estimated percentage of remaining oil life of the engine</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0</td> + * </tr> + * <tr> + * <td>accPedalPosition</td> + * <td>Boolean</td> + * <td>Accelerator pedal position (percentage depressed)</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>steeringWheelAngle</td> + * <td>Boolean</td> + * <td>Current angle of the steering wheel (in deg)</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>turnSignal</td> + * <td>Boolean</td> + * <td>@see TurnSignal</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0</td> + * </tr> + * <tr> + * <td>cloudAppVehicleID</td> + * <td>Boolean</td> + * <td>ID for the vehicle when connecting to cloud applications</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.1 </td> + * <tr> + * <td>stabilityControlsStatus</td> + * <td>Boolean</td> + * <td>See StabilityControlsStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * </tr> + * <tr> + * <td>handsOffSteering</td> + * <td>Boolean</td> + * <td>To indicate whether driver hands are off the steering wheel</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>windowStatus</td> + * <td>Boolean</td> + * <td>See WindowStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>seatOccupancy</td> + * <td>Boolean</td> + * <td>See SeatOccupancy</td> + * <td>N</td> + * <td></td> + * <td> + * @since SmartDeviceLink 7.1.0 + * </td> + * </tr> + * </table> + * + * + * <p><b>Response</b></p> + * + * <p> <b>Non-default Result Codes:</b></p> + * <p> SUCCESS</p> + * <p> INVALID_DATA</p> + * <p>OUT_OF_MEMORY</p> + * <p>TOO_MANY_PENDING_REQUESTS</p> + * <p>APPLICATION_NOT_REGISTERED</p> + * <p> GENERIC_ERROR</p> + * <p> REJECTED</p> + * <p> VEHICLE_DATA_NOT_ALLOWED</p> + * <p>VEHICLE_DATA_NOT_AVAILABLE</p> + * <p> USER_DISALLOWED</p> + * + * @see SubscribeVehicleData + * @see UnsubscribeVehicleData + * @since SmartDeviceLink 2.0 + */ +public class GetVehicleData extends RPCRequest { + public static final String KEY_SPEED = "speed"; + public static final String KEY_RPM = "rpm"; + public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature"; + public static final String KEY_VIN = "vin"; + public static final String KEY_PRNDL = "prndl"; + public static final String KEY_TIRE_PRESSURE = "tirePressure"; + public static final String KEY_ENGINE_TORQUE = "engineTorque"; + public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife"; + public static final String KEY_ODOMETER = "odometer"; + public static final String KEY_GPS = "gps"; + public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption"; + public static final String KEY_BELT_STATUS = "beltStatus"; + public static final String KEY_BODY_INFORMATION = "bodyInformation"; + public static final String KEY_DEVICE_STATUS = "deviceStatus"; + public static final String KEY_DRIVER_BRAKING = "driverBraking"; + public static final String KEY_WIPER_STATUS = "wiperStatus"; + public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus"; + public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition"; + public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle"; + public static final String KEY_E_CALL_INFO = "eCallInfo"; + public static final String KEY_AIRBAG_STATUS = "airbagStatus"; + public static final String KEY_EMERGENCY_EVENT = "emergencyEvent"; + public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus"; + public static final String KEY_MY_KEY = "myKey"; + public static final String KEY_FUEL_RANGE = "fuelRange"; + public static final String KEY_TURN_SIGNAL = "turnSignal"; + public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus"; + public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID"; + public static final String KEY_WINDOW_STATUS = "windowStatus"; + public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering"; + public static final String KEY_GEAR_STATUS = "gearStatus"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL = "fuelLevel"; + + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State"; + public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus"; + + /** + * @since SmartDeviceLink 7.1.0 + */ + public static final String KEY_SEAT_OCCUPANCY = "seatOccupancy"; + /** + * Constructs a new GetVehicleData object + */ + + public GetVehicleData() { + super(FunctionID.GET_VEHICLE_DATA.toString()); + } + + /** + * <p> + * Constructs a new GetVehicleDta object indicated by the Hashtable + * parameter + * </p> + * + * @param hash The Hashtable to use + */ + + public GetVehicleData(Hashtable<String, Object> hash) { + super(hash); + } + + public GetVehicleData setGps(Boolean gps) { + setParameters(KEY_GPS, gps); + return this; + } + + public Boolean getGps() { + return getBoolean(KEY_GPS); + } + + public GetVehicleData setSpeed(Boolean speed) { + setParameters(KEY_SPEED, speed); + return this; + } + + public Boolean getSpeed() { + return getBoolean(KEY_SPEED); + } + + public GetVehicleData setRpm(Boolean rpm) { + setParameters(KEY_RPM, rpm); + return this; + } + + public Boolean getRpm() { + return getBoolean(KEY_RPM); + } + + /** + * Sets the fuelLevel. + * + * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public GetVehicleData setFuelLevel(Boolean fuelLevel) { + setParameters(KEY_FUEL_LEVEL, fuelLevel); + return this; + } + + /** + * Gets the fuelLevel. + * + * @return Boolean The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public Boolean getFuelLevel() { + return getBoolean(KEY_FUEL_LEVEL); + } + + @Deprecated + public GetVehicleData setFuelLevelState(Boolean fuelLevelState) { + setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState); + return this; + } + + @Deprecated + public Boolean getFuelLevelState() { + return getBoolean(KEY_FUEL_LEVEL_STATE); + } + + public GetVehicleData setInstantFuelConsumption(Boolean instantFuelConsumption) { + setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption); + return this; + } + + public Boolean getInstantFuelConsumption() { + return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION); + } + + public GetVehicleData setFuelRange(Boolean fuelRange) { + setParameters(KEY_FUEL_RANGE, fuelRange); + return this; + } + + public Boolean getFuelRange() { + return getBoolean(KEY_FUEL_RANGE); + } + + public GetVehicleData setExternalTemperature(Boolean externalTemperature) { + setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature); + return this; + } + + public Boolean getExternalTemperature() { + return getBoolean(KEY_EXTERNAL_TEMPERATURE); + } + + public GetVehicleData setVin(Boolean vin) { + setParameters(KEY_VIN, vin); + return this; + } + + public Boolean getVin() { + return getBoolean(KEY_VIN); + } + + /** + * Sets the prndl. + * + * @param prndl See PRNDL. + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public GetVehicleData setPrndl(Boolean prndl) { + setParameters(KEY_PRNDL, prndl); + return this; + } + + /** + * Gets the prndl. + * + * @return Boolean See PRNDL. + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public Boolean getPrndl() { + return getBoolean(KEY_PRNDL); + } + + public GetVehicleData setTirePressure(Boolean tirePressure) { + setParameters(KEY_TIRE_PRESSURE, tirePressure); + return this; + } + + public Boolean getTirePressure() { + return getBoolean(KEY_TIRE_PRESSURE); + } + + public GetVehicleData setOdometer(Boolean odometer) { + setParameters(KEY_ODOMETER, odometer); + return this; + } + + public Boolean getOdometer() { + return getBoolean(KEY_ODOMETER); + } + + public GetVehicleData setBeltStatus(Boolean beltStatus) { + setParameters(KEY_BELT_STATUS, beltStatus); + return this; + } + + public Boolean getBeltStatus() { + return getBoolean(KEY_BELT_STATUS); + } + + public GetVehicleData setBodyInformation(Boolean bodyInformation) { + setParameters(KEY_BODY_INFORMATION, bodyInformation); + return this; + } + + public Boolean getBodyInformation() { + return getBoolean(KEY_BODY_INFORMATION); + } + + public GetVehicleData setDeviceStatus(Boolean deviceStatus) { + setParameters(KEY_DEVICE_STATUS, deviceStatus); + return this; + } + + public Boolean getDeviceStatus() { + return getBoolean(KEY_DEVICE_STATUS); + } + + public GetVehicleData setDriverBraking(Boolean driverBraking) { + setParameters(KEY_DRIVER_BRAKING, driverBraking); + return this; + } + + public Boolean getDriverBraking() { + return getBoolean(KEY_DRIVER_BRAKING); + } + + public GetVehicleData setWiperStatus(Boolean wiperStatus) { + setParameters(KEY_WIPER_STATUS, wiperStatus); + return this; + } + + public Boolean getWiperStatus() { + return getBoolean(KEY_WIPER_STATUS); + } + + public GetVehicleData setHeadLampStatus(Boolean headLampStatus) { + setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus); + return this; + } + + public Boolean getHeadLampStatus() { + return getBoolean(KEY_HEAD_LAMP_STATUS); + } + + public GetVehicleData setEngineTorque(Boolean engineTorque) { + setParameters(KEY_ENGINE_TORQUE, engineTorque); + return this; + } + + public Boolean getEngineTorque() { + return getBoolean(KEY_ENGINE_TORQUE); + } + + public GetVehicleData setEngineOilLife(Boolean engineOilLife) { + setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife); + return this; + } + + public Boolean getEngineOilLife() { + return getBoolean(KEY_ENGINE_OIL_LIFE); + } + + public GetVehicleData setAccPedalPosition(Boolean accPedalPosition) { + setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition); + return this; + } + + public Boolean getAccPedalPosition() { + return getBoolean(KEY_ACC_PEDAL_POSITION); + } + + public GetVehicleData setSteeringWheelAngle(Boolean steeringWheelAngle) { + setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle); + return this; + } + + public Boolean getSteeringWheelAngle() { + return getBoolean(KEY_STEERING_WHEEL_ANGLE); + } + + public GetVehicleData setECallInfo(Boolean eCallInfo) { + setParameters(KEY_E_CALL_INFO, eCallInfo); + return this; + } + + public Boolean getECallInfo() { + return getBoolean(KEY_E_CALL_INFO); + } + + + public GetVehicleData setAirbagStatus(Boolean airbagStatus) { + setParameters(KEY_AIRBAG_STATUS, airbagStatus); + return this; + } + + public Boolean getAirbagStatus() { + return getBoolean(KEY_AIRBAG_STATUS); + } + + public GetVehicleData setEmergencyEvent(Boolean emergencyEvent) { + setParameters(KEY_EMERGENCY_EVENT, emergencyEvent); + return this; + } + + public Boolean getEmergencyEvent() { + return getBoolean(KEY_EMERGENCY_EVENT); + } + + public GetVehicleData setClusterModeStatus(Boolean clusterModeStatus) { + setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus); + return this; + } + + public Boolean getClusterModeStatus() { + return getBoolean(KEY_CLUSTER_MODE_STATUS); + } + + public GetVehicleData setMyKey(Boolean myKey) { + setParameters(KEY_MY_KEY, myKey); + return this; + } + + public Boolean getMyKey() { + return getBoolean(KEY_MY_KEY); + } + + /** + * Sets a boolean value. If true, subscribes turnSignal data + * + * @param turnSignal a boolean value + */ + public GetVehicleData setTurnSignal(Boolean turnSignal) { + setParameters(KEY_TURN_SIGNAL, turnSignal); + return this; + } + + /** + * Gets a boolean value. If true, means the turnSignal data has been subscribed. + * + * @return a Boolean value. + */ + public Boolean getTurnSignal() { + return getBoolean(KEY_TURN_SIGNAL); + } + + /** + * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data + * + * @param electronicParkBrakeStatus a boolean value + */ + public GetVehicleData setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus) { + setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed. + * + * @return a Boolean value. + */ + public Boolean getElectronicParkBrakeStatus() { + return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS); + } + + /** + * Sets a boolean value. If true, gets the cloudAppVehicleID data + * + * @param cloudAppVehicleID a boolean value + */ + public GetVehicleData setCloudAppVehicleID(boolean cloudAppVehicleID) { + setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID); + return this; + } + + /** + * Gets a boolean value. If true, means the cloudAppVehicleDataID data has been set to retrieve. + * + * @return a Boolean value. + */ + public Boolean getCloudAppVehicleID() { + return getBoolean(KEY_CLOUD_APP_VEHICLE_ID); + } + + /** + * Sets a boolean value for OEM Custom VehicleData. + * + * @param vehicleDataName a String value + * @param vehicleDataState a boolean value + */ + public GetVehicleData setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState) { + setParameters(vehicleDataName, vehicleDataState); + return this; + } + + /** + * Gets a boolean value for OEM Custom VehicleData. + * + * @return a Boolean value. + */ + public Boolean getOEMCustomVehicleData(String vehicleDataName) { + return getBoolean(vehicleDataName); + } + + /** + * Sets the windowStatus. + * + * @param windowStatus See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public GetVehicleData setWindowStatus(Boolean windowStatus) { + setParameters(KEY_WINDOW_STATUS, windowStatus); + return this; + } + + /** + * Gets the windowStatus. + * + * @return Boolean See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getWindowStatus() { + return getBoolean(KEY_WINDOW_STATUS); + } + + /** + * Sets the handsOffSteering. + * + * @param handsOffSteering To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public GetVehicleData setHandsOffSteering(Boolean handsOffSteering) { + setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering); + return this; + } + + /** + * Gets the handsOffSteering. + * + * @return Boolean To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getHandsOffSteering() { + return getBoolean(KEY_HANDS_OFF_STEERING); + } + + /** + * Sets the gearStatus. + * + * @param gearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public GetVehicleData setGearStatus(Boolean gearStatus) { + setParameters(KEY_GEAR_STATUS, gearStatus); + return this; + } + + /** + * Gets the gearStatus. + * + * @return GearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getGearStatus() { + return getBoolean(KEY_GEAR_STATUS); + } + + /** + * Sets the stabilityControlsStatus. + * + * @param stabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public GetVehicleData setStabilityControlsStatus(Boolean stabilityControlsStatus) { + setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus); + return this; + } + + /** + * Gets the stabilityControlsStatus. + * + * @return Boolean See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getStabilityControlsStatus() { + return getBoolean(KEY_STABILITY_CONTROLS_STATUS); + } + + /** + * Sets the seatOccupancy. + * + * @param seatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public GetVehicleData setSeatOccupancy(Boolean seatOccupancy) { + setParameters(KEY_SEAT_OCCUPANCY, seatOccupancy); + return this; + } + + /** + * Gets the seatOccupancy. + * + * @return Boolean See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public Boolean getSeatOccupancy() { + return getBoolean(KEY_SEAT_OCCUPANCY); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java index 1ce840819..558ab51c9 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java @@ -1,597 +1,620 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc;
-
-
-import androidx.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PRNDL;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Get Vehicle Data Response is sent, when GetVehicleData has been called.
- *
- * @since SmartDeviceLink 2.0
- */
-public class GetVehicleDataResponse extends RPCResponse {
- public static final String KEY_GPS = "gps";
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_VIN = "vin";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
- public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_WINDOW_STATUS = "windowStatus";
- public static final String KEY_GEAR_STATUS = "gearStatus";
- public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
- public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
-
- /**
- * Constructs a new GetVehicleDataResponse object
- */
-
- public GetVehicleDataResponse() {
- super(FunctionID.GET_VEHICLE_DATA.toString());
- }
-
- public GetVehicleDataResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new GetVehicleDataResponse object
- *
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public GetVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- public GetVehicleDataResponse setGps(GPSData gps) {
- setParameters(KEY_GPS, gps);
- return this;
- }
-
- public GPSData getGps() {
- return (GPSData) getObject(GPSData.class, KEY_GPS);
- }
-
- public GetVehicleDataResponse setSpeed(Double speed) {
- setParameters(KEY_SPEED, speed);
- return this;
- }
-
- public Double getSpeed() {
- Object object = getParameters(KEY_SPEED);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public GetVehicleDataResponse setRpm(Integer rpm) {
- setParameters(KEY_RPM, rpm);
- return this;
- }
-
- public Integer getRpm() {
- return getInteger(KEY_RPM);
- }
-
- /**
- * Sets Fuel Level State
- *
- * @param fuelLevelState a ComponentVolumeStatus related to FuelLevel State
- */
- @Deprecated
- public GetVehicleDataResponse setFuelLevelState(ComponentVolumeStatus fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- return this;
- }
-
- /**
- * Gets Fuel Level State
- *
- * @return a ComponentVolumeStatus related to FuelLevel State
- */
- @Deprecated
- public ComponentVolumeStatus getFuelLevelState() {
- return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE);
- }
-
- /**
- * Sets the fuelLevel.
- *
- * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- * @since SmartDeviceLink 7.0.0
- */
- @Deprecated
- public GetVehicleDataResponse setFuelLevel(Double fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- return this;
- }
-
- /**
- * Gets the fuelLevel.
- *
- * @return Double The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- * @since SmartDeviceLink 7.0.0
- */
- @Deprecated
- public Double getFuelLevel() {
- Object object = getParameters(KEY_FUEL_LEVEL);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public GetVehicleDataResponse setInstantFuelConsumption(Double instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- return this;
- }
-
- public Double getInstantFuelConsumption() {
- Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public GetVehicleDataResponse setExternalTemperature(Double externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- return this;
- }
-
- public Double getExternalTemperature() {
- Object object = getParameters(KEY_EXTERNAL_TEMPERATURE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public GetVehicleDataResponse setVin(String vin) {
- setParameters(KEY_VIN, vin);
- return this;
- }
-
- public String getVin() {
- return getString(KEY_VIN);
- }
-
- /**
- * Sets the prndl.
- *
- * @param prndl See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public GetVehicleDataResponse setPrndl(PRNDL prndl) {
- setParameters(KEY_PRNDL, prndl);
- return this;
- }
-
- /**
- * Gets the prndl.
- *
- * @return PRNDL See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public PRNDL getPrndl() {
- return (PRNDL) getObject(PRNDL.class, KEY_PRNDL);
- }
-
- public GetVehicleDataResponse setTirePressure(TireStatus tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- return this;
- }
-
- public TireStatus getTirePressure() {
- return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE);
- }
-
- public GetVehicleDataResponse setOdometer(Integer odometer) {
- setParameters(KEY_ODOMETER, odometer);
- return this;
- }
-
- public Integer getOdometer() {
- return getInteger(KEY_ODOMETER);
- }
-
- public GetVehicleDataResponse setBeltStatus(BeltStatus beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- return this;
- }
-
- public BeltStatus getBeltStatus() {
- return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS);
- }
-
- public GetVehicleDataResponse setBodyInformation(BodyInformation bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- return this;
- }
-
- public BodyInformation getBodyInformation() {
- return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION);
- }
-
- public GetVehicleDataResponse setDeviceStatus(DeviceStatus deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- return this;
- }
-
- public DeviceStatus getDeviceStatus() {
- return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS);
- }
-
- public GetVehicleDataResponse setDriverBraking(VehicleDataEventStatus driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- return this;
- }
-
- public VehicleDataEventStatus getDriverBraking() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING);
- }
-
- public GetVehicleDataResponse setWiperStatus(WiperStatus wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- return this;
- }
-
- public WiperStatus getWiperStatus() {
- return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS);
- }
-
- public GetVehicleDataResponse setHeadLampStatus(HeadLampStatus headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- return this;
- }
-
- public HeadLampStatus getHeadLampStatus() {
- return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS);
- }
-
- public GetVehicleDataResponse setEngineTorque(Double engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- return this;
- }
-
- public Double getEngineTorque() {
- Object object = getParameters(KEY_ENGINE_TORQUE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public GetVehicleDataResponse setEngineOilLife(Float engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- return this;
- }
-
- public Float getEngineOilLife() {
- Object object = getParameters(KEY_ENGINE_OIL_LIFE);
- return SdlDataTypeConverter.objectToFloat(object);
- }
-
- public GetVehicleDataResponse setAccPedalPosition(Double accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- return this;
- }
-
- public Double getAccPedalPosition() {
- Object object = getParameters(KEY_ACC_PEDAL_POSITION);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public GetVehicleDataResponse setSteeringWheelAngle(Double steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- return this;
- }
-
- public Double getSteeringWheelAngle() {
- Object object = getParameters(KEY_STEERING_WHEEL_ANGLE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public GetVehicleDataResponse setECallInfo(ECallInfo eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- return this;
- }
-
- public ECallInfo getECallInfo() {
- return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO);
- }
-
- public GetVehicleDataResponse setAirbagStatus(AirbagStatus airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- return this;
- }
-
- public AirbagStatus getAirbagStatus() {
- return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS);
- }
-
- public GetVehicleDataResponse setEmergencyEvent(EmergencyEvent emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- return this;
- }
-
- public EmergencyEvent getEmergencyEvent() {
- return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT);
- }
-
- public GetVehicleDataResponse setClusterModeStatus(ClusterModeStatus clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- return this;
- }
-
- public ClusterModeStatus getClusterModeStatus() {
- return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS);
- }
-
- public GetVehicleDataResponse setMyKey(MyKey myKey) {
- setParameters(KEY_MY_KEY, myKey);
- return this;
- }
-
- public MyKey getMyKey() {
- return (MyKey) getObject(MyKey.class, KEY_MY_KEY);
- }
-
- /**
- * Sets Fuel Range List. Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
- *
- * @param fuelRange the range in KM left as well as fuel type
- * @see FuelRange
- * @see com.smartdevicelink.proxy.rpc.enums.FuelType
- */
- public GetVehicleDataResponse setFuelRange(List<FuelRange> fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- return this;
- }
-
- /**
- * Gets Fuel Range List
- *
- * @return List<FuelRange>
- * Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
- */
- @SuppressWarnings("unchecked")
- public List<FuelRange> getFuelRange() {
- return (List<FuelRange>) getObject(FuelRange.class, KEY_FUEL_RANGE);
- }
-
- /**
- * Sets turnSignal
- *
- * @param turnSignal status of the turn signals
- * @see TurnSignal
- */
- public GetVehicleDataResponse setTurnSignal(TurnSignal turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- return this;
- }
-
- /**
- * Gets turnSignal
- *
- * @return TurnSignal status of the turn signals
- * @see com.smartdevicelink.proxy.rpc.enums.TurnSignal
- */
- public TurnSignal getTurnSignal() {
- return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets electronicParkBrakeStatus
- *
- * @param electronicParkBrakeStatus status of the electronic park brake of the connected vehicle
- * @see ElectronicParkBrakeStatus
- */
- public GetVehicleDataResponse setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus) {
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- return this;
- }
-
- /**
- * Gets electronicParkBrakeStatus
- *
- * @return ElectronicParkBrakeStatus status of the electronic park brake of the connected vehicle
- * @see com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus
- */
- public ElectronicParkBrakeStatus getElectronicParkBrakeStatus() {
- return (ElectronicParkBrakeStatus) getObject(ElectronicParkBrakeStatus.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-
- /**
- * Sets a string value for the cloud app vehicle ID
- *
- * @param cloudAppVehicleID a string value
- */
- public GetVehicleDataResponse setCloudAppVehicleID(String cloudAppVehicleID) {
- setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
- return this;
- }
-
- /**
- * Gets a String value of the returned cloud app vehicle ID
- *
- * @return a String value.
- */
- public String getCloudAppVehicleID() {
- return getString(KEY_CLOUD_APP_VEHICLE_ID);
- }
-
-
- /**
- * Sets a value for OEM Custom VehicleData.
- *
- * @param vehicleDataName a String value
- * @param vehicleDataState a VehicleDataResult value
- */
- public GetVehicleDataResponse setOEMCustomVehicleData(String vehicleDataName, Object vehicleDataState) {
- setParameters(vehicleDataName, vehicleDataState);
- return this;
- }
-
- /**
- * Gets a VehicleData value for the vehicle data item.
- *
- * @return a Object related to the vehicle data
- */
- public Object getOEMCustomVehicleData(String vehicleDataName) {
- return getParameters(vehicleDataName);
- }
-
- /**
- * Sets the windowStatus.
- *
- * @param windowStatus See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public GetVehicleDataResponse setWindowStatus(List<WindowStatus> windowStatus) {
- setParameters(KEY_WINDOW_STATUS, windowStatus);
- return this;
- }
-
- /**
- * Gets the windowStatus.
- *
- * @return List<WindowStatus> See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- @SuppressWarnings("unchecked")
- public List<WindowStatus> getWindowStatus() {
- return (List<WindowStatus>) getObject(WindowStatus.class, KEY_WINDOW_STATUS);
- }
-
- /**
- * Sets the handsOffSteering.
- *
- * @param handsOffSteering To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public GetVehicleDataResponse setHandsOffSteering(Boolean handsOffSteering) {
- setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
- return this;
- }
-
- /**
- * Gets the handsOffSteering.
- *
- * @return Boolean To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getHandsOffSteering() {
- return getBoolean(KEY_HANDS_OFF_STEERING);
- }
-
- /**
- * Sets the gearStatus.
- *
- * @param gearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public GetVehicleDataResponse setGearStatus(GearStatus gearStatus) {
- setParameters(KEY_GEAR_STATUS, gearStatus);
- return this;
- }
-
- /**
- * Gets the gearStatus.
- *
- * @return GearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public GearStatus getGearStatus() {
- return (GearStatus) getObject(GearStatus.class, KEY_GEAR_STATUS);
- }
-
- /**
- * Gets the stabilityControlsStatus.
- *
- * @return StabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public StabilityControlsStatus getStabilityControlsStatus() {
- return (StabilityControlsStatus) getObject(StabilityControlsStatus.class, KEY_STABILITY_CONTROLS_STATUS);
- }
-
- /**
- * Sets the stabilityControlsStatus.
- *
- * @param stabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public GetVehicleDataResponse setStabilityControlsStatus(StabilityControlsStatus stabilityControlsStatus) {
- setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
- return this;
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc; + + +import androidx.annotation.NonNull; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCResponse; +import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus; +import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus; +import com.smartdevicelink.proxy.rpc.enums.PRNDL; +import com.smartdevicelink.proxy.rpc.enums.Result; +import com.smartdevicelink.proxy.rpc.enums.TurnSignal; +import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus; +import com.smartdevicelink.proxy.rpc.enums.WiperStatus; +import com.smartdevicelink.util.SdlDataTypeConverter; + +import java.util.Hashtable; +import java.util.List; + +/** + * Get Vehicle Data Response is sent, when GetVehicleData has been called. + * + * @since SmartDeviceLink 2.0 + */ +public class GetVehicleDataResponse extends RPCResponse { + public static final String KEY_GPS = "gps"; + public static final String KEY_SPEED = "speed"; + public static final String KEY_RPM = "rpm"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL = "fuelLevel"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State"; + public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption"; + public static final String KEY_FUEL_RANGE = "fuelRange"; + public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature"; + public static final String KEY_TURN_SIGNAL = "turnSignal"; + public static final String KEY_VIN = "vin"; + public static final String KEY_PRNDL = "prndl"; + public static final String KEY_TIRE_PRESSURE = "tirePressure"; + public static final String KEY_ODOMETER = "odometer"; + public static final String KEY_BELT_STATUS = "beltStatus"; + public static final String KEY_BODY_INFORMATION = "bodyInformation"; + public static final String KEY_DEVICE_STATUS = "deviceStatus"; + public static final String KEY_DRIVER_BRAKING = "driverBraking"; + public static final String KEY_WIPER_STATUS = "wiperStatus"; + public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus"; + public static final String KEY_ENGINE_TORQUE = "engineTorque"; + public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition"; + public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle"; + public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife"; + public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus"; + public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID"; + public static final String KEY_E_CALL_INFO = "eCallInfo"; + public static final String KEY_AIRBAG_STATUS = "airbagStatus"; + public static final String KEY_EMERGENCY_EVENT = "emergencyEvent"; + public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus"; + public static final String KEY_MY_KEY = "myKey"; + public static final String KEY_WINDOW_STATUS = "windowStatus"; + public static final String KEY_GEAR_STATUS = "gearStatus"; + public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering"; + public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus"; + /** + * @since SmartDeviceLink 7.1.0 + */ + public static final String KEY_SEAT_OCCUPANCY = "seatOccupancy"; + /** + * Constructs a new GetVehicleDataResponse object + */ + + public GetVehicleDataResponse() { + super(FunctionID.GET_VEHICLE_DATA.toString()); + } + + public GetVehicleDataResponse(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a new GetVehicleDataResponse object + * + * @param success whether the request is successfully processed + * @param resultCode whether the request is successfully processed + */ + public GetVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) { + this(); + setSuccess(success); + setResultCode(resultCode); + } + + public GetVehicleDataResponse setGps(GPSData gps) { + setParameters(KEY_GPS, gps); + return this; + } + + public GPSData getGps() { + return (GPSData) getObject(GPSData.class, KEY_GPS); + } + + public GetVehicleDataResponse setSpeed(Double speed) { + setParameters(KEY_SPEED, speed); + return this; + } + + public Double getSpeed() { + Object object = getParameters(KEY_SPEED); + return SdlDataTypeConverter.objectToDouble(object); + } + + public GetVehicleDataResponse setRpm(Integer rpm) { + setParameters(KEY_RPM, rpm); + return this; + } + + public Integer getRpm() { + return getInteger(KEY_RPM); + } + + /** + * Sets Fuel Level State + * + * @param fuelLevelState a ComponentVolumeStatus related to FuelLevel State + */ + @Deprecated + public GetVehicleDataResponse setFuelLevelState(ComponentVolumeStatus fuelLevelState) { + setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState); + return this; + } + + /** + * Gets Fuel Level State + * + * @return a ComponentVolumeStatus related to FuelLevel State + */ + @Deprecated + public ComponentVolumeStatus getFuelLevelState() { + return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE); + } + + /** + * Sets the fuelLevel. + * + * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + * @since SmartDeviceLink 7.0.0 + */ + @Deprecated + public GetVehicleDataResponse setFuelLevel(Double fuelLevel) { + setParameters(KEY_FUEL_LEVEL, fuelLevel); + return this; + } + + /** + * Gets the fuelLevel. + * + * @return Double The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + * @since SmartDeviceLink 7.0.0 + */ + @Deprecated + public Double getFuelLevel() { + Object object = getParameters(KEY_FUEL_LEVEL); + return SdlDataTypeConverter.objectToDouble(object); + } + + public GetVehicleDataResponse setInstantFuelConsumption(Double instantFuelConsumption) { + setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption); + return this; + } + + public Double getInstantFuelConsumption() { + Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION); + return SdlDataTypeConverter.objectToDouble(object); + } + + public GetVehicleDataResponse setExternalTemperature(Double externalTemperature) { + setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature); + return this; + } + + public Double getExternalTemperature() { + Object object = getParameters(KEY_EXTERNAL_TEMPERATURE); + return SdlDataTypeConverter.objectToDouble(object); + } + + public GetVehicleDataResponse setVin(String vin) { + setParameters(KEY_VIN, vin); + return this; + } + + public String getVin() { + return getString(KEY_VIN); + } + + /** + * Sets the prndl. + * + * @param prndl See PRNDL. This parameter is deprecated and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public GetVehicleDataResponse setPrndl(PRNDL prndl) { + setParameters(KEY_PRNDL, prndl); + return this; + } + + /** + * Gets the prndl. + * + * @return PRNDL See PRNDL. This parameter is deprecated and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public PRNDL getPrndl() { + return (PRNDL) getObject(PRNDL.class, KEY_PRNDL); + } + + public GetVehicleDataResponse setTirePressure(TireStatus tirePressure) { + setParameters(KEY_TIRE_PRESSURE, tirePressure); + return this; + } + + public TireStatus getTirePressure() { + return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE); + } + + public GetVehicleDataResponse setOdometer(Integer odometer) { + setParameters(KEY_ODOMETER, odometer); + return this; + } + + public Integer getOdometer() { + return getInteger(KEY_ODOMETER); + } + + public GetVehicleDataResponse setBeltStatus(BeltStatus beltStatus) { + setParameters(KEY_BELT_STATUS, beltStatus); + return this; + } + + public BeltStatus getBeltStatus() { + return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS); + } + + public GetVehicleDataResponse setBodyInformation(BodyInformation bodyInformation) { + setParameters(KEY_BODY_INFORMATION, bodyInformation); + return this; + } + + public BodyInformation getBodyInformation() { + return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION); + } + + public GetVehicleDataResponse setDeviceStatus(DeviceStatus deviceStatus) { + setParameters(KEY_DEVICE_STATUS, deviceStatus); + return this; + } + + public DeviceStatus getDeviceStatus() { + return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS); + } + + public GetVehicleDataResponse setDriverBraking(VehicleDataEventStatus driverBraking) { + setParameters(KEY_DRIVER_BRAKING, driverBraking); + return this; + } + + public VehicleDataEventStatus getDriverBraking() { + return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING); + } + + public GetVehicleDataResponse setWiperStatus(WiperStatus wiperStatus) { + setParameters(KEY_WIPER_STATUS, wiperStatus); + return this; + } + + public WiperStatus getWiperStatus() { + return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS); + } + + public GetVehicleDataResponse setHeadLampStatus(HeadLampStatus headLampStatus) { + setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus); + return this; + } + + public HeadLampStatus getHeadLampStatus() { + return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS); + } + + public GetVehicleDataResponse setEngineTorque(Double engineTorque) { + setParameters(KEY_ENGINE_TORQUE, engineTorque); + return this; + } + + public Double getEngineTorque() { + Object object = getParameters(KEY_ENGINE_TORQUE); + return SdlDataTypeConverter.objectToDouble(object); + } + + public GetVehicleDataResponse setEngineOilLife(Float engineOilLife) { + setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife); + return this; + } + + public Float getEngineOilLife() { + Object object = getParameters(KEY_ENGINE_OIL_LIFE); + return SdlDataTypeConverter.objectToFloat(object); + } + + public GetVehicleDataResponse setAccPedalPosition(Double accPedalPosition) { + setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition); + return this; + } + + public Double getAccPedalPosition() { + Object object = getParameters(KEY_ACC_PEDAL_POSITION); + return SdlDataTypeConverter.objectToDouble(object); + } + + public GetVehicleDataResponse setSteeringWheelAngle(Double steeringWheelAngle) { + setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle); + return this; + } + + public Double getSteeringWheelAngle() { + Object object = getParameters(KEY_STEERING_WHEEL_ANGLE); + return SdlDataTypeConverter.objectToDouble(object); + } + + public GetVehicleDataResponse setECallInfo(ECallInfo eCallInfo) { + setParameters(KEY_E_CALL_INFO, eCallInfo); + return this; + } + + public ECallInfo getECallInfo() { + return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO); + } + + public GetVehicleDataResponse setAirbagStatus(AirbagStatus airbagStatus) { + setParameters(KEY_AIRBAG_STATUS, airbagStatus); + return this; + } + + public AirbagStatus getAirbagStatus() { + return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS); + } + + public GetVehicleDataResponse setEmergencyEvent(EmergencyEvent emergencyEvent) { + setParameters(KEY_EMERGENCY_EVENT, emergencyEvent); + return this; + } + + public EmergencyEvent getEmergencyEvent() { + return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT); + } + + public GetVehicleDataResponse setClusterModeStatus(ClusterModeStatus clusterModeStatus) { + setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus); + return this; + } + + public ClusterModeStatus getClusterModeStatus() { + return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS); + } + + public GetVehicleDataResponse setMyKey(MyKey myKey) { + setParameters(KEY_MY_KEY, myKey); + return this; + } + + public MyKey getMyKey() { + return (MyKey) getObject(MyKey.class, KEY_MY_KEY); + } + + /** + * Sets Fuel Range List. Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption. + * + * @param fuelRange the range in KM left as well as fuel type + * @see FuelRange + * @see com.smartdevicelink.proxy.rpc.enums.FuelType + */ + public GetVehicleDataResponse setFuelRange(List<FuelRange> fuelRange) { + setParameters(KEY_FUEL_RANGE, fuelRange); + return this; + } + + /** + * Gets Fuel Range List + * + * @return List<FuelRange> + * Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption. + */ + @SuppressWarnings("unchecked") + public List<FuelRange> getFuelRange() { + return (List<FuelRange>) getObject(FuelRange.class, KEY_FUEL_RANGE); + } + + /** + * Sets turnSignal + * + * @param turnSignal status of the turn signals + * @see TurnSignal + */ + public GetVehicleDataResponse setTurnSignal(TurnSignal turnSignal) { + setParameters(KEY_TURN_SIGNAL, turnSignal); + return this; + } + + /** + * Gets turnSignal + * + * @return TurnSignal status of the turn signals + * @see com.smartdevicelink.proxy.rpc.enums.TurnSignal + */ + public TurnSignal getTurnSignal() { + return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL); + } + + /** + * Sets electronicParkBrakeStatus + * + * @param electronicParkBrakeStatus status of the electronic park brake of the connected vehicle + * @see ElectronicParkBrakeStatus + */ + public GetVehicleDataResponse setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus) { + setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); + return this; + } + + /** + * Gets electronicParkBrakeStatus + * + * @return ElectronicParkBrakeStatus status of the electronic park brake of the connected vehicle + * @see com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus + */ + public ElectronicParkBrakeStatus getElectronicParkBrakeStatus() { + return (ElectronicParkBrakeStatus) getObject(ElectronicParkBrakeStatus.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS); + } + + /** + * Sets a string value for the cloud app vehicle ID + * + * @param cloudAppVehicleID a string value + */ + public GetVehicleDataResponse setCloudAppVehicleID(String cloudAppVehicleID) { + setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID); + return this; + } + + /** + * Gets a String value of the returned cloud app vehicle ID + * + * @return a String value. + */ + public String getCloudAppVehicleID() { + return getString(KEY_CLOUD_APP_VEHICLE_ID); + } + + + /** + * Sets a value for OEM Custom VehicleData. + * + * @param vehicleDataName a String value + * @param vehicleDataState a VehicleDataResult value + */ + public GetVehicleDataResponse setOEMCustomVehicleData(String vehicleDataName, Object vehicleDataState) { + setParameters(vehicleDataName, vehicleDataState); + return this; + } + + /** + * Gets a VehicleData value for the vehicle data item. + * + * @return a Object related to the vehicle data + */ + public Object getOEMCustomVehicleData(String vehicleDataName) { + return getParameters(vehicleDataName); + } + + /** + * Sets the windowStatus. + * + * @param windowStatus See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public GetVehicleDataResponse setWindowStatus(List<WindowStatus> windowStatus) { + setParameters(KEY_WINDOW_STATUS, windowStatus); + return this; + } + + /** + * Gets the windowStatus. + * + * @return List<WindowStatus> See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + @SuppressWarnings("unchecked") + public List<WindowStatus> getWindowStatus() { + return (List<WindowStatus>) getObject(WindowStatus.class, KEY_WINDOW_STATUS); + } + + /** + * Sets the handsOffSteering. + * + * @param handsOffSteering To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public GetVehicleDataResponse setHandsOffSteering(Boolean handsOffSteering) { + setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering); + return this; + } + + /** + * Gets the handsOffSteering. + * + * @return Boolean To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getHandsOffSteering() { + return getBoolean(KEY_HANDS_OFF_STEERING); + } + + /** + * Sets the gearStatus. + * + * @param gearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public GetVehicleDataResponse setGearStatus(GearStatus gearStatus) { + setParameters(KEY_GEAR_STATUS, gearStatus); + return this; + } + + /** + * Gets the gearStatus. + * + * @return GearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public GearStatus getGearStatus() { + return (GearStatus) getObject(GearStatus.class, KEY_GEAR_STATUS); + } + + /** + * Gets the stabilityControlsStatus. + * + * @return StabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public StabilityControlsStatus getStabilityControlsStatus() { + return (StabilityControlsStatus) getObject(StabilityControlsStatus.class, KEY_STABILITY_CONTROLS_STATUS); + } + + /** + * Sets the stabilityControlsStatus. + * + * @param stabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public GetVehicleDataResponse setStabilityControlsStatus(StabilityControlsStatus stabilityControlsStatus) { + setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus); + return this; + } + /** + * Sets the seatOccupancy. + * + * @param seatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public GetVehicleDataResponse setSeatOccupancy(SeatOccupancy seatOccupancy) { + setParameters(KEY_SEAT_OCCUPANCY, seatOccupancy); + return this; + } + + /** + * Gets the seatOccupancy. + * + * @return SeatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public SeatOccupancy getSeatOccupancy() { + return (SeatOccupancy) getObject(SeatOccupancy.class, KEY_SEAT_OCCUPANCY); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java index e8f5b57ca..3a904e93b 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java @@ -1,852 +1,885 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
-import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus;
-import com.smartdevicelink.proxy.rpc.enums.PRNDL;
-import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
-import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
-import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
-import com.smartdevicelink.util.SdlDataTypeConverter;
-
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Individual requested DID result and data.
- *
- *
- * <p>Callback for the periodic and non periodic vehicle data read function.</p>
- *
- * <p> <b>Note:</b></p>
- * <p>
- * Initially SDL sends SubscribeVehicleData for getting the periodic updates from HMI whenever each of subscribed data types changes. OnVehicleData is expected to bring such updated values to SDL
- *
- *
- *
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th> Req.</th>
- * <th>Notes</th>
- * <th>Version Available</th>
- * </tr>
- * <tr>
- * <td>Gps</td>
- * <td>Boolean</td>
- * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData} for details</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>Speed</td>
- * <td>Float</td>
- * <td>The vehicle speed in kilometers per hour</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>rpm</td>
- * <td>Integer</td>
- * <td>The number of revolutions per minute of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel</td>
- * <td>Boolean</td>
- * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel_State</td>
- * <td>Boolean</td>
- * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>fuelRange</td>
- * <td>Boolean</td>
- * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td>
- * <td>N</td>
- * <td>{"array_min_size": 0, "array_max_size": 100}</td>
- * <td>SmartDeviceLink 5.0.0</td>
- * </tr>
- * <tr>
- * <td>instantFuelConsumption</td>
- * <td>Float</td>
- * <td>The instantaneous fuel consumption in micro litres</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>externalTemperature</td>
- * <td>Float</td>
- * <td>The external temperature in degrees celsius.</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>vin</td>
- * <td>String</td>
- * <td>Vehicle identification number.</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>gearStatus</td>
- * <td>GearStatus</td>
- * <td>See GearStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>gearStatus</td>
- * <td>GearStatus</td>
- * <td>See GearStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>prndl</td>
- * <td>PRNDL</td>
- * <td>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>tirePressure</td>
- * <td>TireStatus</td>
- * <td>Tire pressure status</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>odometer</td>
- * <td>Integer</td>
- * <td>Odometer in km</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>beltStatus</td>
- * <td>BeltStatus</td>
- * <td>The status of the seat belts.</td>
- * <td>N</td>
- * <td>Subscribable </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>bodyInformation</td>
- * <td>BodyInformation</td>
- * <td>The body information including power modes.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>deviceStatus</td>
- * <td>DeviceStatus</td>
- * <td>The connected mobile device status including signal and battery strength.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>eCallInfo</td>
- * <td>ECallInfo</td>
- * <td>Emergency Call notification and confirmation data.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>airbagStatus</td>
- * <td>AirBagStatus</td>
- * <td>The status of the air bags.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>emergencyEvent</td>
- * <td>EmergencyEvent</td>
- * <td>Information related to an emergency event (and if it occurred).</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>clusterModeStatus</td>
- * <td>ClusterModeStatus</td>
- * <td>The status modes of the instrument panel cluster.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>myKey</td>
- * <td>MyKey</td>
- * <td>Information related to the MyKey feature.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- *
- * <tr>
- * <td>driverBraking</td>
- * <td>vehicleDataEventStatus</td>
- * <td>The status of the brake pedal.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>wiperStatus</td>
- * <td>WiperStatus</td>
- * <td>The status of the wipers</td>
- * <td>N</td>
- * <td> </td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>headLampStatus</td>
- * <td>headLampStatus</td>
- * <td>Status of the head lamps</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>engineTorque</td>
- * <td>Float</td>
- * <td>Torque value for engine (in Nm) on non-diesel variants</td>
- * <td>N</td>
- * <td>minvalue:-1000; maxvalue:2000</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>engineOilLife</td>
- * <td>Float</td>
- * <td>The estimated percentage of remaining oil life of the engine</td>
- * <td>N</td>
- * <td>minvalue:0; maxvalue:100</td>
- * <td>SmartDeviceLink 5.0</td>
- * </tr>
- * <tr>
- * <td>accPedalPosition</td>
- * <td>Float</td>
- * <td>Accelerator pedal position (percentage depressed)</td>
- * <td>N</td>
- * <td>minvalue: 0; maxvalue:100</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>steeringWheelAngle</td>
- * <td>Float</td>
- * <td>Current angle of the steering wheel (in deg)</td>
- * <td>N</td>
- * <td> minvalue: -2000; maxvalue:2000</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>cloudAppVehicleID</td>
- * <td>String</td>
- * <td>ID for the vehicle when connecting to cloud applications</td>
- * <td>N</td>
- * <td></td>
- * <td>SmartDeviceLink 5.1 </td>
- * </tr>
- * <tr>
- * <td>handsOffSteering</td>
- * <td>Boolean</td>
- * <td>To indicate whether driver hands are off the steering wheel</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>windowStatus</td>
- * <td>Boolean</td>
- * <td>See WindowStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>stabilityControlsStatus</td>
- * <td>StabilityControlsStatus</td>
- * <td>See StabilityControlsStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * </table>
- *
- * @see SubscribeVehicleData
- * @see UnsubscribeVehicleData
- * @since SmartDeviceLink 1.0
- */
-public class OnVehicleData extends RPCNotification {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_VIN = "vin";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
- public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
- public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
- public static final String KEY_WINDOW_STATUS = "windowStatus";
- public static final String KEY_GEAR_STATUS = "gearStatus";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
-
- public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
-
- public OnVehicleData() {
- super(FunctionID.ON_VEHICLE_DATA.toString());
- }
-
- public OnVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- public OnVehicleData setGps(GPSData gps) {
- setParameters(KEY_GPS, gps);
- return this;
- }
-
- public GPSData getGps() {
- return (GPSData) getObject(GPSData.class, KEY_GPS);
- }
-
- public OnVehicleData setSpeed(Double speed) {
- setParameters(KEY_SPEED, speed);
- return this;
- }
-
- public Double getSpeed() {
- Object object = getParameters(KEY_SPEED);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public OnVehicleData setRpm(Integer rpm) {
- setParameters(KEY_RPM, rpm);
- return this;
- }
-
- public Integer getRpm() {
- return getInteger(KEY_RPM);
- }
-
- /**
- * Sets the fuelLevel.
- *
- * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public OnVehicleData setFuelLevel(Double fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- return this;
- }
-
- /**
- * Gets the fuelLevel.
- *
- * @return Float The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public Double getFuelLevel() {
- Object object = getParameters(KEY_FUEL_LEVEL);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- @Deprecated
- public OnVehicleData setFuelLevelState(ComponentVolumeStatus fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- return this;
- }
-
- @Deprecated
- public ComponentVolumeStatus getFuelLevelState() {
- return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE);
- }
-
- public OnVehicleData setInstantFuelConsumption(Double instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- return this;
- }
-
- public Double getInstantFuelConsumption() {
- Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public OnVehicleData setExternalTemperature(Double externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- return this;
- }
-
- public Double getExternalTemperature() {
- Object object = getParameters(KEY_EXTERNAL_TEMPERATURE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public OnVehicleData setVin(String vin) {
- setParameters(KEY_VIN, vin);
- return this;
- }
-
- public String getVin() {
- return getString(KEY_VIN);
- }
-
- /**
- * Sets the prndl.
- *
- * @param prndl See PRNDL. This parameter is deprecated since 7.0.0 and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public OnVehicleData setPrndl(PRNDL prndl) {
- setParameters(KEY_PRNDL, prndl);
- return this;
- }
-
- /**
- * Gets the prndl.
- *
- * @return PRNDL See PRNDL. This parameter since 7.0.0 is deprecated and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public PRNDL getPrndl() {
- return (PRNDL) getObject(PRNDL.class, KEY_PRNDL);
- }
-
- /**
- * Sets the tirePressure.
- *
- * @param tirePressure See TireStatus
- */
- public OnVehicleData setTirePressure(TireStatus tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- return this;
- }
-
- public TireStatus getTirePressure() {
- return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE);
- }
-
- public OnVehicleData setOdometer(Integer odometer) {
- setParameters(KEY_ODOMETER, odometer);
- return this;
- }
-
- public Integer getOdometer() {
- return getInteger(KEY_ODOMETER);
- }
-
- public OnVehicleData setBeltStatus(BeltStatus beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- return this;
- }
-
- public BeltStatus getBeltStatus() {
- return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS);
- }
-
- public OnVehicleData setBodyInformation(BodyInformation bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- return this;
- }
-
- public BodyInformation getBodyInformation() {
- return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION);
- }
-
- public OnVehicleData setDeviceStatus(DeviceStatus deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- return this;
- }
-
- public DeviceStatus getDeviceStatus() {
- return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS);
- }
-
- public OnVehicleData setDriverBraking(VehicleDataEventStatus driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- return this;
- }
-
- public VehicleDataEventStatus getDriverBraking() {
- return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING);
- }
-
- public OnVehicleData setWiperStatus(WiperStatus wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- return this;
- }
-
- public WiperStatus getWiperStatus() {
- return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS);
- }
-
- public OnVehicleData setHeadLampStatus(HeadLampStatus headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- return this;
- }
-
- public HeadLampStatus getHeadLampStatus() {
- return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS);
- }
-
- public OnVehicleData setEngineTorque(Double engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- return this;
- }
-
- public Double getEngineTorque() {
- Object object = getParameters(KEY_ENGINE_TORQUE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public OnVehicleData setEngineOilLife(Float engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- return this;
- }
-
- public Float getEngineOilLife() {
- Object object = getParameters(KEY_ENGINE_OIL_LIFE);
- return SdlDataTypeConverter.objectToFloat(object);
- }
-
- public OnVehicleData setAccPedalPosition(Double accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- return this;
- }
-
- public Double getAccPedalPosition() {
- Object object = getParameters(KEY_ACC_PEDAL_POSITION);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public OnVehicleData setSteeringWheelAngle(Double steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- return this;
- }
-
- public Double getSteeringWheelAngle() {
- Object object = getParameters(KEY_STEERING_WHEEL_ANGLE);
- return SdlDataTypeConverter.objectToDouble(object);
- }
-
- public OnVehicleData setECallInfo(ECallInfo eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- return this;
- }
-
- public ECallInfo getECallInfo() {
- return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO);
- }
-
- public OnVehicleData setAirbagStatus(AirbagStatus airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- return this;
- }
-
- public AirbagStatus getAirbagStatus() {
- return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS);
- }
-
- public OnVehicleData setEmergencyEvent(EmergencyEvent emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- return this;
- }
-
- public EmergencyEvent getEmergencyEvent() {
- return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT);
- }
-
- public OnVehicleData setClusterModeStatus(ClusterModeStatus clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- return this;
- }
-
- public ClusterModeStatus getClusterModeStatus() {
- return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS);
- }
-
- public OnVehicleData setMyKey(MyKey myKey) {
- setParameters(KEY_MY_KEY, myKey);
- return this;
- }
-
- public MyKey getMyKey() {
- return (MyKey) getObject(MyKey.class, KEY_MY_KEY);
- }
-
- /**
- * Sets the fuelRange.
- *
- * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * {"array_min_size": 0, "array_max_size": 100}
- * @since SmartDeviceLink 5.0.0
- */
- public OnVehicleData setFuelRange(List<FuelRange> fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- return this;
- }
-
- /**
- * Gets the fuelRange.
- *
- * @return List<FuelRange> The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * {"array_min_size": 0, "array_max_size": 100}
- * @since SmartDeviceLink 5.0.0
- */
- @SuppressWarnings("unchecked")
- public List<FuelRange> getFuelRange() {
- return (List<FuelRange>) getObject(FuelRange.class, KEY_FUEL_RANGE);
- }
-
- /**
- * Sets turnSignal
- *
- * @param turnSignal
- */
- public OnVehicleData setTurnSignal(TurnSignal turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- return this;
- }
-
- /**
- * Gets turnSignal
- *
- * @return TurnSignal
- */
- public TurnSignal getTurnSignal() {
- return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets electronicParkBrakeStatus
- *
- * @param electronicParkBrakeStatus
- */
- public OnVehicleData setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus) {
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- return this;
- }
-
- /**
- * Gets electronicParkBrakeStatus
- *
- * @return ElectronicParkBrakeStatus
- */
- public ElectronicParkBrakeStatus getElectronicParkBrakeStatus() {
- return (ElectronicParkBrakeStatus) getObject(ElectronicParkBrakeStatus.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-
- /**
- * Sets a string value for the cloud app vehicle ID
- *
- * @param cloudAppVehicleID a string value
- */
- public OnVehicleData setCloudAppVehicleID(String cloudAppVehicleID) {
- setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
- return this;
- }
-
- /**
- * Gets a String value of the returned cloud app vehicle ID
- *
- * @return a String value.
- */
- public String getCloudAppVehicleID() {
- return getString(KEY_CLOUD_APP_VEHICLE_ID);
- }
-
- /**
- * Sets a value for OEM Custom VehicleData.
- *
- * @param vehicleDataName a String value
- * @param vehicleDataState a VehicleDataResult value
- */
- public OnVehicleData setOEMCustomVehicleData(String vehicleDataName, Object vehicleDataState) {
- setParameters(vehicleDataName, vehicleDataState);
- return this;
- }
-
- /**
- * Gets a VehicleData value for the vehicle data item.
- *
- * @return a Object related to the vehicle data
- */
- public Object getOEMCustomVehicleData(String vehicleDataName) {
- return getParameters(vehicleDataName);
- }
-
- /**
- * Sets the windowStatus.
- *
- * @param windowStatus See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public OnVehicleData setWindowStatus(List<WindowStatus> windowStatus) {
- setParameters(KEY_WINDOW_STATUS, windowStatus);
- return this;
- }
-
- /**
- * Gets the windowStatus.
- *
- * @return List<WindowStatus> See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- @SuppressWarnings("unchecked")
- public List<WindowStatus> getWindowStatus() {
- return (List<WindowStatus>) getObject(WindowStatus.class, KEY_WINDOW_STATUS);
- }
-
- /**
- * Gets the stabilityControlsStatus.
- *
- * @return StabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public StabilityControlsStatus getStabilityControlsStatus() {
- return (StabilityControlsStatus) getObject(StabilityControlsStatus.class, KEY_STABILITY_CONTROLS_STATUS);
- }
-
- /**
- * Sets the stabilityControlsStatus.
- *
- * @param stabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public OnVehicleData setStabilityControlsStatus(StabilityControlsStatus stabilityControlsStatus) {
- setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
- return this;
- }
-
- /**
- * Sets the handsOffSteering.
- *
- * @param handsOffSteering To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public OnVehicleData setHandsOffSteering(Boolean handsOffSteering) {
- setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
- return this;
- }
-
- /**
- * Gets the handsOffSteering.
- *
- * @return Boolean To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getHandsOffSteering() {
- return getBoolean(KEY_HANDS_OFF_STEERING);
- }
-
- /**
- * Sets the gearStatus.
- *
- * @param gearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public OnVehicleData setGearStatus(GearStatus gearStatus) {
- setParameters(KEY_GEAR_STATUS, gearStatus);
- return this;
- }
-
- /**
- * Gets the gearStatus.
- *
- * @return GearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public GearStatus getGearStatus() {
- return (GearStatus) getObject(GearStatus.class, KEY_GEAR_STATUS);
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCNotification; +import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus; +import com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus; +import com.smartdevicelink.proxy.rpc.enums.PRNDL; +import com.smartdevicelink.proxy.rpc.enums.TurnSignal; +import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus; +import com.smartdevicelink.proxy.rpc.enums.WiperStatus; +import com.smartdevicelink.util.SdlDataTypeConverter; + +import java.util.Hashtable; +import java.util.List; + +/** + * Individual requested DID result and data. + * + * + * <p>Callback for the periodic and non periodic vehicle data read function.</p> + * + * <p> <b>Note:</b></p> + * <p> + * Initially SDL sends SubscribeVehicleData for getting the periodic updates from HMI whenever each of subscribed data types changes. OnVehicleData is expected to bring such updated values to SDL + * + * + * + * + * <p><b>Parameter List</b></p> + * <table border="1" rules="all"> + * <tr> + * <th>Param Name</th> + * <th>Type</th> + * <th>Description</th> + * <th> Req.</th> + * <th>Notes</th> + * <th>Version Available</th> + * </tr> + * <tr> + * <td>Gps</td> + * <td>Boolean</td> + * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData} for details</td> + * <td>N</td> + * <td>Subscribable </td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>Speed</td> + * <td>Float</td> + * <td>The vehicle speed in kilometers per hour</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>rpm</td> + * <td>Integer</td> + * <td>The number of revolutions per minute of the engine</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>fuelLevel</td> + * <td>Boolean</td> + * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>fuelLevel_State</td> + * <td>Boolean</td> + * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>fuelRange</td> + * <td>Boolean</td> + * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td> + * <td>N</td> + * <td>{"array_min_size": 0, "array_max_size": 100}</td> + * <td>SmartDeviceLink 5.0.0</td> + * </tr> + * <tr> + * <td>instantFuelConsumption</td> + * <td>Float</td> + * <td>The instantaneous fuel consumption in micro litres</td> + * <td>N</td> + * <td>Subscribable </td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>externalTemperature</td> + * <td>Float</td> + * <td>The external temperature in degrees celsius.</td> + * <td>N</td> + * <td>Subscribable </td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>vin</td> + * <td>String</td> + * <td>Vehicle identification number.</td> + * <td>N</td> + * <td>Subscribable </td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>gearStatus</td> + * <td>GearStatus</td> + * <td>See GearStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>gearStatus</td> + * <td>GearStatus</td> + * <td>See GearStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>prndl</td> + * <td>PRNDL</td> + * <td>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>tirePressure</td> + * <td>TireStatus</td> + * <td>Tire pressure status</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>odometer</td> + * <td>Integer</td> + * <td>Odometer in km</td> + * <td>N</td> + * <td>Subscribable </td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>beltStatus</td> + * <td>BeltStatus</td> + * <td>The status of the seat belts.</td> + * <td>N</td> + * <td>Subscribable </td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>bodyInformation</td> + * <td>BodyInformation</td> + * <td>The body information including power modes.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>deviceStatus</td> + * <td>DeviceStatus</td> + * <td>The connected mobile device status including signal and battery strength.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>eCallInfo</td> + * <td>ECallInfo</td> + * <td>Emergency Call notification and confirmation data.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>airbagStatus</td> + * <td>AirBagStatus</td> + * <td>The status of the air bags.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>emergencyEvent</td> + * <td>EmergencyEvent</td> + * <td>Information related to an emergency event (and if it occurred).</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>clusterModeStatus</td> + * <td>ClusterModeStatus</td> + * <td>The status modes of the instrument panel cluster.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>myKey</td> + * <td>MyKey</td> + * <td>Information related to the MyKey feature.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * + * <tr> + * <td>driverBraking</td> + * <td>vehicleDataEventStatus</td> + * <td>The status of the brake pedal.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>wiperStatus</td> + * <td>WiperStatus</td> + * <td>The status of the wipers</td> + * <td>N</td> + * <td> </td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>headLampStatus</td> + * <td>headLampStatus</td> + * <td>Status of the head lamps</td> + * <td>N</td> + * <td></td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>engineTorque</td> + * <td>Float</td> + * <td>Torque value for engine (in Nm) on non-diesel variants</td> + * <td>N</td> + * <td>minvalue:-1000; maxvalue:2000</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>engineOilLife</td> + * <td>Float</td> + * <td>The estimated percentage of remaining oil life of the engine</td> + * <td>N</td> + * <td>minvalue:0; maxvalue:100</td> + * <td>SmartDeviceLink 5.0</td> + * </tr> + * <tr> + * <td>accPedalPosition</td> + * <td>Float</td> + * <td>Accelerator pedal position (percentage depressed)</td> + * <td>N</td> + * <td>minvalue: 0; maxvalue:100</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>steeringWheelAngle</td> + * <td>Float</td> + * <td>Current angle of the steering wheel (in deg)</td> + * <td>N</td> + * <td> minvalue: -2000; maxvalue:2000</td> + * <td>SmartDeviceLink 2.0</td> + * </tr> + * <tr> + * <td>cloudAppVehicleID</td> + * <td>String</td> + * <td>ID for the vehicle when connecting to cloud applications</td> + * <td>N</td> + * <td></td> + * <td>SmartDeviceLink 5.1 </td> + * </tr> + * <tr> + * <td>handsOffSteering</td> + * <td>Boolean</td> + * <td>To indicate whether driver hands are off the steering wheel</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>windowStatus</td> + * <td>Boolean</td> + * <td>See WindowStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>stabilityControlsStatus</td> + * <td>StabilityControlsStatus</td> + * <td>See StabilityControlsStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>seatOccupancy</td> + * <td>SeatOccupancy</td> + * <td>See SeatOccupancy</td> + * <td>N</td> + * <td></td> + * <td> + * @since SmartDeviceLink 7.1.0 + * </td> + * </table> + * + * @see SubscribeVehicleData + * @see UnsubscribeVehicleData + * @since SmartDeviceLink 1.0 + */ +public class OnVehicleData extends RPCNotification { + public static final String KEY_SPEED = "speed"; + public static final String KEY_RPM = "rpm"; + public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature"; + public static final String KEY_VIN = "vin"; + public static final String KEY_PRNDL = "prndl"; + public static final String KEY_TIRE_PRESSURE = "tirePressure"; + public static final String KEY_ENGINE_TORQUE = "engineTorque"; + public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife"; + public static final String KEY_ODOMETER = "odometer"; + public static final String KEY_GPS = "gps"; + public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption"; + public static final String KEY_BELT_STATUS = "beltStatus"; + public static final String KEY_BODY_INFORMATION = "bodyInformation"; + public static final String KEY_DEVICE_STATUS = "deviceStatus"; + public static final String KEY_DRIVER_BRAKING = "driverBraking"; + public static final String KEY_WIPER_STATUS = "wiperStatus"; + public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus"; + public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition"; + public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle"; + public static final String KEY_E_CALL_INFO = "eCallInfo"; + public static final String KEY_AIRBAG_STATUS = "airbagStatus"; + public static final String KEY_EMERGENCY_EVENT = "emergencyEvent"; + public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus"; + public static final String KEY_MY_KEY = "myKey"; + public static final String KEY_FUEL_RANGE = "fuelRange"; + public static final String KEY_TURN_SIGNAL = "turnSignal"; + public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus"; + public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID"; + public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering"; + public static final String KEY_WINDOW_STATUS = "windowStatus"; + public static final String KEY_GEAR_STATUS = "gearStatus"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL = "fuelLevel"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State"; + + public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus"; + + /** + * @since SmartDeviceLink 7.1.0 + */ + public static final String KEY_SEAT_OCCUPANCY = "seatOccupancy"; + public OnVehicleData() { + super(FunctionID.ON_VEHICLE_DATA.toString()); + } + + public OnVehicleData(Hashtable<String, Object> hash) { + super(hash); + } + + public OnVehicleData setGps(GPSData gps) { + setParameters(KEY_GPS, gps); + return this; + } + + public GPSData getGps() { + return (GPSData) getObject(GPSData.class, KEY_GPS); + } + + public OnVehicleData setSpeed(Double speed) { + setParameters(KEY_SPEED, speed); + return this; + } + + public Double getSpeed() { + Object object = getParameters(KEY_SPEED); + return SdlDataTypeConverter.objectToDouble(object); + } + + public OnVehicleData setRpm(Integer rpm) { + setParameters(KEY_RPM, rpm); + return this; + } + + public Integer getRpm() { + return getInteger(KEY_RPM); + } + + /** + * Sets the fuelLevel. + * + * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public OnVehicleData setFuelLevel(Double fuelLevel) { + setParameters(KEY_FUEL_LEVEL, fuelLevel); + return this; + } + + /** + * Gets the fuelLevel. + * + * @return Float The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public Double getFuelLevel() { + Object object = getParameters(KEY_FUEL_LEVEL); + return SdlDataTypeConverter.objectToDouble(object); + } + + @Deprecated + public OnVehicleData setFuelLevelState(ComponentVolumeStatus fuelLevelState) { + setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState); + return this; + } + + @Deprecated + public ComponentVolumeStatus getFuelLevelState() { + return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE); + } + + public OnVehicleData setInstantFuelConsumption(Double instantFuelConsumption) { + setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption); + return this; + } + + public Double getInstantFuelConsumption() { + Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION); + return SdlDataTypeConverter.objectToDouble(object); + } + + public OnVehicleData setExternalTemperature(Double externalTemperature) { + setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature); + return this; + } + + public Double getExternalTemperature() { + Object object = getParameters(KEY_EXTERNAL_TEMPERATURE); + return SdlDataTypeConverter.objectToDouble(object); + } + + public OnVehicleData setVin(String vin) { + setParameters(KEY_VIN, vin); + return this; + } + + public String getVin() { + return getString(KEY_VIN); + } + + /** + * Sets the prndl. + * + * @param prndl See PRNDL. This parameter is deprecated since 7.0.0 and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public OnVehicleData setPrndl(PRNDL prndl) { + setParameters(KEY_PRNDL, prndl); + return this; + } + + /** + * Gets the prndl. + * + * @return PRNDL See PRNDL. This parameter since 7.0.0 is deprecated and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public PRNDL getPrndl() { + return (PRNDL) getObject(PRNDL.class, KEY_PRNDL); + } + + /** + * Sets the tirePressure. + * + * @param tirePressure See TireStatus + */ + public OnVehicleData setTirePressure(TireStatus tirePressure) { + setParameters(KEY_TIRE_PRESSURE, tirePressure); + return this; + } + + public TireStatus getTirePressure() { + return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE); + } + + public OnVehicleData setOdometer(Integer odometer) { + setParameters(KEY_ODOMETER, odometer); + return this; + } + + public Integer getOdometer() { + return getInteger(KEY_ODOMETER); + } + + public OnVehicleData setBeltStatus(BeltStatus beltStatus) { + setParameters(KEY_BELT_STATUS, beltStatus); + return this; + } + + public BeltStatus getBeltStatus() { + return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS); + } + + public OnVehicleData setBodyInformation(BodyInformation bodyInformation) { + setParameters(KEY_BODY_INFORMATION, bodyInformation); + return this; + } + + public BodyInformation getBodyInformation() { + return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION); + } + + public OnVehicleData setDeviceStatus(DeviceStatus deviceStatus) { + setParameters(KEY_DEVICE_STATUS, deviceStatus); + return this; + } + + public DeviceStatus getDeviceStatus() { + return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS); + } + + public OnVehicleData setDriverBraking(VehicleDataEventStatus driverBraking) { + setParameters(KEY_DRIVER_BRAKING, driverBraking); + return this; + } + + public VehicleDataEventStatus getDriverBraking() { + return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING); + } + + public OnVehicleData setWiperStatus(WiperStatus wiperStatus) { + setParameters(KEY_WIPER_STATUS, wiperStatus); + return this; + } + + public WiperStatus getWiperStatus() { + return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS); + } + + public OnVehicleData setHeadLampStatus(HeadLampStatus headLampStatus) { + setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus); + return this; + } + + public HeadLampStatus getHeadLampStatus() { + return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS); + } + + public OnVehicleData setEngineTorque(Double engineTorque) { + setParameters(KEY_ENGINE_TORQUE, engineTorque); + return this; + } + + public Double getEngineTorque() { + Object object = getParameters(KEY_ENGINE_TORQUE); + return SdlDataTypeConverter.objectToDouble(object); + } + + public OnVehicleData setEngineOilLife(Float engineOilLife) { + setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife); + return this; + } + + public Float getEngineOilLife() { + Object object = getParameters(KEY_ENGINE_OIL_LIFE); + return SdlDataTypeConverter.objectToFloat(object); + } + + public OnVehicleData setAccPedalPosition(Double accPedalPosition) { + setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition); + return this; + } + + public Double getAccPedalPosition() { + Object object = getParameters(KEY_ACC_PEDAL_POSITION); + return SdlDataTypeConverter.objectToDouble(object); + } + + public OnVehicleData setSteeringWheelAngle(Double steeringWheelAngle) { + setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle); + return this; + } + + public Double getSteeringWheelAngle() { + Object object = getParameters(KEY_STEERING_WHEEL_ANGLE); + return SdlDataTypeConverter.objectToDouble(object); + } + + public OnVehicleData setECallInfo(ECallInfo eCallInfo) { + setParameters(KEY_E_CALL_INFO, eCallInfo); + return this; + } + + public ECallInfo getECallInfo() { + return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO); + } + + public OnVehicleData setAirbagStatus(AirbagStatus airbagStatus) { + setParameters(KEY_AIRBAG_STATUS, airbagStatus); + return this; + } + + public AirbagStatus getAirbagStatus() { + return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS); + } + + public OnVehicleData setEmergencyEvent(EmergencyEvent emergencyEvent) { + setParameters(KEY_EMERGENCY_EVENT, emergencyEvent); + return this; + } + + public EmergencyEvent getEmergencyEvent() { + return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT); + } + + public OnVehicleData setClusterModeStatus(ClusterModeStatus clusterModeStatus) { + setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus); + return this; + } + + public ClusterModeStatus getClusterModeStatus() { + return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS); + } + + public OnVehicleData setMyKey(MyKey myKey) { + setParameters(KEY_MY_KEY, myKey); + return this; + } + + public MyKey getMyKey() { + return (MyKey) getObject(MyKey.class, KEY_MY_KEY); + } + + /** + * Sets the fuelRange. + * + * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * {"array_min_size": 0, "array_max_size": 100} + * @since SmartDeviceLink 5.0.0 + */ + public OnVehicleData setFuelRange(List<FuelRange> fuelRange) { + setParameters(KEY_FUEL_RANGE, fuelRange); + return this; + } + + /** + * Gets the fuelRange. + * + * @return List<FuelRange> The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * {"array_min_size": 0, "array_max_size": 100} + * @since SmartDeviceLink 5.0.0 + */ + @SuppressWarnings("unchecked") + public List<FuelRange> getFuelRange() { + return (List<FuelRange>) getObject(FuelRange.class, KEY_FUEL_RANGE); + } + + /** + * Sets turnSignal + * + * @param turnSignal + */ + public OnVehicleData setTurnSignal(TurnSignal turnSignal) { + setParameters(KEY_TURN_SIGNAL, turnSignal); + return this; + } + + /** + * Gets turnSignal + * + * @return TurnSignal + */ + public TurnSignal getTurnSignal() { + return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL); + } + + /** + * Sets electronicParkBrakeStatus + * + * @param electronicParkBrakeStatus + */ + public OnVehicleData setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus) { + setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); + return this; + } + + /** + * Gets electronicParkBrakeStatus + * + * @return ElectronicParkBrakeStatus + */ + public ElectronicParkBrakeStatus getElectronicParkBrakeStatus() { + return (ElectronicParkBrakeStatus) getObject(ElectronicParkBrakeStatus.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS); + } + + /** + * Sets a string value for the cloud app vehicle ID + * + * @param cloudAppVehicleID a string value + */ + public OnVehicleData setCloudAppVehicleID(String cloudAppVehicleID) { + setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID); + return this; + } + + /** + * Gets a String value of the returned cloud app vehicle ID + * + * @return a String value. + */ + public String getCloudAppVehicleID() { + return getString(KEY_CLOUD_APP_VEHICLE_ID); + } + + /** + * Sets a value for OEM Custom VehicleData. + * + * @param vehicleDataName a String value + * @param vehicleDataState a VehicleDataResult value + */ + public OnVehicleData setOEMCustomVehicleData(String vehicleDataName, Object vehicleDataState) { + setParameters(vehicleDataName, vehicleDataState); + return this; + } + + /** + * Gets a VehicleData value for the vehicle data item. + * + * @return a Object related to the vehicle data + */ + public Object getOEMCustomVehicleData(String vehicleDataName) { + return getParameters(vehicleDataName); + } + + /** + * Sets the windowStatus. + * + * @param windowStatus See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public OnVehicleData setWindowStatus(List<WindowStatus> windowStatus) { + setParameters(KEY_WINDOW_STATUS, windowStatus); + return this; + } + + /** + * Gets the windowStatus. + * + * @return List<WindowStatus> See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + @SuppressWarnings("unchecked") + public List<WindowStatus> getWindowStatus() { + return (List<WindowStatus>) getObject(WindowStatus.class, KEY_WINDOW_STATUS); + } + + /** + * Gets the stabilityControlsStatus. + * + * @return StabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public StabilityControlsStatus getStabilityControlsStatus() { + return (StabilityControlsStatus) getObject(StabilityControlsStatus.class, KEY_STABILITY_CONTROLS_STATUS); + } + + /** + * Sets the stabilityControlsStatus. + * + * @param stabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public OnVehicleData setStabilityControlsStatus(StabilityControlsStatus stabilityControlsStatus) { + setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus); + return this; + } + + /** + * Sets the handsOffSteering. + * + * @param handsOffSteering To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public OnVehicleData setHandsOffSteering(Boolean handsOffSteering) { + setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering); + return this; + } + + /** + * Gets the handsOffSteering. + * + * @return Boolean To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getHandsOffSteering() { + return getBoolean(KEY_HANDS_OFF_STEERING); + } + + /** + * Sets the gearStatus. + * + * @param gearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public OnVehicleData setGearStatus(GearStatus gearStatus) { + setParameters(KEY_GEAR_STATUS, gearStatus); + return this; + } + + /** + * Gets the gearStatus. + * + * @return GearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public GearStatus getGearStatus() { + return (GearStatus) getObject(GearStatus.class, KEY_GEAR_STATUS); + } + /** + * Sets the seatOccupancy. + * + * @param seatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public OnVehicleData setSeatOccupancy(SeatOccupancy seatOccupancy) { + setParameters(KEY_SEAT_OCCUPANCY, seatOccupancy); + return this; + } + + /** + * Gets the seatOccupancy. + * + * @return SeatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public SeatOccupancy getSeatOccupancy() { + return (SeatOccupancy) getObject(SeatOccupancy.class, KEY_SEAT_OCCUPANCY); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatOccupancy.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatOccupancy.java new file mode 100644 index 000000000..c54ae0ef0 --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatOccupancy.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2017 - 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. + */ +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.proxy.RPCStruct; + +import java.util.Hashtable; +import java.util.List; + +/** + * + * <p><b>Parameter List</b></p> + * + * <table border="1" rules="all"> + * <tr> + * <th>Param Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Required</th> + * <th>Notes</th> + * <th>Version Available</th> + * </tr> + * <tr> + * <td>seatsOccupied</td> + * <td>List<SeatStatus></td> + * <td>Seat status array containing location and whether the seats are occupied.</td> + * <td>N</td> + * <td>{"array_min_size": 0, "array_max_size": 100}</td> + * <td></td> + * </tr> + * <tr> + * <td>seatsBelted</td> + * <td>List<SeatStatus></td> + * <td>Seat status array containing location and whether the seats are belted.</td> + * <td>N</td> + * <td>{"array_min_size": 0, "array_max_size": 100}</td> + * <td></td> + * </tr> + * </table> + * @since SmartDeviceLink 7.1.0 + */ +public class SeatOccupancy extends RPCStruct { + public static final String KEY_SEATS_OCCUPIED = "seatsOccupied"; + public static final String KEY_SEATS_BELTED = "seatsBelted"; + + /** + * Constructs a new SeatOccupancy object + */ + public SeatOccupancy() { } + + /** + * Constructs a new SeatOccupancy object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public SeatOccupancy(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Sets the seatsOccupied. + * + * @param seatsOccupied Seat status array containing location and whether the seats are occupied. + * {"array_min_size": 0, "array_max_size": 100} + */ + public SeatOccupancy setSeatsOccupied(List<SeatStatus> seatsOccupied) { + setValue(KEY_SEATS_OCCUPIED, seatsOccupied); + return this; + } + + /** + * Gets the seatsOccupied. + * + * @return List<SeatStatus> Seat status array containing location and whether the seats are occupied. + * {"array_min_size": 0, "array_max_size": 100} + */ + @SuppressWarnings("unchecked") + public List<SeatStatus> getSeatsOccupied() { + return (List<SeatStatus>) getObject(SeatStatus.class, KEY_SEATS_OCCUPIED); + } + + /** + * Sets the seatsBelted. + * + * @param seatsBelted Seat status array containing location and whether the seats are belted. + * {"array_min_size": 0, "array_max_size": 100} + */ + public SeatOccupancy setSeatsBelted(List<SeatStatus> seatsBelted) { + setValue(KEY_SEATS_BELTED, seatsBelted); + return this; + } + + /** + * Gets the seatsBelted. + * + * @return List<SeatStatus> Seat status array containing location and whether the seats are belted. + * {"array_min_size": 0, "array_max_size": 100} + */ + @SuppressWarnings("unchecked") + public List<SeatStatus> getSeatsBelted() { + return (List<SeatStatus>) getObject(SeatStatus.class, KEY_SEATS_BELTED); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatStatus.java new file mode 100644 index 000000000..65f60c8ff --- /dev/null +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatStatus.java @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2017 - 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. + */ +package com.smartdevicelink.proxy.rpc; + +import androidx.annotation.NonNull; + +import com.smartdevicelink.proxy.RPCStruct; + +import java.util.Hashtable; + +/** + * Describes the status of a parameter of seat. + * + * <p><b>Parameter List</b></p> + * + * <table border="1" rules="all"> + * <tr> + * <th>Param Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Required</th> + * <th>Notes</th> + * <th>Version Available</th> + * </tr> + * <tr> + * <td>seatLocation</td> + * <td>SeatLocation</td> + * <td></td> + * <td>Y</td> + * <td></td> + * <td></td> + * </tr> + * <tr> + * <td>conditionActive</td> + * <td>Boolean</td> + * <td></td> + * <td>Y</td> + * <td></td> + * <td></td> + * </tr> + * </table> + * + * @since SmartDeviceLink 7.1.0 + */ +public class SeatStatus extends RPCStruct { + public static final String KEY_SEAT_LOCATION = "seatLocation"; + public static final String KEY_CONDITION_ACTIVE = "conditionActive"; + + /** + * Constructs a new SeatStatus object + */ + public SeatStatus() { } + + /** + * Constructs a new SeatStatus object indicated by the Hashtable parameter + * + * @param hash The Hashtable to use + */ + public SeatStatus(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a new SeatStatus object + * + * @param seatLocation + * @param conditionActive + */ + public SeatStatus(@NonNull SeatLocation seatLocation, @NonNull Boolean conditionActive) { + this(); + setSeatLocation(seatLocation); + setConditionActive(conditionActive); + } + + /** + * Sets the seatLocation. + * + * @param seatLocation + */ + public SeatStatus setSeatLocation(@NonNull SeatLocation seatLocation) { + setValue(KEY_SEAT_LOCATION, seatLocation); + return this; + } + + /** + * Gets the seatLocation. + * + * @return SeatLocation + */ + public SeatLocation getSeatLocation() { + return (SeatLocation) getObject(SeatLocation.class, KEY_SEAT_LOCATION); + } + + /** + * Sets the conditionActive. + * + * @param conditionActive + */ + public SeatStatus setConditionActive(@NonNull Boolean conditionActive) { + setValue(KEY_CONDITION_ACTIVE, conditionActive); + return this; + } + + /** + * Gets the conditionActive. + * + * @return Boolean + */ + public Boolean getConditionActive() { + return getBoolean(KEY_CONDITION_ACTIVE); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java index 99e881202..aed109985 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java @@ -1,1029 +1,1064 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * Subscribes for specific published vehicle data items. The data will be only
- * sent, if it has changed. The application will be notified by the
- * onVehicleData notification whenever new data is available. The update rate is
- * very much dependent on sensors, vehicle architecture and vehicle type. Be
- * also prepared for the situation that a signal is not available on a vehicle
- *
- * <p>Function Group: Location, VehicleInfo and DrivingChara</p>
- *
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>SmartDeviceLink Version</th>
- * </tr>
- * <tr>
- * <td>gps</td>
- * <td>Boolean</td>
- * <td>GPS data. See {@linkplain GPSData}for details</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>speed</td>
- * <td>Boolean</td>
- * <td>The vehicle speed in kilometers per hour</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>rpm</td>
- * <td>Boolean</td>
- * <td>The number of revolutions per minute of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>fuelLevel</td>
- * <td>Boolean</td>
- * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel_State</td>
- * <td>Boolean</td>
- * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>fuelRange</td>
- * <td>Boolean</td>
- * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0.0</td>
- * </tr>
- * <tr>
- * <td>instantFuelConsumption</td>
- * <td>Boolean</td>
- * <td>The instantaneous fuel consumption in micro litres</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>externalTemperature</td>
- * <td>Boolean</td>
- * <td>The external temperature in degrees celsius</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>gearStatus</td>
- * <td>Boolean</td>
- * <td>See GearStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>prndl</td>
- * <td>Boolean</td>
- * <td>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>tirePressure</td>
- * <td>Boolean</td>
- * <td>Tire pressure status</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>odometer</td>
- * <td>Boolean</td>
- * <td>Odometer in km</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>beltStatus</td>
- * <td>Boolean</td>
- * <td>The status of the seat belts</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>bodyInformation</td>
- * <td>Boolean</td>
- * <td>The body information including ignition status and internal temp</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>deviceStatus</td>
- * <td>Boolean</td>
- * <td>The device status including signal and battery strength</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>driverBraking</td>
- * <td>Boolean</td>
- * <td>The status of the brake pedal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>wiperStatus</td>
- * <td>Boolean</td>
- * <td>The status of the wipers</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>headLampStatus</td>
- * <td>Boolean</td>
- * <td>Status of the head lamps</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>engineTorque</td>
- * <td>Boolean</td>
- * <td>Torque value for engine (in Nm) on non-diesel variants</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>engineOilLife</td>
- * <td>Boolean</td>
- * <td>The estimated percentage of remaining oil life of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0 </td>
- * </tr>
- * <tr>
- * <td>accPedalPosition</td>
- * <td>Boolean</td>
- * <td>Accelerator pedal position (percentage depressed)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>steeringWheelAngle</td>
- * <td>Boolean</td>
- * <td>Current angle of the steering wheel (in deg)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>eCallInfo</td>
- * <td>Boolean</td>
- * <td>Emergency Call notification and confirmation data.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>airbagStatus</td>
- * <td>Boolean</td>
- * <td>The status of the air bags.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>emergencyEvent</td>
- * <td>Boolean</td>
- * <td>Information related to an emergency event (and if it occurred).</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>clusterModeStatus</td>
- * <td>Boolean</td>
- * <td>The status modes of the instrument panel cluster.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>myKey</td>
- * <td>Boolean</td>
- * <td>Information related to the MyKey feature.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>turnSignal</td>
- * <td>Boolean</td>
- * <td>@see TurnSignal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0 </td>
- * </tr>
- * <tr>
- * <td>cloudAppVehicleID</td>
- * <td>Boolean</td>
- * <td>ID for the vehicle when connecting to cloud applications</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.1 </td>
- * </tr>
- * <tr>
- * <td>handsOffSteering</td>
- * <td>Boolean</td>
- * <td>To indicate whether driver hands are off the steering wheel</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>windowStatus</td>
- * <td>Boolean</td>
- * <td>See WindowStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>stabilityControlsStatus</td>
- * <td>Boolean</td>
- * <td>See StabilityControlsStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * </table>
- *
- * <p> <b>Response</b></p>
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>WARNINGS </p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>IGNORED </p>
- * <p>DISALLOWED</p>
- * <p>USER_DISALLOWED </p>
- *
- * @see UnsubscribeVehicleData
- * @see GetVehicleData
- * @since SmartDeviceLink 2.0
- */
-public class SubscribeVehicleData extends RPCRequest {
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_SPEED = "speed";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
- public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
- public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
- public static final String KEY_WINDOW_STATUS = "windowStatus";
- public static final String KEY_GEAR_STATUS = "gearStatus";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
-
- /**
- * Constructs a new SubscribeVehicleData object
- */
- public SubscribeVehicleData() {
- super(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new SubscribeVehicleData object indicated by the Hashtable
- * parameter</p>
- *
- * @param hash The Hashtable to use
- */
- public SubscribeVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Gps data
- *
- * @param gps a boolean value
- */
- public SubscribeVehicleData setGps(Boolean gps) {
- setParameters(KEY_GPS, gps);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Gps data has been subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Gps data has been
- * subscribed.
- */
- public Boolean getGps() {
- return getBoolean(KEY_GPS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes speed data
- *
- * @param speed a boolean value
- */
- public SubscribeVehicleData setSpeed(Boolean speed) {
- setParameters(KEY_SPEED, speed);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Speed data has been subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Speed data has been
- * subscribed.
- */
- public Boolean getSpeed() {
- return getBoolean(KEY_SPEED);
- }
-
- /**
- * Sets a boolean value. If true, subscribes rpm data
- *
- * @param rpm a boolean value
- */
- public SubscribeVehicleData setRpm(Boolean rpm) {
- setParameters(KEY_RPM, rpm);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the rpm data has been subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the rpm data has been
- * subscribed.
- */
- public Boolean getRpm() {
- return getBoolean(KEY_RPM);
- }
-
- /**
- * Sets the fuelLevel.
- *
- * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public SubscribeVehicleData setFuelLevel(Boolean fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- return this;
- }
-
- /**
- * Gets the fuelLevel.
- *
- * @return Float The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public Boolean getFuelLevel() {
- return getBoolean(KEY_FUEL_LEVEL);
- }
-
- /**
- * Sets a boolean value. If true, subscribes fuelLevelState data
- *
- * @param fuelLevelState a boolean value
- */
- @Deprecated
- public SubscribeVehicleData setFuelLevelState(Boolean fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the fuelLevelState data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the fuelLevelState data
- * has been subscribed.
- */
- @Deprecated
- public Boolean getFuelLevelState() {
- return getBoolean(KEY_FUEL_LEVEL_STATE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes instantFuelConsumption data
- *
- * @param instantFuelConsumption a boolean value
- */
- public SubscribeVehicleData setInstantFuelConsumption(Boolean instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the getInstantFuelConsumption data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the getInstantFuelConsumption data
- * has been subscribed.
- */
- public Boolean getInstantFuelConsumption() {
- return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
- }
-
- /**
- * Sets a boolean value. If true, subscribes externalTemperature data
- *
- * @param externalTemperature a boolean value
- */
- public SubscribeVehicleData setExternalTemperature(Boolean externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the externalTemperature data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the externalTemperature data
- * has been subscribed.
- */
- public Boolean getExternalTemperature() {
- return getBoolean(KEY_EXTERNAL_TEMPERATURE);
- }
-
- /**
- * Sets the gearStatus.
- *
- * @param gearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public SubscribeVehicleData setGearStatus(Boolean gearStatus) {
- setParameters(KEY_GEAR_STATUS, gearStatus);
- return this;
- }
-
- /**
- * Gets the gearStatus.
- *
- * @return Boolean See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getGearStatus() {
- return getBoolean(KEY_GEAR_STATUS);
- }
-
- /**
- * Sets the prndl.
- *
- * @param prndl See PRNDL. This parameter is deprecated since 7.0.0 and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public SubscribeVehicleData setPrndl(Boolean prndl) {
- setParameters(KEY_PRNDL, prndl);
- return this;
- }
-
- /**
- * Gets the prndl.
- *
- * @return Boolean See PRNDL. This parameter is deprecated since 7.0.0 and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public Boolean getPrndl() {
- return getBoolean(KEY_PRNDL);
- }
-
- /**
- * Sets a boolean value. If true, subscribes tire pressure status data
- *
- * @param tirePressure a boolean value
- */
- public SubscribeVehicleData setTirePressure(Boolean tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the tire pressure status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the tire pressure status data
- * has been subscribed.
- */
- public Boolean getTirePressure() {
- return getBoolean(KEY_TIRE_PRESSURE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes odometer data
- *
- * @param odometer a boolean value
- */
- public SubscribeVehicleData setOdometer(Boolean odometer) {
- setParameters(KEY_ODOMETER, odometer);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the odometer data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the odometer data
- * has been subscribed.
- */
- public Boolean getOdometer() {
- return getBoolean(KEY_ODOMETER);
- }
-
- /**
- * Sets a boolean value. If true, subscribes belt Status data
- *
- * @param beltStatus a boolean value
- */
- public SubscribeVehicleData setBeltStatus(Boolean beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the belt Status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the belt Status data
- * has been subscribed.
- */
- public Boolean getBeltStatus() {
- return getBoolean(KEY_BELT_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes body Information data
- *
- * @param bodyInformation a boolean value
- */
- public SubscribeVehicleData setBodyInformation(Boolean bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the body Information data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the body Information data
- * has been subscribed.
- */
- public Boolean getBodyInformation() {
- return getBoolean(KEY_BODY_INFORMATION);
- }
-
- /**
- * Sets a boolean value. If true, subscribes device Status data
- *
- * @param deviceStatus a boolean value
- */
- public SubscribeVehicleData setDeviceStatus(Boolean deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the device Status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the device Status data
- * has been subscribed.
- */
- public Boolean getDeviceStatus() {
- return getBoolean(KEY_DEVICE_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes driver Braking data
- *
- * @param driverBraking a boolean value
- */
- public SubscribeVehicleData setDriverBraking(Boolean driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the driver Braking data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the driver Braking data
- * has been subscribed.
- */
- public Boolean getDriverBraking() {
- return getBoolean(KEY_DRIVER_BRAKING);
- }
-
- /**
- * Sets a boolean value. If true, subscribes wiper Status data
- *
- * @param wiperStatus a boolean value
- */
- public SubscribeVehicleData setWiperStatus(Boolean wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the wiper Status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the wiper Status data
- * has been subscribed.
- */
- public Boolean getWiperStatus() {
- return getBoolean(KEY_WIPER_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Head Lamp Status data
- *
- * @param headLampStatus a boolean value
- */
- public SubscribeVehicleData setHeadLampStatus(Boolean headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Head Lamp Status data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Head Lamp Status data
- * has been subscribed.
- */
- public Boolean getHeadLampStatus() {
- return getBoolean(KEY_HEAD_LAMP_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Engine Torque data
- *
- * @param engineTorque a boolean value
- */
- public SubscribeVehicleData setEngineTorque(Boolean engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Engine Oil Life data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Engine Oil Life data
- * has been subscribed.
- */
- public Boolean getEngineOilLife() {
- return getBoolean(KEY_ENGINE_OIL_LIFE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes Engine Oil Life data
- *
- * @param engineOilLife a boolean value
- */
- public SubscribeVehicleData setEngineOilLife(Boolean engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Engine Torque data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Engine Torque data
- * has been subscribed.
- */
- public Boolean getEngineTorque() {
- return getBoolean(KEY_ENGINE_TORQUE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes accPedalPosition data
- *
- * @param accPedalPosition a boolean value
- */
- public SubscribeVehicleData setAccPedalPosition(Boolean accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the accPedalPosition data has been
- * subscribed.
- *
- * @return Boolean -a Boolean value. If true, means the accPedalPosition data
- * has been subscribed.
- */
- public Boolean getAccPedalPosition() {
- return getBoolean(KEY_ACC_PEDAL_POSITION);
- }
-
- public SubscribeVehicleData setSteeringWheelAngle(Boolean steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- return this;
- }
-
- public Boolean getSteeringWheelAngle() {
- return getBoolean(KEY_STEERING_WHEEL_ANGLE);
- }
-
- public SubscribeVehicleData setECallInfo(Boolean eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- return this;
- }
-
- public Boolean getECallInfo() {
- return getBoolean(KEY_E_CALL_INFO);
- }
-
- public SubscribeVehicleData setAirbagStatus(Boolean airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- return this;
- }
-
- public Boolean getAirbagStatus() {
- return getBoolean(KEY_AIRBAG_STATUS);
- }
-
- public SubscribeVehicleData setEmergencyEvent(Boolean emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- return this;
- }
-
- public Boolean getEmergencyEvent() {
- return getBoolean(KEY_EMERGENCY_EVENT);
- }
-
- public SubscribeVehicleData setClusterModeStatus(Boolean clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- return this;
- }
-
- public Boolean getClusterModeStatus() {
- return getBoolean(KEY_CLUSTER_MODE_STATUS);
- }
-
- public SubscribeVehicleData setMyKey(Boolean myKey) {
- setParameters(KEY_MY_KEY, myKey);
- return this;
- }
-
- public Boolean getMyKey() {
- return getBoolean(KEY_MY_KEY);
- }
-
- /**
- * Sets the fuelRange.
- *
- * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * @since SmartDeviceLink 5.0.0
- */
- public SubscribeVehicleData setFuelRange(Boolean fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- return this;
- }
-
- /**
- * Gets the fuelRange.
- *
- * @return Boolean The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * @since SmartDeviceLink 5.0.0
- */
- public Boolean getFuelRange() {
- return getBoolean(KEY_FUEL_RANGE);
- }
-
- /**
- * Sets a boolean value. If true, subscribes turnSignal data
- *
- * @param turnSignal a boolean value
- */
- public SubscribeVehicleData setTurnSignal(Boolean turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the turnSignal data has been subscribed.
- *
- * @return a Boolean value.
- */
- public Boolean getTurnSignal() {
- return getBoolean(KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
- *
- * @param electronicParkBrakeStatus a boolean value
- */
- public SubscribeVehicleData setElectronicParkBrakeStatus(boolean electronicParkBrakeStatus) {
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
- *
- * @return a Boolean value.
- */
- public Boolean getElectronicParkBrakeStatus() {
- return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, subscribes cloudAppVehicleID data
- *
- * @param cloudAppVehicleID a boolean value
- */
- public SubscribeVehicleData setCloudAppVehicleID(boolean cloudAppVehicleID) {
- setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the cloudAppVehicleDataID data has been subscribed.
- *
- * @return a Boolean value.
- */
- public Boolean getCloudAppVehicleID() {
- return getBoolean(KEY_CLOUD_APP_VEHICLE_ID);
- }
-
- /**
- * Sets a boolean value for OEM Custom VehicleData.
- *
- * @param vehicleDataName a String value
- * @param vehicleDataState a boolean value
- */
- public SubscribeVehicleData setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState) {
- setParameters(vehicleDataName, vehicleDataState);
- return this;
- }
-
- /**
- * Gets a boolean value for OEM Custom VehicleData.
- *
- * @return a Boolean value.
- */
- public Boolean getOEMCustomVehicleData(String vehicleDataName) {
- return getBoolean(vehicleDataName);
- }
-
- /**
- * Sets the windowStatus.
- *
- * @param windowStatus See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public SubscribeVehicleData setWindowStatus(Boolean windowStatus) {
- setParameters(KEY_WINDOW_STATUS, windowStatus);
- return this;
- }
-
- /**
- * Gets the windowStatus.
- *
- * @return Boolean See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getWindowStatus() {
- return getBoolean(KEY_WINDOW_STATUS);
- }
-
- /**
- * Sets the handsOffSteering.
- *
- * @param handsOffSteering To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public SubscribeVehicleData setHandsOffSteering(Boolean handsOffSteering) {
- setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
- return this;
- }
-
- /**
- * Gets the handsOffSteering.
- *
- * @return Boolean To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getHandsOffSteering() {
- return getBoolean(KEY_HANDS_OFF_STEERING);
- }
-
- /**
- * Gets the stabilityControlsStatus.
- *
- * @return Boolean See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getStabilityControlsStatus() {
- return getBoolean(KEY_STABILITY_CONTROLS_STATUS);
- }
-
- /**
- * Sets the stabilityControlsStatus.
- *
- * @param stabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public SubscribeVehicleData setStabilityControlsStatus(Boolean stabilityControlsStatus) {
- setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
- return this;
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCRequest; + +import java.util.Hashtable; + +/** + * Subscribes for specific published vehicle data items. The data will be only + * sent, if it has changed. The application will be notified by the + * onVehicleData notification whenever new data is available. The update rate is + * very much dependent on sensors, vehicle architecture and vehicle type. Be + * also prepared for the situation that a signal is not available on a vehicle + * + * <p>Function Group: Location, VehicleInfo and DrivingChara</p> + * + * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p> + * + * <p><b>Parameter List</b></p> + * <table border="1" rules="all"> + * <tr> + * <th>Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Reg.</th> + * <th>Notes</th> + * <th>SmartDeviceLink Version</th> + * </tr> + * <tr> + * <td>gps</td> + * <td>Boolean</td> + * <td>GPS data. See {@linkplain GPSData}for details</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>speed</td> + * <td>Boolean</td> + * <td>The vehicle speed in kilometers per hour</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>rpm</td> + * <td>Boolean</td> + * <td>The number of revolutions per minute of the engine</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>fuelLevel</td> + * <td>Boolean</td> + * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>fuelLevel_State</td> + * <td>Boolean</td> + * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>fuelRange</td> + * <td>Boolean</td> + * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0.0</td> + * </tr> + * <tr> + * <td>instantFuelConsumption</td> + * <td>Boolean</td> + * <td>The instantaneous fuel consumption in micro litres</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>externalTemperature</td> + * <td>Boolean</td> + * <td>The external temperature in degrees celsius</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>gearStatus</td> + * <td>Boolean</td> + * <td>See GearStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>prndl</td> + * <td>Boolean</td> + * <td>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>tirePressure</td> + * <td>Boolean</td> + * <td>Tire pressure status</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>odometer</td> + * <td>Boolean</td> + * <td>Odometer in km</td> + * <td>N</td> + * <td>Max Length: 500</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>beltStatus</td> + * <td>Boolean</td> + * <td>The status of the seat belts</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>bodyInformation</td> + * <td>Boolean</td> + * <td>The body information including ignition status and internal temp</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>deviceStatus</td> + * <td>Boolean</td> + * <td>The device status including signal and battery strength</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>driverBraking</td> + * <td>Boolean</td> + * <td>The status of the brake pedal</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>wiperStatus</td> + * <td>Boolean</td> + * <td>The status of the wipers</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>headLampStatus</td> + * <td>Boolean</td> + * <td>Status of the head lamps</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>engineTorque</td> + * <td>Boolean</td> + * <td>Torque value for engine (in Nm) on non-diesel variants</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>engineOilLife</td> + * <td>Boolean</td> + * <td>The estimated percentage of remaining oil life of the engine</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0 </td> + * </tr> + * <tr> + * <td>accPedalPosition</td> + * <td>Boolean</td> + * <td>Accelerator pedal position (percentage depressed)</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>steeringWheelAngle</td> + * <td>Boolean</td> + * <td>Current angle of the steering wheel (in deg)</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>eCallInfo</td> + * <td>Boolean</td> + * <td>Emergency Call notification and confirmation data.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>airbagStatus</td> + * <td>Boolean</td> + * <td>The status of the air bags.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>emergencyEvent</td> + * <td>Boolean</td> + * <td>Information related to an emergency event (and if it occurred).</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>clusterModeStatus</td> + * <td>Boolean</td> + * <td>The status modes of the instrument panel cluster.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>myKey</td> + * <td>Boolean</td> + * <td>Information related to the MyKey feature.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>turnSignal</td> + * <td>Boolean</td> + * <td>@see TurnSignal</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0 </td> + * </tr> + * <tr> + * <td>cloudAppVehicleID</td> + * <td>Boolean</td> + * <td>ID for the vehicle when connecting to cloud applications</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.1 </td> + * </tr> + * <tr> + * <td>handsOffSteering</td> + * <td>Boolean</td> + * <td>To indicate whether driver hands are off the steering wheel</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>windowStatus</td> + * <td>Boolean</td> + * <td>See WindowStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>stabilityControlsStatus</td> + * <td>Boolean</td> + * <td>See StabilityControlsStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>seatOccupancy</td> + * <td>Boolean</td> + * <td>See SeatOccupancy</td> + * <td>N</td> + * <td></td> + * <td> + * @since SmartDeviceLink 7.1.0 + * </td> + * </tr> + * </table> + * + * <p> <b>Response</b></p> + * <p><b>Non-default Result Codes:</b></p> + * <p>SUCCESS</p> + * <p>WARNINGS </p> + * <p>INVALID_DATA</p> + * <p>OUT_OF_MEMORY</p> + * <p>TOO_MANY_PENDING_REQUESTS</p> + * <p>APPLICATION_NOT_REGISTERED</p> + * <p>GENERIC_ERROR</p> + * <p>IGNORED </p> + * <p>DISALLOWED</p> + * <p>USER_DISALLOWED </p> + * + * @see UnsubscribeVehicleData + * @see GetVehicleData + * @since SmartDeviceLink 2.0 + */ +public class SubscribeVehicleData extends RPCRequest { + public static final String KEY_RPM = "rpm"; + public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature"; + public static final String KEY_PRNDL = "prndl"; + public static final String KEY_TIRE_PRESSURE = "tirePressure"; + public static final String KEY_ENGINE_TORQUE = "engineTorque"; + public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife"; + public static final String KEY_ODOMETER = "odometer"; + public static final String KEY_GPS = "gps"; + public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption"; + public static final String KEY_BELT_STATUS = "beltStatus"; + public static final String KEY_BODY_INFORMATION = "bodyInformation"; + public static final String KEY_DEVICE_STATUS = "deviceStatus"; + public static final String KEY_DRIVER_BRAKING = "driverBraking"; + public static final String KEY_WIPER_STATUS = "wiperStatus"; + public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus"; + public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition"; + public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle"; + public static final String KEY_E_CALL_INFO = "eCallInfo"; + public static final String KEY_AIRBAG_STATUS = "airbagStatus"; + public static final String KEY_EMERGENCY_EVENT = "emergencyEvent"; + public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus"; + public static final String KEY_MY_KEY = "myKey"; + public static final String KEY_SPEED = "speed"; + public static final String KEY_FUEL_RANGE = "fuelRange"; + public static final String KEY_TURN_SIGNAL = "turnSignal"; + public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus"; + public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID"; + public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering"; + public static final String KEY_WINDOW_STATUS = "windowStatus"; + public static final String KEY_GEAR_STATUS = "gearStatus"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL = "fuelLevel"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State"; + public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus"; + /** + * @since SmartDeviceLink 7.1.0 + */ + public static final String KEY_SEAT_OCCUPANCY = "seatOccupancy"; + + /** + * Constructs a new SubscribeVehicleData object + */ + public SubscribeVehicleData() { + super(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString()); + } + + /** + * <p>Constructs a new SubscribeVehicleData object indicated by the Hashtable + * parameter</p> + * + * @param hash The Hashtable to use + */ + public SubscribeVehicleData(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Sets a boolean value. If true, subscribes Gps data + * + * @param gps a boolean value + */ + public SubscribeVehicleData setGps(Boolean gps) { + setParameters(KEY_GPS, gps); + return this; + } + + /** + * Gets a boolean value. If true, means the Gps data has been subscribed. + * + * @return Boolean -a Boolean value. If true, means the Gps data has been + * subscribed. + */ + public Boolean getGps() { + return getBoolean(KEY_GPS); + } + + /** + * Sets a boolean value. If true, subscribes speed data + * + * @param speed a boolean value + */ + public SubscribeVehicleData setSpeed(Boolean speed) { + setParameters(KEY_SPEED, speed); + return this; + } + + /** + * Gets a boolean value. If true, means the Speed data has been subscribed. + * + * @return Boolean -a Boolean value. If true, means the Speed data has been + * subscribed. + */ + public Boolean getSpeed() { + return getBoolean(KEY_SPEED); + } + + /** + * Sets a boolean value. If true, subscribes rpm data + * + * @param rpm a boolean value + */ + public SubscribeVehicleData setRpm(Boolean rpm) { + setParameters(KEY_RPM, rpm); + return this; + } + + /** + * Gets a boolean value. If true, means the rpm data has been subscribed. + * + * @return Boolean -a Boolean value. If true, means the rpm data has been + * subscribed. + */ + public Boolean getRpm() { + return getBoolean(KEY_RPM); + } + + /** + * Sets the fuelLevel. + * + * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public SubscribeVehicleData setFuelLevel(Boolean fuelLevel) { + setParameters(KEY_FUEL_LEVEL, fuelLevel); + return this; + } + + /** + * Gets the fuelLevel. + * + * @return Float The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public Boolean getFuelLevel() { + return getBoolean(KEY_FUEL_LEVEL); + } + + /** + * Sets a boolean value. If true, subscribes fuelLevelState data + * + * @param fuelLevelState a boolean value + */ + @Deprecated + public SubscribeVehicleData setFuelLevelState(Boolean fuelLevelState) { + setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState); + return this; + } + + /** + * Gets a boolean value. If true, means the fuelLevelState data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the fuelLevelState data + * has been subscribed. + */ + @Deprecated + public Boolean getFuelLevelState() { + return getBoolean(KEY_FUEL_LEVEL_STATE); + } + + /** + * Sets a boolean value. If true, subscribes instantFuelConsumption data + * + * @param instantFuelConsumption a boolean value + */ + public SubscribeVehicleData setInstantFuelConsumption(Boolean instantFuelConsumption) { + setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption); + return this; + } + + /** + * Gets a boolean value. If true, means the getInstantFuelConsumption data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the getInstantFuelConsumption data + * has been subscribed. + */ + public Boolean getInstantFuelConsumption() { + return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION); + } + + /** + * Sets a boolean value. If true, subscribes externalTemperature data + * + * @param externalTemperature a boolean value + */ + public SubscribeVehicleData setExternalTemperature(Boolean externalTemperature) { + setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature); + return this; + } + + /** + * Gets a boolean value. If true, means the externalTemperature data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the externalTemperature data + * has been subscribed. + */ + public Boolean getExternalTemperature() { + return getBoolean(KEY_EXTERNAL_TEMPERATURE); + } + + /** + * Sets the gearStatus. + * + * @param gearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public SubscribeVehicleData setGearStatus(Boolean gearStatus) { + setParameters(KEY_GEAR_STATUS, gearStatus); + return this; + } + + /** + * Gets the gearStatus. + * + * @return Boolean See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getGearStatus() { + return getBoolean(KEY_GEAR_STATUS); + } + + /** + * Sets the prndl. + * + * @param prndl See PRNDL. This parameter is deprecated since 7.0.0 and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public SubscribeVehicleData setPrndl(Boolean prndl) { + setParameters(KEY_PRNDL, prndl); + return this; + } + + /** + * Gets the prndl. + * + * @return Boolean See PRNDL. This parameter is deprecated since 7.0.0 and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public Boolean getPrndl() { + return getBoolean(KEY_PRNDL); + } + + /** + * Sets a boolean value. If true, subscribes tire pressure status data + * + * @param tirePressure a boolean value + */ + public SubscribeVehicleData setTirePressure(Boolean tirePressure) { + setParameters(KEY_TIRE_PRESSURE, tirePressure); + return this; + } + + /** + * Gets a boolean value. If true, means the tire pressure status data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the tire pressure status data + * has been subscribed. + */ + public Boolean getTirePressure() { + return getBoolean(KEY_TIRE_PRESSURE); + } + + /** + * Sets a boolean value. If true, subscribes odometer data + * + * @param odometer a boolean value + */ + public SubscribeVehicleData setOdometer(Boolean odometer) { + setParameters(KEY_ODOMETER, odometer); + return this; + } + + /** + * Gets a boolean value. If true, means the odometer data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the odometer data + * has been subscribed. + */ + public Boolean getOdometer() { + return getBoolean(KEY_ODOMETER); + } + + /** + * Sets a boolean value. If true, subscribes belt Status data + * + * @param beltStatus a boolean value + */ + public SubscribeVehicleData setBeltStatus(Boolean beltStatus) { + setParameters(KEY_BELT_STATUS, beltStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the belt Status data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the belt Status data + * has been subscribed. + */ + public Boolean getBeltStatus() { + return getBoolean(KEY_BELT_STATUS); + } + + /** + * Sets a boolean value. If true, subscribes body Information data + * + * @param bodyInformation a boolean value + */ + public SubscribeVehicleData setBodyInformation(Boolean bodyInformation) { + setParameters(KEY_BODY_INFORMATION, bodyInformation); + return this; + } + + /** + * Gets a boolean value. If true, means the body Information data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the body Information data + * has been subscribed. + */ + public Boolean getBodyInformation() { + return getBoolean(KEY_BODY_INFORMATION); + } + + /** + * Sets a boolean value. If true, subscribes device Status data + * + * @param deviceStatus a boolean value + */ + public SubscribeVehicleData setDeviceStatus(Boolean deviceStatus) { + setParameters(KEY_DEVICE_STATUS, deviceStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the device Status data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the device Status data + * has been subscribed. + */ + public Boolean getDeviceStatus() { + return getBoolean(KEY_DEVICE_STATUS); + } + + /** + * Sets a boolean value. If true, subscribes driver Braking data + * + * @param driverBraking a boolean value + */ + public SubscribeVehicleData setDriverBraking(Boolean driverBraking) { + setParameters(KEY_DRIVER_BRAKING, driverBraking); + return this; + } + + /** + * Gets a boolean value. If true, means the driver Braking data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the driver Braking data + * has been subscribed. + */ + public Boolean getDriverBraking() { + return getBoolean(KEY_DRIVER_BRAKING); + } + + /** + * Sets a boolean value. If true, subscribes wiper Status data + * + * @param wiperStatus a boolean value + */ + public SubscribeVehicleData setWiperStatus(Boolean wiperStatus) { + setParameters(KEY_WIPER_STATUS, wiperStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the wiper Status data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the wiper Status data + * has been subscribed. + */ + public Boolean getWiperStatus() { + return getBoolean(KEY_WIPER_STATUS); + } + + /** + * Sets a boolean value. If true, subscribes Head Lamp Status data + * + * @param headLampStatus a boolean value + */ + public SubscribeVehicleData setHeadLampStatus(Boolean headLampStatus) { + setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the Head Lamp Status data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the Head Lamp Status data + * has been subscribed. + */ + public Boolean getHeadLampStatus() { + return getBoolean(KEY_HEAD_LAMP_STATUS); + } + + /** + * Sets a boolean value. If true, subscribes Engine Torque data + * + * @param engineTorque a boolean value + */ + public SubscribeVehicleData setEngineTorque(Boolean engineTorque) { + setParameters(KEY_ENGINE_TORQUE, engineTorque); + return this; + } + + /** + * Gets a boolean value. If true, means the Engine Oil Life data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the Engine Oil Life data + * has been subscribed. + */ + public Boolean getEngineOilLife() { + return getBoolean(KEY_ENGINE_OIL_LIFE); + } + + /** + * Sets a boolean value. If true, subscribes Engine Oil Life data + * + * @param engineOilLife a boolean value + */ + public SubscribeVehicleData setEngineOilLife(Boolean engineOilLife) { + setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife); + return this; + } + + /** + * Gets a boolean value. If true, means the Engine Torque data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the Engine Torque data + * has been subscribed. + */ + public Boolean getEngineTorque() { + return getBoolean(KEY_ENGINE_TORQUE); + } + + /** + * Sets a boolean value. If true, subscribes accPedalPosition data + * + * @param accPedalPosition a boolean value + */ + public SubscribeVehicleData setAccPedalPosition(Boolean accPedalPosition) { + setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition); + return this; + } + + /** + * Gets a boolean value. If true, means the accPedalPosition data has been + * subscribed. + * + * @return Boolean -a Boolean value. If true, means the accPedalPosition data + * has been subscribed. + */ + public Boolean getAccPedalPosition() { + return getBoolean(KEY_ACC_PEDAL_POSITION); + } + + public SubscribeVehicleData setSteeringWheelAngle(Boolean steeringWheelAngle) { + setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle); + return this; + } + + public Boolean getSteeringWheelAngle() { + return getBoolean(KEY_STEERING_WHEEL_ANGLE); + } + + public SubscribeVehicleData setECallInfo(Boolean eCallInfo) { + setParameters(KEY_E_CALL_INFO, eCallInfo); + return this; + } + + public Boolean getECallInfo() { + return getBoolean(KEY_E_CALL_INFO); + } + + public SubscribeVehicleData setAirbagStatus(Boolean airbagStatus) { + setParameters(KEY_AIRBAG_STATUS, airbagStatus); + return this; + } + + public Boolean getAirbagStatus() { + return getBoolean(KEY_AIRBAG_STATUS); + } + + public SubscribeVehicleData setEmergencyEvent(Boolean emergencyEvent) { + setParameters(KEY_EMERGENCY_EVENT, emergencyEvent); + return this; + } + + public Boolean getEmergencyEvent() { + return getBoolean(KEY_EMERGENCY_EVENT); + } + + public SubscribeVehicleData setClusterModeStatus(Boolean clusterModeStatus) { + setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus); + return this; + } + + public Boolean getClusterModeStatus() { + return getBoolean(KEY_CLUSTER_MODE_STATUS); + } + + public SubscribeVehicleData setMyKey(Boolean myKey) { + setParameters(KEY_MY_KEY, myKey); + return this; + } + + public Boolean getMyKey() { + return getBoolean(KEY_MY_KEY); + } + + /** + * Sets the fuelRange. + * + * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * @since SmartDeviceLink 5.0.0 + */ + public SubscribeVehicleData setFuelRange(Boolean fuelRange) { + setParameters(KEY_FUEL_RANGE, fuelRange); + return this; + } + + /** + * Gets the fuelRange. + * + * @return Boolean The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * @since SmartDeviceLink 5.0.0 + */ + public Boolean getFuelRange() { + return getBoolean(KEY_FUEL_RANGE); + } + + /** + * Sets a boolean value. If true, subscribes turnSignal data + * + * @param turnSignal a boolean value + */ + public SubscribeVehicleData setTurnSignal(Boolean turnSignal) { + setParameters(KEY_TURN_SIGNAL, turnSignal); + return this; + } + + /** + * Gets a boolean value. If true, means the turnSignal data has been subscribed. + * + * @return a Boolean value. + */ + public Boolean getTurnSignal() { + return getBoolean(KEY_TURN_SIGNAL); + } + + /** + * Sets a boolean value. If true, subscribes electronicParkBrakeStatus data + * + * @param electronicParkBrakeStatus a boolean value + */ + public SubscribeVehicleData setElectronicParkBrakeStatus(boolean electronicParkBrakeStatus) { + setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed. + * + * @return a Boolean value. + */ + public Boolean getElectronicParkBrakeStatus() { + return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS); + } + + /** + * Sets a boolean value. If true, subscribes cloudAppVehicleID data + * + * @param cloudAppVehicleID a boolean value + */ + public SubscribeVehicleData setCloudAppVehicleID(boolean cloudAppVehicleID) { + setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID); + return this; + } + + /** + * Gets a boolean value. If true, means the cloudAppVehicleDataID data has been subscribed. + * + * @return a Boolean value. + */ + public Boolean getCloudAppVehicleID() { + return getBoolean(KEY_CLOUD_APP_VEHICLE_ID); + } + + /** + * Sets a boolean value for OEM Custom VehicleData. + * + * @param vehicleDataName a String value + * @param vehicleDataState a boolean value + */ + public SubscribeVehicleData setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState) { + setParameters(vehicleDataName, vehicleDataState); + return this; + } + + /** + * Gets a boolean value for OEM Custom VehicleData. + * + * @return a Boolean value. + */ + public Boolean getOEMCustomVehicleData(String vehicleDataName) { + return getBoolean(vehicleDataName); + } + + /** + * Sets the windowStatus. + * + * @param windowStatus See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public SubscribeVehicleData setWindowStatus(Boolean windowStatus) { + setParameters(KEY_WINDOW_STATUS, windowStatus); + return this; + } + + /** + * Gets the windowStatus. + * + * @return Boolean See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getWindowStatus() { + return getBoolean(KEY_WINDOW_STATUS); + } + + /** + * Sets the handsOffSteering. + * + * @param handsOffSteering To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public SubscribeVehicleData setHandsOffSteering(Boolean handsOffSteering) { + setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering); + return this; + } + + /** + * Gets the handsOffSteering. + * + * @return Boolean To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getHandsOffSteering() { + return getBoolean(KEY_HANDS_OFF_STEERING); + } + + /** + * Gets the stabilityControlsStatus. + * + * @return Boolean See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getStabilityControlsStatus() { + return getBoolean(KEY_STABILITY_CONTROLS_STATUS); + } + + /** + * Sets the stabilityControlsStatus. + * + * @param stabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public SubscribeVehicleData setStabilityControlsStatus(Boolean stabilityControlsStatus) { + setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus); + return this; + } + + /** + * Sets the seatOccupancy. + * + * @param seatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public SubscribeVehicleData setSeatOccupancy(Boolean seatOccupancy) { + setParameters(KEY_SEAT_OCCUPANCY, seatOccupancy); + return this; + } + + /** + * Gets the seatOccupancy. + * + * @return Boolean See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public Boolean getSeatOccupancy() { + return getBoolean(KEY_SEAT_OCCUPANCY); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java index 9d82940d5..c84b0c89f 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java @@ -1,755 +1,780 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc;
-
-import androidx.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-/**
- * Subscribe Vehicle Data Response is sent, when SubscribeVehicleData has been called
- *
- * @since SmartDeviceLink 2.0
- */
-public class SubscribeVehicleDataResponse extends RPCResponse {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- @Deprecated
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_CLUSTER_MODES = "clusterModes";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
- public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
- public static final String KEY_GEAR_STATUS = "gearStatus";
- public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
- public static final String KEY_WINDOW_STATUS = "windowStatus";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
-
- /**
- * Constructs a new SubscribeVehicleDataResponse object
- */
- public SubscribeVehicleDataResponse() {
- super(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString());
- }
-
- /**
- * <p>Constructs a new SubscribeVehicleDataResponse object indicated by the Hashtable
- * parameter</p>
- *
- * @param hash The Hashtable to use
- */
- public SubscribeVehicleDataResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Constructs a new SubscribeVehicleDataResponse object
- *
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public SubscribeVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- /**
- * Sets Gps
- *
- * @param gps a VehicleDataResult related to GPS
- */
- public SubscribeVehicleDataResponse setGps(VehicleDataResult gps) {
- setParameters(KEY_GPS, gps);
- return this;
- }
-
- /**
- * Gets Gps
- *
- * @return a VehicleDataResult related to GPS
- */
- public VehicleDataResult getGps() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS);
- }
-
- /**
- * Sets Speed
- *
- * @param speed a VehicleDataResult related to speed
- */
- public SubscribeVehicleDataResponse setSpeed(VehicleDataResult speed) {
- setParameters(KEY_SPEED, speed);
- return this;
- }
-
- /**
- * Gets Speed
- *
- * @return a VehicleDataResult related to speed
- */
- public VehicleDataResult getSpeed() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED);
- }
-
- /**
- * Sets rpm
- *
- * @param rpm a VehicleDataResult related to RPM
- */
- public SubscribeVehicleDataResponse setRpm(VehicleDataResult rpm) {
- setParameters(KEY_RPM, rpm);
- return this;
- }
-
- /**
- * Gets rpm
- *
- * @return a VehicleDataResult related to RPM
- */
- public VehicleDataResult getRpm() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_RPM);
- }
-
- /**
- * Sets the fuelLevel.
- *
- * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public SubscribeVehicleDataResponse setFuelLevel(VehicleDataResult fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- return this;
- }
-
- /**
- * Gets the fuelLevel.
- *
- * @return VehicleDataResult The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public VehicleDataResult getFuelLevel() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL);
- }
-
- /**
- * Sets Fuel Level State
- *
- * @param fuelLevelState a VehicleDataResult related to FuelLevel State
- */
- @Deprecated
- public SubscribeVehicleDataResponse setFuelLevelState(VehicleDataResult fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- return this;
- }
-
- /**
- * Gets Fuel Level State
- *
- * @return a VehicleDataResult related to FuelLevel State
- */
- @Deprecated
- public VehicleDataResult getFuelLevelState() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE);
- }
-
- /**
- * Sets Instant Fuel Consumption
- *
- * @param instantFuelConsumption a VehicleDataResult related to instant fuel consumption
- */
- public SubscribeVehicleDataResponse setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- return this;
- }
-
- /**
- * Gets Instant Fuel Consumption
- *
- * @return a VehicleDataResult related to instant fuel consumption
- */
- public VehicleDataResult getInstantFuelConsumption() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_INSTANT_FUEL_CONSUMPTION);
- }
-
- /**
- * Sets External Temperature
- *
- * @param externalTemperature a VehicleDataResult related to external temperature
- */
- public SubscribeVehicleDataResponse setExternalTemperature(VehicleDataResult externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- return this;
- }
-
- /**
- * Gets External Temperature
- *
- * @return a VehicleDataResult related to external temperature
- */
- public VehicleDataResult getExternalTemperature() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE);
- }
-
- /**
- * Sets the prndl.
- *
- * @param prndl See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public SubscribeVehicleDataResponse setPrndl(VehicleDataResult prndl) {
- setParameters(KEY_PRNDL, prndl);
- return this;
- }
-
- /**
- * Gets the prndl.
- *
- * @return VehicleDataResult See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public VehicleDataResult getPrndl() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL);
- }
-
- /**
- * Sets Tire Pressure
- *
- * @param tirePressure a VehicleDataResult related to tire pressure
- */
- public SubscribeVehicleDataResponse setTirePressure(VehicleDataResult tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- return this;
- }
-
- /**
- * Gets Tire Pressure
- *
- * @return a VehicleDataResult related to tire pressure
- */
- public VehicleDataResult getTirePressure() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE);
- }
-
- /**
- * Sets Odometer
- *
- * @param odometer a VehicleDataResult related to the odometer
- */
- public SubscribeVehicleDataResponse setOdometer(VehicleDataResult odometer) {
- setParameters(KEY_ODOMETER, odometer);
- return this;
- }
-
- /**
- * Gets Odometer
- *
- * @return a VehicleDataResult related to the odometer
- */
- public VehicleDataResult getOdometer() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER);
- }
-
- /**
- * Sets Belt Status
- *
- * @param beltStatus a VehicleDataResult related to the seat belt status
- */
- public SubscribeVehicleDataResponse setBeltStatus(VehicleDataResult beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- return this;
- }
-
- /**
- * Gets Belt Status
- *
- * @return a VehicleDataResult related to the seat belt status
- */
- public VehicleDataResult getBeltStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BELT_STATUS);
- }
-
- /**
- * Sets Body Information
- *
- * @param bodyInformation a VehicleDataResult related to the body info
- */
- public SubscribeVehicleDataResponse setBodyInformation(VehicleDataResult bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- return this;
- }
-
- /**
- * Gets Body Information
- *
- * @return a VehicleDataResult related to the body info
- */
- public VehicleDataResult getBodyInformation() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION);
- }
-
- /**
- * Sets Device Status
- *
- * @param deviceStatus a VehicleDataResult related to the device status of the connected device
- */
- public SubscribeVehicleDataResponse setDeviceStatus(VehicleDataResult deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- return this;
- }
-
- /**
- * Gets Device Status
- *
- * @return a VehicleDataResult related to the device status of the connected device
- */
- public VehicleDataResult getDeviceStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DEVICE_STATUS);
- }
-
- /**
- * Sets Driver Braking
- *
- * @param driverBraking a VehicleDataResult related to the driver breaking status
- */
- public SubscribeVehicleDataResponse setDriverBraking(VehicleDataResult driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- return this;
- }
-
- /**
- * Gets Driver Braking
- *
- * @return a VehicleDataResult related to the driver breaking status
- */
- public VehicleDataResult getDriverBraking() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DRIVER_BRAKING);
- }
-
- /**
- * Sets Wiper Status
- *
- * @param wiperStatus a VehicleDataResult related to the wiper status
- */
- public SubscribeVehicleDataResponse setWiperStatus(VehicleDataResult wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- return this;
- }
-
- /**
- * Gets Wiper Status
- *
- * @return a VehicleDataResult related to the wiper status
- */
- public VehicleDataResult getWiperStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS);
- }
-
- /**
- * Sets Head Lamp Status
- *
- * @param headLampStatus a VehicleDataResult related to the headlamp status
- */
- public SubscribeVehicleDataResponse setHeadLampStatus(VehicleDataResult headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- return this;
- }
-
- /**
- * Gets Head Lamp Status
- *
- * @return a VehicleDataResult related to the headlamp status
- */
- public VehicleDataResult getHeadLampStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HEAD_LAMP_STATUS);
- }
-
- /**
- * Sets Engine Torque
- *
- * @param engineTorque a VehicleDataResult related to the engine's torque
- */
- public SubscribeVehicleDataResponse setEngineTorque(VehicleDataResult engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- return this;
- }
-
- /**
- * Gets Engine Torque
- *
- * @return a VehicleDataResult related to the engine's torque
- */
- public VehicleDataResult getEngineTorque() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE);
- }
-
- /**
- * Sets Engine Oil Life
- *
- * @param engineOilLife a VehicleDataResult related to the engine's oil life
- */
- public SubscribeVehicleDataResponse setEngineOilLife(VehicleDataResult engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- return this;
- }
-
- /**
- * Gets Engine Oil Life
- *
- * @return a VehicleDataResult related to the engine's oil life
- */
- public VehicleDataResult getEngineOilLife() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_OIL_LIFE);
- }
-
- /**
- * Sets AccPedal Position
- *
- * @param accPedalPosition a VehicleDataResult related to the accelerator pedal's position
- */
- public SubscribeVehicleDataResponse setAccPedalPosition(VehicleDataResult accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- return this;
- }
-
- /**
- * Gets AccPedal Position
- *
- * @return a VehicleDataResult related to the accelerator pedal's position
- */
- public VehicleDataResult getAccPedalPosition() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ACC_PEDAL_POSITION);
- }
-
- public SubscribeVehicleDataResponse setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- return this;
- }
-
- public VehicleDataResult getSteeringWheelAngle() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE);
- }
-
- public SubscribeVehicleDataResponse setECallInfo(VehicleDataResult eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- return this;
- }
-
- public VehicleDataResult getECallInfo() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO);
- }
-
- public SubscribeVehicleDataResponse setAirbagStatus(VehicleDataResult airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- return this;
- }
-
- public VehicleDataResult getAirbagStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS);
- }
-
- public SubscribeVehicleDataResponse setEmergencyEvent(VehicleDataResult emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- return this;
- }
-
- public VehicleDataResult getEmergencyEvent() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT);
- }
-
- /**
- * @deprecated use {@link #setClusterModes(VehicleDataResult clusterMode)} instead.
- */
- @Deprecated
- public SubscribeVehicleDataResponse setClusterModeStatus(VehicleDataResult clusterModeStatus) {
- return setClusterModes(clusterModeStatus);
- }
-
- /**
- * @deprecated use {@link #getClusterModes()} instead.
- */
- @Deprecated
- public VehicleDataResult getClusterModeStatus() {
- return getClusterModes();
- }
-
- /**
- * Sets the status modes of the cluster
- *
- * @param clusterMode the status modes of the cluster
- */
- public SubscribeVehicleDataResponse setClusterModes(VehicleDataResult clusterMode) {
- setParameters(KEY_CLUSTER_MODES, clusterMode);
- return this;
- }
-
- /**
- * Gets the status modes of the cluster
- *
- * @return The status modes of the cluster
- */
- public VehicleDataResult getClusterModes() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODES);
- }
-
- public SubscribeVehicleDataResponse setMyKey(VehicleDataResult myKey) {
- setParameters(KEY_MY_KEY, myKey);
- return this;
- }
-
- public VehicleDataResult getMyKey() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_MY_KEY);
- }
-
- /**
- * Sets the fuelRange.
- *
- * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * @since SmartDeviceLink 5.0.0
- */
- public SubscribeVehicleDataResponse setFuelRange(VehicleDataResult fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- return this;
- }
-
- /**
- * Gets the fuelRange.
- *
- * @return VehicleDataResult The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * @since SmartDeviceLink 5.0.0
- */
- public VehicleDataResult getFuelRange() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE);
- }
-
- /**
- * Sets turnSignal
- *
- * @param turnSignal a VehicleDataResult related to the turn signal status
- */
- public SubscribeVehicleDataResponse setTurnSignal(VehicleDataResult turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- return this;
- }
-
- /**
- * Gets turnSignal
- *
- * @return a VehicleDataResult related to the turn signal status
- */
- public VehicleDataResult getTurnSignal() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets electronicParkBrakeStatus
- *
- * @param electronicParkBrakeStatus a VehicleDataResult related to the electronic park brake status
- */
- public SubscribeVehicleDataResponse setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus) {
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- return this;
- }
-
- /**
- * Gets electronicParkBrakeStatus
- *
- * @return a VehicleDataResult related to the electronic park brake status
- */
- public VehicleDataResult getElectronicParkBrakeStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-
- /**
- * Sets cloudAppVehicleID
- *
- * @param cloudAppVehicleID a VehicleDataResult related to the cloud app vehicle ID
- */
- public SubscribeVehicleDataResponse setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID) {
- setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
- return this;
- }
-
- /**
- * Gets a VehicleDataResult for the subscription response of the CloudAppVehicleID vehicle data item.
- *
- * @return a VehicleDataResult related to the cloud app vehicle ID
- */
- public VehicleDataResult getCloudAppVehicleID() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLOUD_APP_VEHICLE_ID);
- }
-
- /**
- * Sets a value for OEM Custom VehicleData.
- *
- * @param vehicleDataName a String value
- * @param vehicleDataState a VehicleDataResult value
- */
- public SubscribeVehicleDataResponse setOEMCustomVehicleData(String vehicleDataName, VehicleDataResult vehicleDataState) {
- setParameters(vehicleDataName, vehicleDataState);
- return this;
- }
-
- /**
- * Gets a VehicleDataResult for the vehicle data item.
- *
- * @return a VehicleDataResult related to the vehicle data
- */
- public VehicleDataResult getOEMCustomVehicleData(String vehicleDataName) {
- return (VehicleDataResult) getObject(VehicleDataResult.class, vehicleDataName);
- }
-
- /**
- * Sets the handsOffSteering.
- *
- * @param handsOffSteering To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public SubscribeVehicleDataResponse setHandsOffSteering(VehicleDataResult handsOffSteering) {
- setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
- return this;
- }
-
- /**
- * Gets the handsOffSteering.
- *
- * @return VehicleDataResult To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public VehicleDataResult getHandsOffSteering() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HANDS_OFF_STEERING);
- }
-
- /**
- * Sets the gearStatus.
- *
- * @param gearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public SubscribeVehicleDataResponse setGearStatus(VehicleDataResult gearStatus) {
- setParameters(KEY_GEAR_STATUS, gearStatus);
- return this;
- }
-
- /**
- * Gets the gearStatus.
- *
- * @return VehicleDataResult See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public VehicleDataResult getGearStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GEAR_STATUS);
- }
-
- /**
- * Sets the windowStatus.
- *
- * @param windowStatus See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public SubscribeVehicleDataResponse setWindowStatus(VehicleDataResult windowStatus) {
- setParameters(KEY_WINDOW_STATUS, windowStatus);
- return this;
- }
-
- /**
- * Gets the windowStatus.
- *
- * @return VehicleDataResult See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public VehicleDataResult getWindowStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WINDOW_STATUS);
- }
-
- /**
- * Gets the stabilityControlsStatus.
- *
- * @return VehicleDataResult See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public VehicleDataResult getStabilityControlsStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STABILITY_CONTROLS_STATUS);
- }
-
- /**
- * Sets the stabilityControlsStatus.
- *
- * @param stabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public SubscribeVehicleDataResponse setStabilityControlsStatus(VehicleDataResult stabilityControlsStatus) {
- setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
- return this;
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc; + +import androidx.annotation.NonNull; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCResponse; +import com.smartdevicelink.proxy.rpc.enums.Result; + +import java.util.Hashtable; + +/** + * Subscribe Vehicle Data Response is sent, when SubscribeVehicleData has been called + * + * @since SmartDeviceLink 2.0 + */ +public class SubscribeVehicleDataResponse extends RPCResponse { + public static final String KEY_SPEED = "speed"; + public static final String KEY_RPM = "rpm"; + public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature"; + public static final String KEY_PRNDL = "prndl"; + public static final String KEY_TIRE_PRESSURE = "tirePressure"; + public static final String KEY_ENGINE_TORQUE = "engineTorque"; + public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife"; + public static final String KEY_ODOMETER = "odometer"; + public static final String KEY_GPS = "gps"; + public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption"; + public static final String KEY_BELT_STATUS = "beltStatus"; + public static final String KEY_BODY_INFORMATION = "bodyInformation"; + public static final String KEY_DEVICE_STATUS = "deviceStatus"; + public static final String KEY_DRIVER_BRAKING = "driverBraking"; + public static final String KEY_WIPER_STATUS = "wiperStatus"; + public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus"; + public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition"; + public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle"; + public static final String KEY_E_CALL_INFO = "eCallInfo"; + public static final String KEY_AIRBAG_STATUS = "airbagStatus"; + public static final String KEY_EMERGENCY_EVENT = "emergencyEvent"; + @Deprecated + public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus"; + public static final String KEY_CLUSTER_MODES = "clusterModes"; + public static final String KEY_MY_KEY = "myKey"; + public static final String KEY_FUEL_RANGE = "fuelRange"; + public static final String KEY_TURN_SIGNAL = "turnSignal"; + public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus"; + public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID"; + public static final String KEY_GEAR_STATUS = "gearStatus"; + public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering"; + public static final String KEY_WINDOW_STATUS = "windowStatus"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL = "fuelLevel"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State"; + public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus"; + + /** + * @since SmartDeviceLink 7.1.0 + */ + public static final String KEY_SEAT_OCCUPANCY = "seatOccupancy"; + /** + * Constructs a new SubscribeVehicleDataResponse object + */ + public SubscribeVehicleDataResponse() { + super(FunctionID.SUBSCRIBE_VEHICLE_DATA.toString()); + } + + /** + * <p>Constructs a new SubscribeVehicleDataResponse object indicated by the Hashtable + * parameter</p> + * + * @param hash The Hashtable to use + */ + public SubscribeVehicleDataResponse(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Constructs a new SubscribeVehicleDataResponse object + * + * @param success whether the request is successfully processed + * @param resultCode whether the request is successfully processed + */ + public SubscribeVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) { + this(); + setSuccess(success); + setResultCode(resultCode); + } + + /** + * Sets Gps + * + * @param gps a VehicleDataResult related to GPS + */ + public SubscribeVehicleDataResponse setGps(VehicleDataResult gps) { + setParameters(KEY_GPS, gps); + return this; + } + + /** + * Gets Gps + * + * @return a VehicleDataResult related to GPS + */ + public VehicleDataResult getGps() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS); + } + + /** + * Sets Speed + * + * @param speed a VehicleDataResult related to speed + */ + public SubscribeVehicleDataResponse setSpeed(VehicleDataResult speed) { + setParameters(KEY_SPEED, speed); + return this; + } + + /** + * Gets Speed + * + * @return a VehicleDataResult related to speed + */ + public VehicleDataResult getSpeed() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED); + } + + /** + * Sets rpm + * + * @param rpm a VehicleDataResult related to RPM + */ + public SubscribeVehicleDataResponse setRpm(VehicleDataResult rpm) { + setParameters(KEY_RPM, rpm); + return this; + } + + /** + * Gets rpm + * + * @return a VehicleDataResult related to RPM + */ + public VehicleDataResult getRpm() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_RPM); + } + + /** + * Sets the fuelLevel. + * + * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public SubscribeVehicleDataResponse setFuelLevel(VehicleDataResult fuelLevel) { + setParameters(KEY_FUEL_LEVEL, fuelLevel); + return this; + } + + /** + * Gets the fuelLevel. + * + * @return VehicleDataResult The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public VehicleDataResult getFuelLevel() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL); + } + + /** + * Sets Fuel Level State + * + * @param fuelLevelState a VehicleDataResult related to FuelLevel State + */ + @Deprecated + public SubscribeVehicleDataResponse setFuelLevelState(VehicleDataResult fuelLevelState) { + setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState); + return this; + } + + /** + * Gets Fuel Level State + * + * @return a VehicleDataResult related to FuelLevel State + */ + @Deprecated + public VehicleDataResult getFuelLevelState() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE); + } + + /** + * Sets Instant Fuel Consumption + * + * @param instantFuelConsumption a VehicleDataResult related to instant fuel consumption + */ + public SubscribeVehicleDataResponse setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) { + setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption); + return this; + } + + /** + * Gets Instant Fuel Consumption + * + * @return a VehicleDataResult related to instant fuel consumption + */ + public VehicleDataResult getInstantFuelConsumption() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_INSTANT_FUEL_CONSUMPTION); + } + + /** + * Sets External Temperature + * + * @param externalTemperature a VehicleDataResult related to external temperature + */ + public SubscribeVehicleDataResponse setExternalTemperature(VehicleDataResult externalTemperature) { + setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature); + return this; + } + + /** + * Gets External Temperature + * + * @return a VehicleDataResult related to external temperature + */ + public VehicleDataResult getExternalTemperature() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE); + } + + /** + * Sets the prndl. + * + * @param prndl See PRNDL. This parameter is deprecated and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public SubscribeVehicleDataResponse setPrndl(VehicleDataResult prndl) { + setParameters(KEY_PRNDL, prndl); + return this; + } + + /** + * Gets the prndl. + * + * @return VehicleDataResult See PRNDL. This parameter is deprecated and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public VehicleDataResult getPrndl() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL); + } + + /** + * Sets Tire Pressure + * + * @param tirePressure a VehicleDataResult related to tire pressure + */ + public SubscribeVehicleDataResponse setTirePressure(VehicleDataResult tirePressure) { + setParameters(KEY_TIRE_PRESSURE, tirePressure); + return this; + } + + /** + * Gets Tire Pressure + * + * @return a VehicleDataResult related to tire pressure + */ + public VehicleDataResult getTirePressure() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE); + } + + /** + * Sets Odometer + * + * @param odometer a VehicleDataResult related to the odometer + */ + public SubscribeVehicleDataResponse setOdometer(VehicleDataResult odometer) { + setParameters(KEY_ODOMETER, odometer); + return this; + } + + /** + * Gets Odometer + * + * @return a VehicleDataResult related to the odometer + */ + public VehicleDataResult getOdometer() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER); + } + + /** + * Sets Belt Status + * + * @param beltStatus a VehicleDataResult related to the seat belt status + */ + public SubscribeVehicleDataResponse setBeltStatus(VehicleDataResult beltStatus) { + setParameters(KEY_BELT_STATUS, beltStatus); + return this; + } + + /** + * Gets Belt Status + * + * @return a VehicleDataResult related to the seat belt status + */ + public VehicleDataResult getBeltStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BELT_STATUS); + } + + /** + * Sets Body Information + * + * @param bodyInformation a VehicleDataResult related to the body info + */ + public SubscribeVehicleDataResponse setBodyInformation(VehicleDataResult bodyInformation) { + setParameters(KEY_BODY_INFORMATION, bodyInformation); + return this; + } + + /** + * Gets Body Information + * + * @return a VehicleDataResult related to the body info + */ + public VehicleDataResult getBodyInformation() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION); + } + + /** + * Sets Device Status + * + * @param deviceStatus a VehicleDataResult related to the device status of the connected device + */ + public SubscribeVehicleDataResponse setDeviceStatus(VehicleDataResult deviceStatus) { + setParameters(KEY_DEVICE_STATUS, deviceStatus); + return this; + } + + /** + * Gets Device Status + * + * @return a VehicleDataResult related to the device status of the connected device + */ + public VehicleDataResult getDeviceStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DEVICE_STATUS); + } + + /** + * Sets Driver Braking + * + * @param driverBraking a VehicleDataResult related to the driver breaking status + */ + public SubscribeVehicleDataResponse setDriverBraking(VehicleDataResult driverBraking) { + setParameters(KEY_DRIVER_BRAKING, driverBraking); + return this; + } + + /** + * Gets Driver Braking + * + * @return a VehicleDataResult related to the driver breaking status + */ + public VehicleDataResult getDriverBraking() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DRIVER_BRAKING); + } + + /** + * Sets Wiper Status + * + * @param wiperStatus a VehicleDataResult related to the wiper status + */ + public SubscribeVehicleDataResponse setWiperStatus(VehicleDataResult wiperStatus) { + setParameters(KEY_WIPER_STATUS, wiperStatus); + return this; + } + + /** + * Gets Wiper Status + * + * @return a VehicleDataResult related to the wiper status + */ + public VehicleDataResult getWiperStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS); + } + + /** + * Sets Head Lamp Status + * + * @param headLampStatus a VehicleDataResult related to the headlamp status + */ + public SubscribeVehicleDataResponse setHeadLampStatus(VehicleDataResult headLampStatus) { + setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus); + return this; + } + + /** + * Gets Head Lamp Status + * + * @return a VehicleDataResult related to the headlamp status + */ + public VehicleDataResult getHeadLampStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HEAD_LAMP_STATUS); + } + + /** + * Sets Engine Torque + * + * @param engineTorque a VehicleDataResult related to the engine's torque + */ + public SubscribeVehicleDataResponse setEngineTorque(VehicleDataResult engineTorque) { + setParameters(KEY_ENGINE_TORQUE, engineTorque); + return this; + } + + /** + * Gets Engine Torque + * + * @return a VehicleDataResult related to the engine's torque + */ + public VehicleDataResult getEngineTorque() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE); + } + + /** + * Sets Engine Oil Life + * + * @param engineOilLife a VehicleDataResult related to the engine's oil life + */ + public SubscribeVehicleDataResponse setEngineOilLife(VehicleDataResult engineOilLife) { + setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife); + return this; + } + + /** + * Gets Engine Oil Life + * + * @return a VehicleDataResult related to the engine's oil life + */ + public VehicleDataResult getEngineOilLife() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_OIL_LIFE); + } + + /** + * Sets AccPedal Position + * + * @param accPedalPosition a VehicleDataResult related to the accelerator pedal's position + */ + public SubscribeVehicleDataResponse setAccPedalPosition(VehicleDataResult accPedalPosition) { + setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition); + return this; + } + + /** + * Gets AccPedal Position + * + * @return a VehicleDataResult related to the accelerator pedal's position + */ + public VehicleDataResult getAccPedalPosition() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ACC_PEDAL_POSITION); + } + + public SubscribeVehicleDataResponse setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) { + setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle); + return this; + } + + public VehicleDataResult getSteeringWheelAngle() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE); + } + + public SubscribeVehicleDataResponse setECallInfo(VehicleDataResult eCallInfo) { + setParameters(KEY_E_CALL_INFO, eCallInfo); + return this; + } + + public VehicleDataResult getECallInfo() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO); + } + + public SubscribeVehicleDataResponse setAirbagStatus(VehicleDataResult airbagStatus) { + setParameters(KEY_AIRBAG_STATUS, airbagStatus); + return this; + } + + public VehicleDataResult getAirbagStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS); + } + + public SubscribeVehicleDataResponse setEmergencyEvent(VehicleDataResult emergencyEvent) { + setParameters(KEY_EMERGENCY_EVENT, emergencyEvent); + return this; + } + + public VehicleDataResult getEmergencyEvent() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT); + } + + /** + * @deprecated use {@link #setClusterModes(VehicleDataResult clusterMode)} instead. + */ + @Deprecated + public SubscribeVehicleDataResponse setClusterModeStatus(VehicleDataResult clusterModeStatus) { + return setClusterModes(clusterModeStatus); + } + + /** + * @deprecated use {@link #getClusterModes()} instead. + */ + @Deprecated + public VehicleDataResult getClusterModeStatus() { + return getClusterModes(); + } + + /** + * Sets the status modes of the cluster + * + * @param clusterMode the status modes of the cluster + */ + public SubscribeVehicleDataResponse setClusterModes(VehicleDataResult clusterMode) { + setParameters(KEY_CLUSTER_MODES, clusterMode); + return this; + } + + /** + * Gets the status modes of the cluster + * + * @return The status modes of the cluster + */ + public VehicleDataResult getClusterModes() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODES); + } + + public SubscribeVehicleDataResponse setMyKey(VehicleDataResult myKey) { + setParameters(KEY_MY_KEY, myKey); + return this; + } + + public VehicleDataResult getMyKey() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_MY_KEY); + } + + /** + * Sets the fuelRange. + * + * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * @since SmartDeviceLink 5.0.0 + */ + public SubscribeVehicleDataResponse setFuelRange(VehicleDataResult fuelRange) { + setParameters(KEY_FUEL_RANGE, fuelRange); + return this; + } + + /** + * Gets the fuelRange. + * + * @return VehicleDataResult The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * @since SmartDeviceLink 5.0.0 + */ + public VehicleDataResult getFuelRange() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE); + } + + /** + * Sets turnSignal + * + * @param turnSignal a VehicleDataResult related to the turn signal status + */ + public SubscribeVehicleDataResponse setTurnSignal(VehicleDataResult turnSignal) { + setParameters(KEY_TURN_SIGNAL, turnSignal); + return this; + } + + /** + * Gets turnSignal + * + * @return a VehicleDataResult related to the turn signal status + */ + public VehicleDataResult getTurnSignal() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL); + } + + /** + * Sets electronicParkBrakeStatus + * + * @param electronicParkBrakeStatus a VehicleDataResult related to the electronic park brake status + */ + public SubscribeVehicleDataResponse setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus) { + setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); + return this; + } + + /** + * Gets electronicParkBrakeStatus + * + * @return a VehicleDataResult related to the electronic park brake status + */ + public VehicleDataResult getElectronicParkBrakeStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS); + } + + /** + * Sets cloudAppVehicleID + * + * @param cloudAppVehicleID a VehicleDataResult related to the cloud app vehicle ID + */ + public SubscribeVehicleDataResponse setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID) { + setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID); + return this; + } + + /** + * Gets a VehicleDataResult for the subscription response of the CloudAppVehicleID vehicle data item. + * + * @return a VehicleDataResult related to the cloud app vehicle ID + */ + public VehicleDataResult getCloudAppVehicleID() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLOUD_APP_VEHICLE_ID); + } + + /** + * Sets a value for OEM Custom VehicleData. + * + * @param vehicleDataName a String value + * @param vehicleDataState a VehicleDataResult value + */ + public SubscribeVehicleDataResponse setOEMCustomVehicleData(String vehicleDataName, VehicleDataResult vehicleDataState) { + setParameters(vehicleDataName, vehicleDataState); + return this; + } + + /** + * Gets a VehicleDataResult for the vehicle data item. + * + * @return a VehicleDataResult related to the vehicle data + */ + public VehicleDataResult getOEMCustomVehicleData(String vehicleDataName) { + return (VehicleDataResult) getObject(VehicleDataResult.class, vehicleDataName); + } + + /** + * Sets the handsOffSteering. + * + * @param handsOffSteering To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public SubscribeVehicleDataResponse setHandsOffSteering(VehicleDataResult handsOffSteering) { + setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering); + return this; + } + + /** + * Gets the handsOffSteering. + * + * @return VehicleDataResult To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public VehicleDataResult getHandsOffSteering() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HANDS_OFF_STEERING); + } + + /** + * Sets the gearStatus. + * + * @param gearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public SubscribeVehicleDataResponse setGearStatus(VehicleDataResult gearStatus) { + setParameters(KEY_GEAR_STATUS, gearStatus); + return this; + } + + /** + * Gets the gearStatus. + * + * @return VehicleDataResult See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public VehicleDataResult getGearStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GEAR_STATUS); + } + + /** + * Sets the windowStatus. + * + * @param windowStatus See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public SubscribeVehicleDataResponse setWindowStatus(VehicleDataResult windowStatus) { + setParameters(KEY_WINDOW_STATUS, windowStatus); + return this; + } + + /** + * Gets the windowStatus. + * + * @return VehicleDataResult See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public VehicleDataResult getWindowStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WINDOW_STATUS); + } + + /** + * Gets the stabilityControlsStatus. + * + * @return VehicleDataResult See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public VehicleDataResult getStabilityControlsStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STABILITY_CONTROLS_STATUS); + } + + /** + * Sets the stabilityControlsStatus. + * + * @param stabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public SubscribeVehicleDataResponse setStabilityControlsStatus(VehicleDataResult stabilityControlsStatus) { + setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus); + return this; + } + + /** + * Sets the seatOccupancy. + * + * @param seatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public SubscribeVehicleDataResponse setSeatOccupancy(VehicleDataResult seatOccupancy) { + setParameters(KEY_SEAT_OCCUPANCY, seatOccupancy); + return this; + } + + /** + * Gets the seatOccupancy. + * + * @return VehicleDataResult See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public VehicleDataResult getSeatOccupancy() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SEAT_OCCUPANCY); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java index 226499364..6ef981a58 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java @@ -1,1018 +1,1053 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCRequest;
-
-import java.util.Hashtable;
-
-/**
- * This function is used to unsubscribe the notifications from the
- * subscribeVehicleData function
- * <p>Function Group: Location, VehicleInfo and DrivingChara</p>
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
- *
- * <p><b>Parameter List</b></p>
- * <table border="1" rules="all">
- * <tr>
- * <th>Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Reg.</th>
- * <th>Notes</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>gps</td>
- * <td>Boolean</td>
- * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData} for details</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>speed</td>
- * <td>Boolean</td>
- * <td>The vehicle speed in kilometers per hour</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>rpm</td>
- * <td>Boolean</td>
- * <td>The number of revolutions per minute of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>fuelLevel</td>
- * <td>Boolean</td>
- * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>fuelLevel_State</td>
- * <td>Boolean</td>
- * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>fuelRange</td>
- * <td>Boolean</td>
- * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0.0</td>
- * </tr>
- * <tr>
- * <td>instantFuelConsumption</td>
- * <td>Boolean</td>
- * <td>The instantaneous fuel consumption in micro litres</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>externalTemperature</td>
- * <td>Boolean</td>
- * <td>The external temperature in degrees celsius</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>gearStatus</td>
- * <td>Boolean</td>
- * <td>See GearStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>prndl</td>
- * <td>Boolean</td>
- * <td>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>tirePressure</td>
- * <td>Boolean</td>
- * <td>Tire pressure status</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>odometer</td>
- * <td>Boolean</td>
- * <td>Odometer in km</td>
- * <td>N</td>
- * <td>Max Length: 500</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>beltStatus</td>
- * <td>Boolean</td>
- * <td>The status of the seat belts</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>bodyInformation</td>
- * <td>Boolean</td>
- * <td>The body information including ignition status and internal temp</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>deviceStatus</td>
- * <td>Boolean</td>
- * <td>The device status including signal and battery strength</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>driverBraking</td>
- * <td>Boolean</td>
- * <td>The status of the brake pedal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>wiperStatus</td>
- * <td>Boolean</td>
- * <td>The status of the wipers</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>headLampStatus</td>
- * <td>Boolean</td>
- * <td>Status of the head lamps</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>engineTorque</td>
- * <td>Boolean</td>
- * <td>Torque value for engine (in Nm) on non-diesel variants</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>engineOilLife</td>
- * <td>Boolean</td>
- * <td>The estimated percentage of remaining oil life of the engine</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0 </td>
- * </tr>
- * <tr>
- * <td>accPedalPosition</td>
- * <td>Boolean</td>
- * <td>Accelerator pedal position (percentage depressed)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>steeringWheelAngle</td>
- * <td>Boolean</td>
- * <td>Current angle of the steering wheel (in deg)</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>eCallInfo</td>
- * <td>Boolean</td>
- * <td>Emergency Call notification and confirmation data.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>airbagStatus</td>
- * <td>Boolean</td>
- * <td>The status of the air bags.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>emergencyEvent</td>
- * <td>Boolean</td>
- * <td>Information related to an emergency event (and if it occurred).</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>clusterModeStatus</td>
- * <td>Boolean</td>
- * <td>The status modes of the instrument panel cluster.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>myKey</td>
- * <td>Boolean</td>
- * <td>Information related to the MyKey feature.</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
- * </tr>
- * <tr>
- * <td>turnSignal</td>
- * <td>Boolean</td>
- * <td>@see TurnSignal</td>
- * <td>N</td>
- * <td>Subscribable</td>
- * <td>SmartDeviceLink 5.0 </td>
- * </tr>
- * <tr>
- * <td>handsOffSteering</td>
- * <td>Boolean</td>
- * <td>To indicate whether driver hands are off the steering wheel</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>windowStatus</td>
- * <td>Boolean</td>
- * <td>See WindowStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- * <tr>
- * <td>stabilityControlsStatus</td>
- * <td>Boolean</td>
- * <td>See StabilityControlsStatus</td>
- * <td>N</td>
- * <td>SmartDeviceLink 7.0.0</td>
- * </tr>
- *
- *
- * </table>
- * <p><b> Response</b></p>
- * <p><b>Non-default Result Codes:</b></p>
- * <p>SUCCESS</p>
- * <p>WARNINGS</p>
- * <p>INVALID_DATA</p>
- * <p>OUT_OF_MEMORY</p>
- * <p>TOO_MANY_PENDING_REQUESTS</p>
- * <p>APPLICATION_NOT_REGISTERED</p>
- * <p>GENERIC_ERROR</p>
- * <p>IGNORED</p>
- * <p>DISALLOWED</p>
- *
- * @see SubscribeVehicleData
- * @see GetVehicleData
- * @since SmartDeviceLink 2.0
- */
-public class UnsubscribeVehicleData extends RPCRequest {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
- public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
- public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
- public static final String KEY_GEAR_STATUS = "gearStatus";
- public static final String KEY_WINDOW_STATUS = "windowStatus";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
-
- /**
- * Constructs a new UnsubscribeVehicleData object
- */
- public UnsubscribeVehicleData() {
- super(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString());
- }
-
- /**
- * Constructs a new UnsubscribeVehicleData object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash The Hashtable to use
- */
- public UnsubscribeVehicleData(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from Gps data
- *
- * @param gps a boolean value
- */
- public UnsubscribeVehicleData setGps(Boolean gps) {
- setParameters(KEY_GPS, gps);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Gps data has been unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Gps data has been
- * unsubscribed.
- */
- public Boolean getGps() {
- return getBoolean(KEY_GPS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from speed data
- *
- * @param speed a boolean value
- */
- public UnsubscribeVehicleData setSpeed(Boolean speed) {
- setParameters(KEY_SPEED, speed);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Speed data has been unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Speed data has been
- * unsubscribed.
- */
- public Boolean getSpeed() {
- return getBoolean(KEY_SPEED);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribe data
- *
- * @param rpm a boolean value
- */
- public UnsubscribeVehicleData setRpm(Boolean rpm) {
- setParameters(KEY_RPM, rpm);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the rpm data has been unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the rpm data has been
- * unsubscribed.
- */
- public Boolean getRpm() {
- return getBoolean(KEY_RPM);
- }
-
- /**
- * Sets the fuelLevel.
- *
- * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public UnsubscribeVehicleData setFuelLevel(Boolean fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- return this;
- }
-
- /**
- * Gets the fuelLevel.
- *
- * @return Boolean The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public Boolean getFuelLevel() {
- return getBoolean(KEY_FUEL_LEVEL);
- }
-
- /**
- * Sets the fuelRange.
- *
- * @param fuelLevelState The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * @since SmartDeviceLink 5.0.0
- */
- @Deprecated
- public UnsubscribeVehicleData setFuelLevelState(Boolean fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- return this;
- }
-
- /**
- * Gets the fuelRange.
- *
- * @return Boolean The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * @since SmartDeviceLink 5.0.0
- */
- @Deprecated
- public Boolean getFuelLevelState() {
- return getBoolean(KEY_FUEL_LEVEL_STATE);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from instantFuelConsumption data
- *
- * @param instantFuelConsumption a boolean value
- */
- public UnsubscribeVehicleData setInstantFuelConsumption(Boolean instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the getInstantFuelConsumption data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the getInstantFuelConsumption data
- * has been unsubscribed.
- */
- public Boolean getInstantFuelConsumption() {
- return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from externalTemperature data
- *
- * @param externalTemperature a boolean value
- */
- public UnsubscribeVehicleData setExternalTemperature(Boolean externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the externalTemperature data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the externalTemperature data
- * has been unsubscribed.
- */
- public Boolean getExternalTemperature() {
- return getBoolean(KEY_EXTERNAL_TEMPERATURE);
- }
-
- /**
- * Sets the prndl.
- *
- * @param prndl See PRNDL. This parameter since SmartDeviceLink 7.0.0 is deprecated and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public UnsubscribeVehicleData setPrndl(Boolean prndl) {
- setParameters(KEY_PRNDL, prndl);
- return this;
- }
-
- /**
- * Gets the prndl.
- *
- * @return Boolean See PRNDL. This parameter is deprecated since SmartDeviceLink 7.0.0 and it is now covered in `gearStatus`
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public Boolean getPrndl() {
- return getBoolean(KEY_PRNDL);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from tire pressure status data
- *
- * @param tirePressure a boolean value
- */
- public UnsubscribeVehicleData setTirePressure(Boolean tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the tire pressure status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the tire pressure status data
- * has been unsubscribed.
- */
- public Boolean getTirePressure() {
- return getBoolean(KEY_TIRE_PRESSURE);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from odometer data
- *
- * @param odometer a boolean value
- */
- public UnsubscribeVehicleData setOdometer(Boolean odometer) {
- setParameters(KEY_ODOMETER, odometer);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the odometer data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the odometer data
- * has been unsubscribed.
- */
- public Boolean getOdometer() {
- return getBoolean(KEY_ODOMETER);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from belt Status data
- *
- * @param beltStatus a boolean value
- */
- public UnsubscribeVehicleData setBeltStatus(Boolean beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the belt Status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the belt Status data
- * has been unsubscribed.
- */
- public Boolean getBeltStatus() {
- return getBoolean(KEY_BELT_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from body Information data
- *
- * @param bodyInformation a boolean value
- */
- public UnsubscribeVehicleData setBodyInformation(Boolean bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the body Information data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the body Information data
- * has been unsubscribed.
- */
- public Boolean getBodyInformation() {
- return getBoolean(KEY_BODY_INFORMATION);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from device Status data
- *
- * @param deviceStatus a boolean value
- */
- public UnsubscribeVehicleData setDeviceStatus(Boolean deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the device Status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the device Status data
- * has been unsubscribed.
- */
- public Boolean getDeviceStatus() {
- return getBoolean(KEY_DEVICE_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from driver Braking data
- *
- * @param driverBraking a boolean value
- */
- public UnsubscribeVehicleData setDriverBraking(Boolean driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the driver Braking data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the driver Braking data
- * has been unsubscribed.
- */
- public Boolean getDriverBraking() {
- return getBoolean(KEY_DRIVER_BRAKING);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from wiper Status data
- *
- * @param wiperStatus a boolean value
- */
- public UnsubscribeVehicleData setWiperStatus(Boolean wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the wiper Status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the wiper Status data
- * has been unsubscribed.
- */
- public Boolean getWiperStatus() {
- return getBoolean(KEY_WIPER_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from Head Lamp Status data
- *
- * @param headLampStatus a boolean value
- */
- public UnsubscribeVehicleData setHeadLampStatus(Boolean headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Head Lamp Status data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Head Lamp Status data
- * has been unsubscribed.
- */
- public Boolean getHeadLampStatus() {
- return getBoolean(KEY_HEAD_LAMP_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from Engine Torque data
- *
- * @param engineTorque a boolean value
- */
- public UnsubscribeVehicleData setEngineTorque(Boolean engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Engine Torque data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Engine Torque data
- * has been unsubscribed.
- */
- public Boolean getEngineTorque() {
- return getBoolean(KEY_ENGINE_TORQUE);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from Engine Oil Life data
- *
- * @param engineOilLife a boolean value
- */
- public UnsubscribeVehicleData setEngineOilLife(Boolean engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the Engine Oil Life data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the Engine Oil Life data
- * has been unsubscribed.
- */
- public Boolean getEngineOilLife() {
- return getBoolean(KEY_ENGINE_OIL_LIFE);
- }
-
-
- /**
- * Sets a boolean value. If true, unsubscribes from accPedalPosition data
- *
- * @param accPedalPosition a boolean value
- */
- public UnsubscribeVehicleData setAccPedalPosition(Boolean accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the accPedalPosition data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the accPedalPosition data
- * has been unsubscribed.
- */
- public Boolean getAccPedalPosition() {
- return getBoolean(KEY_ACC_PEDAL_POSITION);
- }
-
- public UnsubscribeVehicleData setSteeringWheelAngle(Boolean steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- return this;
- }
-
- public Boolean getSteeringWheelAngle() {
- return getBoolean(KEY_STEERING_WHEEL_ANGLE);
- }
-
- public UnsubscribeVehicleData setECallInfo(Boolean eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- return this;
- }
-
- public Boolean getECallInfo() {
- return getBoolean(KEY_E_CALL_INFO);
- }
-
- public UnsubscribeVehicleData setAirbagStatus(Boolean airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- return this;
- }
-
- public Boolean getAirbagStatus() {
- return getBoolean(KEY_AIRBAG_STATUS);
- }
-
- public UnsubscribeVehicleData setEmergencyEvent(Boolean emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- return this;
- }
-
- public Boolean getEmergencyEvent() {
- return getBoolean(KEY_EMERGENCY_EVENT);
- }
-
- public UnsubscribeVehicleData setClusterModeStatus(Boolean clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
- return this;
- }
-
- public Boolean getClusterModeStatus() {
- return getBoolean(KEY_CLUSTER_MODE_STATUS);
- }
-
- public UnsubscribeVehicleData setMyKey(Boolean myKey) {
- setParameters(KEY_MY_KEY, myKey);
- return this;
- }
-
- public Boolean getMyKey() {
- return getBoolean(KEY_MY_KEY);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from fuelRange data
- *
- * @param fuelRange a boolean value
- */
- public UnsubscribeVehicleData setFuelRange(Boolean fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the fuelRange data has been
- * unsubscribed.
- *
- * @return Boolean -a Boolean value. If true, means the fuelRange data
- * has been unsubscribed.
- */
- public Boolean getFuelRange() {
- return getBoolean(KEY_FUEL_RANGE);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from turnSignal data
- *
- * @param turnSignal a boolean value
- */
- public UnsubscribeVehicleData setTurnSignal(Boolean turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the turnSignal data has been unsubscribed.
- *
- * @return a Boolean value.
- */
- public Boolean getTurnSignal() {
- return getBoolean(KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from electronicParkBrakeStatus data
- *
- * @param electronicParkBrakeStatus a boolean value
- */
- public UnsubscribeVehicleData setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus) {
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
- *
- * @return a Boolean value.
- */
- public Boolean getElectronicParkBrakeStatus() {
- return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-
- /**
- * Sets a boolean value. If true, unsubscribes from cloudAppVehicleID data
- *
- * @param cloudAppVehicleID a boolean value.
- */
- public UnsubscribeVehicleData setCloudAppVehicleID(boolean cloudAppVehicleID) {
- setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
- return this;
- }
-
- /**
- * Gets a boolean value. If true, means the cloudAppVehicleID data has been unsubscribed.
- *
- * @return a Boolean value.
- */
- public Boolean getCloudAppVehicleID() {
- return getBoolean(KEY_CLOUD_APP_VEHICLE_ID);
- }
-
- /**
- * Sets a boolean value for OEM Custom VehicleData.
- *
- * @param vehicleDataName a String value
- * @param vehicleDataState a boolean value
- */
- public UnsubscribeVehicleData setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState) {
- setParameters(vehicleDataName, vehicleDataState);
- return this;
- }
-
- /**
- * Gets a boolean value for OEM Custom VehicleData.
- *
- * @return a Boolean value.
- */
- public Boolean getOEMCustomVehicleData(String vehicleDataName) {
- return getBoolean(vehicleDataName);
- }
-
- /**
- * Sets the gearStatus.
- *
- * @param gearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public UnsubscribeVehicleData setGearStatus(Boolean gearStatus) {
- setParameters(KEY_GEAR_STATUS, gearStatus);
- return this;
- }
-
- /**
- * Gets the gearStatus.
- *
- * @return Boolean See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getGearStatus() {
- return getBoolean(KEY_GEAR_STATUS);
- }
-
- /**
- * Sets the handsOffSteering.
- *
- * @param handsOffSteering To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public UnsubscribeVehicleData setHandsOffSteering(Boolean handsOffSteering) {
- setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
- return this;
- }
-
- /**
- * Gets the handsOffSteering.
- *
- * @return Boolean To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getHandsOffSteering() {
- return getBoolean(KEY_HANDS_OFF_STEERING);
- }
-
- /**
- * Sets the windowStatus.
- *
- * @param windowStatus See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public UnsubscribeVehicleData setWindowStatus(Boolean windowStatus) {
- setParameters(KEY_WINDOW_STATUS, windowStatus);
- return this;
- }
-
- /**
- * Gets the windowStatus.
- *
- * @return Boolean See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getWindowStatus() {
- return getBoolean(KEY_WINDOW_STATUS);
- }
-
- /**
- * Sets the stabilityControlsStatus.
- *
- * @param stabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public UnsubscribeVehicleData setStabilityControlsStatus(Boolean stabilityControlsStatus) {
- setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
- return this;
- }
-
- /**
- * Gets the stabilityControlsStatus.
- *
- * @return Boolean See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public Boolean getStabilityControlsStatus() {
- return getBoolean(KEY_STABILITY_CONTROLS_STATUS);
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCRequest; + +import java.util.Hashtable; + +/** + * This function is used to unsubscribe the notifications from the + * subscribeVehicleData function + * <p>Function Group: Location, VehicleInfo and DrivingChara</p> + * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p> + * + * <p><b>Parameter List</b></p> + * <table border="1" rules="all"> + * <tr> + * <th>Name</th> + * <th>Type</th> + * <th>Description</th> + * <th>Reg.</th> + * <th>Notes</th> + * <th>Version</th> + * </tr> + * <tr> + * <td>gps</td> + * <td>Boolean</td> + * <td>GPS data. See {@linkplain com.smartdevicelink.proxy.rpc.GPSData} for details</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>speed</td> + * <td>Boolean</td> + * <td>The vehicle speed in kilometers per hour</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>rpm</td> + * <td>Boolean</td> + * <td>The number of revolutions per minute of the engine</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>fuelLevel</td> + * <td>Boolean</td> + * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>fuelLevel_State</td> + * <td>Boolean</td> + * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>fuelRange</td> + * <td>Boolean</td> + * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0.0</td> + * </tr> + * <tr> + * <td>instantFuelConsumption</td> + * <td>Boolean</td> + * <td>The instantaneous fuel consumption in micro litres</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>externalTemperature</td> + * <td>Boolean</td> + * <td>The external temperature in degrees celsius</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>gearStatus</td> + * <td>Boolean</td> + * <td>See GearStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>prndl</td> + * <td>Boolean</td> + * <td>See PRNDL. This parameter is deprecated and it is now covered in `gearStatus`</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>tirePressure</td> + * <td>Boolean</td> + * <td>Tire pressure status</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>odometer</td> + * <td>Boolean</td> + * <td>Odometer in km</td> + * <td>N</td> + * <td>Max Length: 500</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>beltStatus</td> + * <td>Boolean</td> + * <td>The status of the seat belts</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>bodyInformation</td> + * <td>Boolean</td> + * <td>The body information including ignition status and internal temp</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>deviceStatus</td> + * <td>Boolean</td> + * <td>The device status including signal and battery strength</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>driverBraking</td> + * <td>Boolean</td> + * <td>The status of the brake pedal</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>wiperStatus</td> + * <td>Boolean</td> + * <td>The status of the wipers</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>headLampStatus</td> + * <td>Boolean</td> + * <td>Status of the head lamps</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>engineTorque</td> + * <td>Boolean</td> + * <td>Torque value for engine (in Nm) on non-diesel variants</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>engineOilLife</td> + * <td>Boolean</td> + * <td>The estimated percentage of remaining oil life of the engine</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0 </td> + * </tr> + * <tr> + * <td>accPedalPosition</td> + * <td>Boolean</td> + * <td>Accelerator pedal position (percentage depressed)</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>steeringWheelAngle</td> + * <td>Boolean</td> + * <td>Current angle of the steering wheel (in deg)</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>eCallInfo</td> + * <td>Boolean</td> + * <td>Emergency Call notification and confirmation data.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>airbagStatus</td> + * <td>Boolean</td> + * <td>The status of the air bags.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>emergencyEvent</td> + * <td>Boolean</td> + * <td>Information related to an emergency event (and if it occurred).</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>clusterModeStatus</td> + * <td>Boolean</td> + * <td>The status modes of the instrument panel cluster.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>myKey</td> + * <td>Boolean</td> + * <td>Information related to the MyKey feature.</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 2.0 </td> + * </tr> + * <tr> + * <td>turnSignal</td> + * <td>Boolean</td> + * <td>@see TurnSignal</td> + * <td>N</td> + * <td>Subscribable</td> + * <td>SmartDeviceLink 5.0 </td> + * </tr> + * <tr> + * <td>handsOffSteering</td> + * <td>Boolean</td> + * <td>To indicate whether driver hands are off the steering wheel</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>windowStatus</td> + * <td>Boolean</td> + * <td>See WindowStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>stabilityControlsStatus</td> + * <td>Boolean</td> + * <td>See StabilityControlsStatus</td> + * <td>N</td> + * <td>SmartDeviceLink 7.0.0</td> + * </tr> + * <tr> + * <td>seatOccupancy</td> + * <td>Boolean</td> + * <td>See SeatOccupancy</td> + * <td>N</td> + * <td></td> + * <td> + * @since SmartDeviceLink 7.1.0 + * </td> + * </tr> + * + * + * </table> + * <p><b> Response</b></p> + * <p><b>Non-default Result Codes:</b></p> + * <p>SUCCESS</p> + * <p>WARNINGS</p> + * <p>INVALID_DATA</p> + * <p>OUT_OF_MEMORY</p> + * <p>TOO_MANY_PENDING_REQUESTS</p> + * <p>APPLICATION_NOT_REGISTERED</p> + * <p>GENERIC_ERROR</p> + * <p>IGNORED</p> + * <p>DISALLOWED</p> + * + * @see SubscribeVehicleData + * @see GetVehicleData + * @since SmartDeviceLink 2.0 + */ +public class UnsubscribeVehicleData extends RPCRequest { + public static final String KEY_SPEED = "speed"; + public static final String KEY_RPM = "rpm"; + public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature"; + public static final String KEY_PRNDL = "prndl"; + public static final String KEY_TIRE_PRESSURE = "tirePressure"; + public static final String KEY_ENGINE_TORQUE = "engineTorque"; + public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife"; + public static final String KEY_ODOMETER = "odometer"; + public static final String KEY_GPS = "gps"; + public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption"; + public static final String KEY_BELT_STATUS = "beltStatus"; + public static final String KEY_BODY_INFORMATION = "bodyInformation"; + public static final String KEY_DEVICE_STATUS = "deviceStatus"; + public static final String KEY_DRIVER_BRAKING = "driverBraking"; + public static final String KEY_WIPER_STATUS = "wiperStatus"; + public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus"; + public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition"; + public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle"; + public static final String KEY_E_CALL_INFO = "eCallInfo"; + public static final String KEY_AIRBAG_STATUS = "airbagStatus"; + public static final String KEY_EMERGENCY_EVENT = "emergencyEvent"; + public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus"; + public static final String KEY_MY_KEY = "myKey"; + public static final String KEY_FUEL_RANGE = "fuelRange"; + public static final String KEY_TURN_SIGNAL = "turnSignal"; + public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus"; + public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID"; + public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering"; + public static final String KEY_GEAR_STATUS = "gearStatus"; + public static final String KEY_WINDOW_STATUS = "windowStatus"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL = "fuelLevel"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State"; + public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus"; + /** + * @since SmartDeviceLink 7.1.0 + */ + public static final String KEY_SEAT_OCCUPANCY = "seatOccupancy"; + + /** + * Constructs a new UnsubscribeVehicleData object + */ + public UnsubscribeVehicleData() { + super(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString()); + } + + /** + * Constructs a new UnsubscribeVehicleData object indicated by the Hashtable + * parameter + * <p></p> + * + * @param hash The Hashtable to use + */ + public UnsubscribeVehicleData(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Sets a boolean value. If true, unsubscribes from Gps data + * + * @param gps a boolean value + */ + public UnsubscribeVehicleData setGps(Boolean gps) { + setParameters(KEY_GPS, gps); + return this; + } + + /** + * Gets a boolean value. If true, means the Gps data has been unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the Gps data has been + * unsubscribed. + */ + public Boolean getGps() { + return getBoolean(KEY_GPS); + } + + /** + * Sets a boolean value. If true, unsubscribes from speed data + * + * @param speed a boolean value + */ + public UnsubscribeVehicleData setSpeed(Boolean speed) { + setParameters(KEY_SPEED, speed); + return this; + } + + /** + * Gets a boolean value. If true, means the Speed data has been unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the Speed data has been + * unsubscribed. + */ + public Boolean getSpeed() { + return getBoolean(KEY_SPEED); + } + + /** + * Sets a boolean value. If true, unsubscribe data + * + * @param rpm a boolean value + */ + public UnsubscribeVehicleData setRpm(Boolean rpm) { + setParameters(KEY_RPM, rpm); + return this; + } + + /** + * Gets a boolean value. If true, means the rpm data has been unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the rpm data has been + * unsubscribed. + */ + public Boolean getRpm() { + return getBoolean(KEY_RPM); + } + + /** + * Sets the fuelLevel. + * + * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public UnsubscribeVehicleData setFuelLevel(Boolean fuelLevel) { + setParameters(KEY_FUEL_LEVEL, fuelLevel); + return this; + } + + /** + * Gets the fuelLevel. + * + * @return Boolean The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public Boolean getFuelLevel() { + return getBoolean(KEY_FUEL_LEVEL); + } + + /** + * Sets the fuelRange. + * + * @param fuelLevelState The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * @since SmartDeviceLink 5.0.0 + */ + @Deprecated + public UnsubscribeVehicleData setFuelLevelState(Boolean fuelLevelState) { + setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState); + return this; + } + + /** + * Gets the fuelRange. + * + * @return Boolean The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * @since SmartDeviceLink 5.0.0 + */ + @Deprecated + public Boolean getFuelLevelState() { + return getBoolean(KEY_FUEL_LEVEL_STATE); + } + + /** + * Sets a boolean value. If true, unsubscribes from instantFuelConsumption data + * + * @param instantFuelConsumption a boolean value + */ + public UnsubscribeVehicleData setInstantFuelConsumption(Boolean instantFuelConsumption) { + setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption); + return this; + } + + /** + * Gets a boolean value. If true, means the getInstantFuelConsumption data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the getInstantFuelConsumption data + * has been unsubscribed. + */ + public Boolean getInstantFuelConsumption() { + return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION); + } + + /** + * Sets a boolean value. If true, unsubscribes from externalTemperature data + * + * @param externalTemperature a boolean value + */ + public UnsubscribeVehicleData setExternalTemperature(Boolean externalTemperature) { + setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature); + return this; + } + + /** + * Gets a boolean value. If true, means the externalTemperature data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the externalTemperature data + * has been unsubscribed. + */ + public Boolean getExternalTemperature() { + return getBoolean(KEY_EXTERNAL_TEMPERATURE); + } + + /** + * Sets the prndl. + * + * @param prndl See PRNDL. This parameter since SmartDeviceLink 7.0.0 is deprecated and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public UnsubscribeVehicleData setPrndl(Boolean prndl) { + setParameters(KEY_PRNDL, prndl); + return this; + } + + /** + * Gets the prndl. + * + * @return Boolean See PRNDL. This parameter is deprecated since SmartDeviceLink 7.0.0 and it is now covered in `gearStatus` + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public Boolean getPrndl() { + return getBoolean(KEY_PRNDL); + } + + /** + * Sets a boolean value. If true, unsubscribes from tire pressure status data + * + * @param tirePressure a boolean value + */ + public UnsubscribeVehicleData setTirePressure(Boolean tirePressure) { + setParameters(KEY_TIRE_PRESSURE, tirePressure); + return this; + } + + /** + * Gets a boolean value. If true, means the tire pressure status data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the tire pressure status data + * has been unsubscribed. + */ + public Boolean getTirePressure() { + return getBoolean(KEY_TIRE_PRESSURE); + } + + /** + * Sets a boolean value. If true, unsubscribes from odometer data + * + * @param odometer a boolean value + */ + public UnsubscribeVehicleData setOdometer(Boolean odometer) { + setParameters(KEY_ODOMETER, odometer); + return this; + } + + /** + * Gets a boolean value. If true, means the odometer data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the odometer data + * has been unsubscribed. + */ + public Boolean getOdometer() { + return getBoolean(KEY_ODOMETER); + } + + /** + * Sets a boolean value. If true, unsubscribes from belt Status data + * + * @param beltStatus a boolean value + */ + public UnsubscribeVehicleData setBeltStatus(Boolean beltStatus) { + setParameters(KEY_BELT_STATUS, beltStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the belt Status data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the belt Status data + * has been unsubscribed. + */ + public Boolean getBeltStatus() { + return getBoolean(KEY_BELT_STATUS); + } + + /** + * Sets a boolean value. If true, unsubscribes from body Information data + * + * @param bodyInformation a boolean value + */ + public UnsubscribeVehicleData setBodyInformation(Boolean bodyInformation) { + setParameters(KEY_BODY_INFORMATION, bodyInformation); + return this; + } + + /** + * Gets a boolean value. If true, means the body Information data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the body Information data + * has been unsubscribed. + */ + public Boolean getBodyInformation() { + return getBoolean(KEY_BODY_INFORMATION); + } + + /** + * Sets a boolean value. If true, unsubscribes from device Status data + * + * @param deviceStatus a boolean value + */ + public UnsubscribeVehicleData setDeviceStatus(Boolean deviceStatus) { + setParameters(KEY_DEVICE_STATUS, deviceStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the device Status data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the device Status data + * has been unsubscribed. + */ + public Boolean getDeviceStatus() { + return getBoolean(KEY_DEVICE_STATUS); + } + + /** + * Sets a boolean value. If true, unsubscribes from driver Braking data + * + * @param driverBraking a boolean value + */ + public UnsubscribeVehicleData setDriverBraking(Boolean driverBraking) { + setParameters(KEY_DRIVER_BRAKING, driverBraking); + return this; + } + + /** + * Gets a boolean value. If true, means the driver Braking data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the driver Braking data + * has been unsubscribed. + */ + public Boolean getDriverBraking() { + return getBoolean(KEY_DRIVER_BRAKING); + } + + /** + * Sets a boolean value. If true, unsubscribes from wiper Status data + * + * @param wiperStatus a boolean value + */ + public UnsubscribeVehicleData setWiperStatus(Boolean wiperStatus) { + setParameters(KEY_WIPER_STATUS, wiperStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the wiper Status data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the wiper Status data + * has been unsubscribed. + */ + public Boolean getWiperStatus() { + return getBoolean(KEY_WIPER_STATUS); + } + + /** + * Sets a boolean value. If true, unsubscribes from Head Lamp Status data + * + * @param headLampStatus a boolean value + */ + public UnsubscribeVehicleData setHeadLampStatus(Boolean headLampStatus) { + setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the Head Lamp Status data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the Head Lamp Status data + * has been unsubscribed. + */ + public Boolean getHeadLampStatus() { + return getBoolean(KEY_HEAD_LAMP_STATUS); + } + + /** + * Sets a boolean value. If true, unsubscribes from Engine Torque data + * + * @param engineTorque a boolean value + */ + public UnsubscribeVehicleData setEngineTorque(Boolean engineTorque) { + setParameters(KEY_ENGINE_TORQUE, engineTorque); + return this; + } + + /** + * Gets a boolean value. If true, means the Engine Torque data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the Engine Torque data + * has been unsubscribed. + */ + public Boolean getEngineTorque() { + return getBoolean(KEY_ENGINE_TORQUE); + } + + /** + * Sets a boolean value. If true, unsubscribes from Engine Oil Life data + * + * @param engineOilLife a boolean value + */ + public UnsubscribeVehicleData setEngineOilLife(Boolean engineOilLife) { + setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife); + return this; + } + + /** + * Gets a boolean value. If true, means the Engine Oil Life data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the Engine Oil Life data + * has been unsubscribed. + */ + public Boolean getEngineOilLife() { + return getBoolean(KEY_ENGINE_OIL_LIFE); + } + + + /** + * Sets a boolean value. If true, unsubscribes from accPedalPosition data + * + * @param accPedalPosition a boolean value + */ + public UnsubscribeVehicleData setAccPedalPosition(Boolean accPedalPosition) { + setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition); + return this; + } + + /** + * Gets a boolean value. If true, means the accPedalPosition data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the accPedalPosition data + * has been unsubscribed. + */ + public Boolean getAccPedalPosition() { + return getBoolean(KEY_ACC_PEDAL_POSITION); + } + + public UnsubscribeVehicleData setSteeringWheelAngle(Boolean steeringWheelAngle) { + setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle); + return this; + } + + public Boolean getSteeringWheelAngle() { + return getBoolean(KEY_STEERING_WHEEL_ANGLE); + } + + public UnsubscribeVehicleData setECallInfo(Boolean eCallInfo) { + setParameters(KEY_E_CALL_INFO, eCallInfo); + return this; + } + + public Boolean getECallInfo() { + return getBoolean(KEY_E_CALL_INFO); + } + + public UnsubscribeVehicleData setAirbagStatus(Boolean airbagStatus) { + setParameters(KEY_AIRBAG_STATUS, airbagStatus); + return this; + } + + public Boolean getAirbagStatus() { + return getBoolean(KEY_AIRBAG_STATUS); + } + + public UnsubscribeVehicleData setEmergencyEvent(Boolean emergencyEvent) { + setParameters(KEY_EMERGENCY_EVENT, emergencyEvent); + return this; + } + + public Boolean getEmergencyEvent() { + return getBoolean(KEY_EMERGENCY_EVENT); + } + + public UnsubscribeVehicleData setClusterModeStatus(Boolean clusterModeStatus) { + setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus); + return this; + } + + public Boolean getClusterModeStatus() { + return getBoolean(KEY_CLUSTER_MODE_STATUS); + } + + public UnsubscribeVehicleData setMyKey(Boolean myKey) { + setParameters(KEY_MY_KEY, myKey); + return this; + } + + public Boolean getMyKey() { + return getBoolean(KEY_MY_KEY); + } + + /** + * Sets a boolean value. If true, unsubscribes from fuelRange data + * + * @param fuelRange a boolean value + */ + public UnsubscribeVehicleData setFuelRange(Boolean fuelRange) { + setParameters(KEY_FUEL_RANGE, fuelRange); + return this; + } + + /** + * Gets a boolean value. If true, means the fuelRange data has been + * unsubscribed. + * + * @return Boolean -a Boolean value. If true, means the fuelRange data + * has been unsubscribed. + */ + public Boolean getFuelRange() { + return getBoolean(KEY_FUEL_RANGE); + } + + /** + * Sets a boolean value. If true, unsubscribes from turnSignal data + * + * @param turnSignal a boolean value + */ + public UnsubscribeVehicleData setTurnSignal(Boolean turnSignal) { + setParameters(KEY_TURN_SIGNAL, turnSignal); + return this; + } + + /** + * Gets a boolean value. If true, means the turnSignal data has been unsubscribed. + * + * @return a Boolean value. + */ + public Boolean getTurnSignal() { + return getBoolean(KEY_TURN_SIGNAL); + } + + /** + * Sets a boolean value. If true, unsubscribes from electronicParkBrakeStatus data + * + * @param electronicParkBrakeStatus a boolean value + */ + public UnsubscribeVehicleData setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus) { + setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); + return this; + } + + /** + * Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed. + * + * @return a Boolean value. + */ + public Boolean getElectronicParkBrakeStatus() { + return getBoolean(KEY_ELECTRONIC_PARK_BRAKE_STATUS); + } + + /** + * Sets a boolean value. If true, unsubscribes from cloudAppVehicleID data + * + * @param cloudAppVehicleID a boolean value. + */ + public UnsubscribeVehicleData setCloudAppVehicleID(boolean cloudAppVehicleID) { + setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID); + return this; + } + + /** + * Gets a boolean value. If true, means the cloudAppVehicleID data has been unsubscribed. + * + * @return a Boolean value. + */ + public Boolean getCloudAppVehicleID() { + return getBoolean(KEY_CLOUD_APP_VEHICLE_ID); + } + + /** + * Sets a boolean value for OEM Custom VehicleData. + * + * @param vehicleDataName a String value + * @param vehicleDataState a boolean value + */ + public UnsubscribeVehicleData setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState) { + setParameters(vehicleDataName, vehicleDataState); + return this; + } + + /** + * Gets a boolean value for OEM Custom VehicleData. + * + * @return a Boolean value. + */ + public Boolean getOEMCustomVehicleData(String vehicleDataName) { + return getBoolean(vehicleDataName); + } + + /** + * Sets the gearStatus. + * + * @param gearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public UnsubscribeVehicleData setGearStatus(Boolean gearStatus) { + setParameters(KEY_GEAR_STATUS, gearStatus); + return this; + } + + /** + * Gets the gearStatus. + * + * @return Boolean See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getGearStatus() { + return getBoolean(KEY_GEAR_STATUS); + } + + /** + * Sets the handsOffSteering. + * + * @param handsOffSteering To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public UnsubscribeVehicleData setHandsOffSteering(Boolean handsOffSteering) { + setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering); + return this; + } + + /** + * Gets the handsOffSteering. + * + * @return Boolean To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getHandsOffSteering() { + return getBoolean(KEY_HANDS_OFF_STEERING); + } + + /** + * Sets the windowStatus. + * + * @param windowStatus See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public UnsubscribeVehicleData setWindowStatus(Boolean windowStatus) { + setParameters(KEY_WINDOW_STATUS, windowStatus); + return this; + } + + /** + * Gets the windowStatus. + * + * @return Boolean See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getWindowStatus() { + return getBoolean(KEY_WINDOW_STATUS); + } + + /** + * Sets the stabilityControlsStatus. + * + * @param stabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public UnsubscribeVehicleData setStabilityControlsStatus(Boolean stabilityControlsStatus) { + setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus); + return this; + } + + /** + * Gets the stabilityControlsStatus. + * + * @return Boolean See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public Boolean getStabilityControlsStatus() { + return getBoolean(KEY_STABILITY_CONTROLS_STATUS); + } + + /** + * Sets the seatOccupancy. + * + * @param seatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public UnsubscribeVehicleData setSeatOccupancy(Boolean seatOccupancy) { + setParameters(KEY_SEAT_OCCUPANCY, seatOccupancy); + return this; + } + + /** + * Gets the seatOccupancy. + * + * @return Boolean See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public Boolean getSeatOccupancy() { + return getBoolean(KEY_SEAT_OCCUPANCY); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java index a9b59ce9b..b00b06dde 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java @@ -1,756 +1,780 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc;
-
-import androidx.annotation.NonNull;
-
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-
-import java.util.Hashtable;
-
-/**
- * Unsubscribe Vehicle Data Response is sent, when UnsubscribeVehicleData has been called.
- *
- * @since SmartDeviceLink 2.0
- */
-public class UnsubscribeVehicleDataResponse extends RPCResponse {
- public static final String KEY_SPEED = "speed";
- public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
- public static final String KEY_PRNDL = "prndl";
- public static final String KEY_TIRE_PRESSURE = "tirePressure";
- public static final String KEY_ENGINE_TORQUE = "engineTorque";
- public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
- public static final String KEY_ODOMETER = "odometer";
- public static final String KEY_GPS = "gps";
- public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
- public static final String KEY_BELT_STATUS = "beltStatus";
- public static final String KEY_BODY_INFORMATION = "bodyInformation";
- public static final String KEY_DEVICE_STATUS = "deviceStatus";
- public static final String KEY_DRIVER_BRAKING = "driverBraking";
- public static final String KEY_WIPER_STATUS = "wiperStatus";
- public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus";
- public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
- public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
- public static final String KEY_E_CALL_INFO = "eCallInfo";
- public static final String KEY_AIRBAG_STATUS = "airbagStatus";
- public static final String KEY_EMERGENCY_EVENT = "emergencyEvent";
- @Deprecated
- public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus";
- public static final String KEY_CLUSTER_MODES = "clusterModes";
- public static final String KEY_MY_KEY = "myKey";
- public static final String KEY_FUEL_RANGE = "fuelRange";
- public static final String KEY_TURN_SIGNAL = "turnSignal";
- public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
- public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
- public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
- public static final String KEY_WINDOW_STATUS = "windowStatus";
- public static final String KEY_GEAR_STATUS = "gearStatus";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL = "fuelLevel";
- /**
- * @deprecated
- */
- @Deprecated
- public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
- public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
-
- /**
- * Constructs a new UnsubscribeVehicleDataResponse object
- */
- public UnsubscribeVehicleDataResponse() {
- super(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString());
- }
-
- /**
- * Constructs a new UnsubscribeVehicleDataResponse object
- *
- * @param success whether the request is successfully processed
- * @param resultCode whether the request is successfully processed
- */
- public UnsubscribeVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
- this();
- setSuccess(success);
- setResultCode(resultCode);
- }
-
- /**
- * Constructs a new UnsubscribeVehicleDataResponse object indicated by the Hashtable
- * parameter
- * <p></p>
- *
- * @param hash The Hashtable to use to build this RPC
- */
- public UnsubscribeVehicleDataResponse(Hashtable<String, Object> hash) {
- super(hash);
- }
-
- /**
- * Sets Gps
- *
- * @param gps a VehicleDataResult related to GPS
- */
- public UnsubscribeVehicleDataResponse setGps(VehicleDataResult gps) {
- setParameters(KEY_GPS, gps);
- return this;
- }
-
- /**
- * Gets Gps
- *
- * @return a VehicleDataResult related to GPS
- */
- public VehicleDataResult getGps() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS);
- }
-
- /**
- * Sets Speed
- *
- * @param speed a VehicleDataResult related to speed
- */
- public UnsubscribeVehicleDataResponse setSpeed(VehicleDataResult speed) {
- setParameters(KEY_SPEED, speed);
- return this;
- }
-
- /**
- * Gets Speed
- *
- * @return a VehicleDataResult related to speed
- */
- public VehicleDataResult getSpeed() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED);
- }
-
- /**
- * Sets rpm
- *
- * @param rpm a VehicleDataResult related to RPM
- */
- public UnsubscribeVehicleDataResponse setRpm(VehicleDataResult rpm) {
- setParameters(KEY_RPM, rpm);
- return this;
- }
-
- /**
- * Gets rpm
- *
- * @return a VehicleDataResult related to RPM
- */
- public VehicleDataResult getRpm() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_RPM);
- }
-
- /**
- * Sets the fuelLevel.
- *
- * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public UnsubscribeVehicleDataResponse setFuelLevel(VehicleDataResult fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
- return this;
- }
-
- /**
- * Gets the fuelLevel.
- *
- * @return VehicleDataResult The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
- * 7.0, please see fuelRange.
- */
- @Deprecated
- public VehicleDataResult getFuelLevel() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL);
- }
-
- /**
- * Sets Fuel Level State
- *
- * @param fuelLevelState a VehicleDataResult related to FuelLevel State
- */
- @Deprecated
- public UnsubscribeVehicleDataResponse setFuelLevelState(VehicleDataResult fuelLevelState) {
- setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
- return this;
- }
-
- /**
- * Gets Fuel Level State
- *
- * @return a VehicleDataResult related to FuelLevel State
- */
- @Deprecated
- public VehicleDataResult getFuelLevelState() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE);
- }
-
- /**
- * Sets Instant Fuel Consumption
- *
- * @param instantFuelConsumption a VehicleDataResult related to instant fuel consumption
- */
- public UnsubscribeVehicleDataResponse setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) {
- setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
- return this;
- }
-
- /**
- * Gets Instant Fuel Consumption
- *
- * @return a VehicleDataResult related to instant fuel consumption
- */
- public VehicleDataResult getInstantFuelConsumption() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_INSTANT_FUEL_CONSUMPTION);
- }
-
- /**
- * Sets External Temperature
- *
- * @param externalTemperature a VehicleDataResult related to external temperature
- */
- public UnsubscribeVehicleDataResponse setExternalTemperature(VehicleDataResult externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
- return this;
- }
-
- /**
- * Gets External Temperature
- *
- * @return a VehicleDataResult related to external temperature
- */
- public VehicleDataResult getExternalTemperature() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE);
- }
-
- /**
- * Sets the prndl.
- *
- * @param prndl See PRNDL.
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public UnsubscribeVehicleDataResponse setPrndl(VehicleDataResult prndl) {
- setParameters(KEY_PRNDL, prndl);
- return this;
- }
-
- /**
- * Gets the prndl.
- *
- * @return VehicleDataResult.
- * @deprecated in SmartDeviceLink 7.0.0
- */
- @Deprecated
- public VehicleDataResult getPrndl() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL);
- }
-
- /**
- * Sets Tire Pressure
- *
- * @param tirePressure a VehicleDataResult related to tire pressure
- */
- public UnsubscribeVehicleDataResponse setTirePressure(VehicleDataResult tirePressure) {
- setParameters(KEY_TIRE_PRESSURE, tirePressure);
- return this;
- }
-
- /**
- * Gets Tire Pressure
- *
- * @return a VehicleDataResult related to tire pressure
- */
- public VehicleDataResult getTirePressure() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE);
- }
-
- /**
- * Sets Odometer
- *
- * @param odometer a VehicleDataResult related to the odometer
- */
- public UnsubscribeVehicleDataResponse setOdometer(VehicleDataResult odometer) {
- setParameters(KEY_ODOMETER, odometer);
- return this;
- }
-
- /**
- * Gets Odometer
- *
- * @return a VehicleDataResult related to the odometer
- */
- public VehicleDataResult getOdometer() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER);
- }
-
- /**
- * Sets Belt Status
- *
- * @param beltStatus a VehicleDataResult related to the seat belt status
- */
- public UnsubscribeVehicleDataResponse setBeltStatus(VehicleDataResult beltStatus) {
- setParameters(KEY_BELT_STATUS, beltStatus);
- return this;
- }
-
- /**
- * Gets Belt Status
- *
- * @return a VehicleDataResult related to the seat belt status
- */
- public VehicleDataResult getBeltStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BELT_STATUS);
- }
-
- /**
- * Sets Body Information
- *
- * @param bodyInformation a VehicleDataResult related to the body info
- */
- public UnsubscribeVehicleDataResponse setBodyInformation(VehicleDataResult bodyInformation) {
- setParameters(KEY_BODY_INFORMATION, bodyInformation);
- return this;
- }
-
- /**
- * Gets Body Information
- *
- * @return a VehicleDataResult related to the body info
- */
- public VehicleDataResult getBodyInformation() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION);
- }
-
- /**
- * Sets Device Status
- *
- * @param deviceStatus a VehicleDataResult related to the device status of the connected device
- */
- public UnsubscribeVehicleDataResponse setDeviceStatus(VehicleDataResult deviceStatus) {
- setParameters(KEY_DEVICE_STATUS, deviceStatus);
- return this;
- }
-
- /**
- * Gets Device Status
- *
- * @return a VehicleDataResult related to the device status of the connected device
- */
- public VehicleDataResult getDeviceStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DEVICE_STATUS);
- }
-
- /**
- * Sets Driver Braking
- *
- * @param driverBraking a VehicleDataResult related to the driver breaking status
- */
- public UnsubscribeVehicleDataResponse setDriverBraking(VehicleDataResult driverBraking) {
- setParameters(KEY_DRIVER_BRAKING, driverBraking);
- return this;
- }
-
- /**
- * Gets Driver Braking
- *
- * @return a VehicleDataResult related to the driver breaking status
- */
- public VehicleDataResult getDriverBraking() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DRIVER_BRAKING);
- }
-
- /**
- * Sets Wiper Status
- *
- * @param wiperStatus a VehicleDataResult related to the wiper status
- */
- public UnsubscribeVehicleDataResponse setWiperStatus(VehicleDataResult wiperStatus) {
- setParameters(KEY_WIPER_STATUS, wiperStatus);
- return this;
- }
-
- /**
- * Gets Wiper Status
- *
- * @return a VehicleDataResult related to the wiper status
- */
- public VehicleDataResult getWiperStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS);
- }
-
- /**
- * Sets Head Lamp Status
- *
- * @param headLampStatus a VehicleDataResult related to the headlamp status
- */
- public UnsubscribeVehicleDataResponse setHeadLampStatus(VehicleDataResult headLampStatus) {
- setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
- return this;
- }
-
- /**
- * Gets Head Lamp Status
- *
- * @return a VehicleDataResult related to the headlamp status
- */
- public VehicleDataResult getHeadLampStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HEAD_LAMP_STATUS);
- }
-
- /**
- * Sets Engine Torque
- *
- * @param engineTorque a VehicleDataResult related to the engine's torque
- */
- public UnsubscribeVehicleDataResponse setEngineTorque(VehicleDataResult engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- return this;
- }
-
- /**
- * Gets Engine Torque
- *
- * @return a VehicleDataResult related to the engine's torque
- */
- public VehicleDataResult getEngineTorque() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE);
- }
-
- /**
- * Sets Engine Oil Life
- *
- * @param engineOilLife a VehicleDataResult related to the engine's oil life
- */
- public UnsubscribeVehicleDataResponse setEngineOilLife(VehicleDataResult engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- return this;
- }
-
- /**
- * Gets Engine Oil Life
- *
- * @return a VehicleDataResult related to the engine's oil life
- */
- public VehicleDataResult getEngineOilLife() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_OIL_LIFE);
- }
-
- /**
- * Sets AccPedal Position
- *
- * @param accPedalPosition a VehicleDataResult related to the accelerator pedal's position
- */
- public UnsubscribeVehicleDataResponse setAccPedalPosition(VehicleDataResult accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
- return this;
- }
-
- /**
- * Gets AccPedal Position
- *
- * @return a VehicleDataResult related to the accelerator pedal's position
- */
- public VehicleDataResult getAccPedalPosition() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ACC_PEDAL_POSITION);
- }
-
- public UnsubscribeVehicleDataResponse setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
- return this;
- }
-
- public VehicleDataResult getSteeringWheelAngle() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE);
- }
-
- public UnsubscribeVehicleDataResponse setECallInfo(VehicleDataResult eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
- return this;
- }
-
- public VehicleDataResult getECallInfo() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO);
- }
-
- public UnsubscribeVehicleDataResponse setAirbagStatus(VehicleDataResult airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
- return this;
- }
-
- public VehicleDataResult getAirbagStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS);
- }
-
- public UnsubscribeVehicleDataResponse setEmergencyEvent(VehicleDataResult emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
- return this;
- }
-
- public VehicleDataResult getEmergencyEvent() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT);
- }
-
- /**
- * @deprecated use {@link #setClusterModes(VehicleDataResult clusterMode)} instead.
- */
- @Deprecated
- public UnsubscribeVehicleDataResponse setClusterModeStatus(VehicleDataResult clusterModeStatus) {
- return setClusterModes(clusterModeStatus);
- }
-
- /**
- * @deprecated use {@link #getClusterModes()} instead.
- */
- @Deprecated
- public VehicleDataResult getClusterModeStatus() {
- return getClusterModes();
- }
-
- /**
- * Sets the status modes of the cluster
- *
- * @param clusterMode the status modes of the cluster
- */
- public UnsubscribeVehicleDataResponse setClusterModes(VehicleDataResult clusterMode) {
- setParameters(KEY_CLUSTER_MODES, clusterMode);
- return this;
- }
-
- /**
- * Gets the status modes of the cluster
- *
- * @return The status modes of the cluster
- */
- public VehicleDataResult getClusterModes() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODES);
- }
-
- public UnsubscribeVehicleDataResponse setMyKey(VehicleDataResult myKey) {
- setParameters(KEY_MY_KEY, myKey);
- return this;
- }
-
- public VehicleDataResult getMyKey() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_MY_KEY);
- }
-
- /**
- * Sets the fuelRange.
- *
- * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * @since SmartDeviceLink 5.0.0
- */
- public UnsubscribeVehicleDataResponse setFuelRange(VehicleDataResult fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- return this;
- }
-
- /**
- * Gets the fuelRange.
- *
- * @return VehicleDataResult The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
- * vehicle. See struct FuelRange for details.
- * @since SmartDeviceLink 5.0.0
- */
- public VehicleDataResult getFuelRange() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE);
- }
-
- /**
- * Sets turnSignal
- *
- * @param turnSignal a VehicleDataResult related to the turn signal status
- */
- public UnsubscribeVehicleDataResponse setTurnSignal(VehicleDataResult turnSignal) {
- setParameters(KEY_TURN_SIGNAL, turnSignal);
- return this;
- }
-
- /**
- * Gets turnSignal
- *
- * @return a VehicleDataResult related to the turn signal status
- */
- public VehicleDataResult getTurnSignal() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL);
- }
-
- /**
- * Sets electronicParkBrakeStatus
- *
- * @param electronicParkBrakeStatus a VehicleDataResult related to the electronic park brake status
- */
- public UnsubscribeVehicleDataResponse setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus) {
- setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
- return this;
- }
-
- /**
- * Gets electronicParkBrakeStatus
- *
- * @return a VehicleDataResult related to the electronic park brake status
- */
- public VehicleDataResult getElectronicParkBrakeStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS);
- }
-
- /**
- * Sets cloudAppVehicleID
- *
- * @param cloudAppVehicleID a VehicleDataResult related to the cloud app vehicle ID
- */
- public UnsubscribeVehicleDataResponse setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID) {
- setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
- return this;
- }
-
- /**
- * Gets a VehicleDataResult for the unsubscribe response of the CloudAppVehicleID vehicle data item.
- *
- * @return a VehicleDataResult related to the cloud app vehicle ID
- */
- public VehicleDataResult getCloudAppVehicleID() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLOUD_APP_VEHICLE_ID);
- }
-
- /**
- * Sets a value for OEM Custom VehicleData.
- *
- * @param vehicleDataName a String value
- * @param vehicleDataState a VehicleDataResult value
- */
- public UnsubscribeVehicleDataResponse setOEMCustomVehicleData(String vehicleDataName, VehicleDataResult vehicleDataState) {
- setParameters(vehicleDataName, vehicleDataState);
- return this;
- }
-
- /**
- * Gets a VehicleDataResult for the vehicle data item.
- *
- * @return a VehicleDataResult related to the vehicle data
- */
- public VehicleDataResult getOEMCustomVehicleData(String vehicleDataName) {
- return (VehicleDataResult) getObject(VehicleDataResult.class, vehicleDataName);
- }
-
- /**
- * Sets the handsOffSteering.
- *
- * @param handsOffSteering To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public UnsubscribeVehicleDataResponse setHandsOffSteering(VehicleDataResult handsOffSteering) {
- setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
- return this;
- }
-
- /**
- * Gets the handsOffSteering.
- *
- * @return VehicleDataResult To indicate whether driver hands are off the steering wheel
- * @since SmartDeviceLink 7.0.0
- */
- public VehicleDataResult getHandsOffSteering() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HANDS_OFF_STEERING);
- }
-
- /**
- * Sets the windowStatus.
- *
- * @param windowStatus See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public UnsubscribeVehicleDataResponse setWindowStatus(VehicleDataResult windowStatus) {
- setParameters(KEY_WINDOW_STATUS, windowStatus);
- return this;
- }
-
- /**
- * Gets the windowStatus.
- *
- * @return VehicleDataResult See WindowStatus
- * @since SmartDeviceLink 7.0.0
- */
- public VehicleDataResult getWindowStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WINDOW_STATUS);
- }
-
- /**
- * Sets the gearStatus.
- *
- * @param gearStatus See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public UnsubscribeVehicleDataResponse setGearStatus(VehicleDataResult gearStatus) {
- setParameters(KEY_GEAR_STATUS, gearStatus);
- return this;
- }
-
- /**
- * Gets the gearStatus.
- *
- * @return VehicleDataResult See GearStatus
- * @since SmartDeviceLink 7.0.0
- */
- public VehicleDataResult getGearStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GEAR_STATUS);
- }
-
- /**
- * Gets the stabilityControlsStatus.
- *
- * @return VehicleDataResult See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public VehicleDataResult getStabilityControlsStatus() {
- return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STABILITY_CONTROLS_STATUS);
- }
-
- /**
- * Sets the stabilityControlsStatus.
- *
- * @param stabilityControlsStatus See StabilityControlsStatus
- * @since SmartDeviceLink 7.0.0
- */
- public UnsubscribeVehicleDataResponse setStabilityControlsStatus(VehicleDataResult stabilityControlsStatus) {
- setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
- return this;
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc; + +import androidx.annotation.NonNull; + +import com.smartdevicelink.protocol.enums.FunctionID; +import com.smartdevicelink.proxy.RPCResponse; +import com.smartdevicelink.proxy.rpc.enums.Result; + +import java.util.Hashtable; + +/** + * Unsubscribe Vehicle Data Response is sent, when UnsubscribeVehicleData has been called. + * + * @since SmartDeviceLink 2.0 + */ +public class UnsubscribeVehicleDataResponse extends RPCResponse { + public static final String KEY_SPEED = "speed"; + public static final String KEY_RPM = "rpm"; + public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature"; + public static final String KEY_PRNDL = "prndl"; + public static final String KEY_TIRE_PRESSURE = "tirePressure"; + public static final String KEY_ENGINE_TORQUE = "engineTorque"; + public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife"; + public static final String KEY_ODOMETER = "odometer"; + public static final String KEY_GPS = "gps"; + public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption"; + public static final String KEY_BELT_STATUS = "beltStatus"; + public static final String KEY_BODY_INFORMATION = "bodyInformation"; + public static final String KEY_DEVICE_STATUS = "deviceStatus"; + public static final String KEY_DRIVER_BRAKING = "driverBraking"; + public static final String KEY_WIPER_STATUS = "wiperStatus"; + public static final String KEY_HEAD_LAMP_STATUS = "headLampStatus"; + public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition"; + public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle"; + public static final String KEY_E_CALL_INFO = "eCallInfo"; + public static final String KEY_AIRBAG_STATUS = "airbagStatus"; + public static final String KEY_EMERGENCY_EVENT = "emergencyEvent"; + @Deprecated + public static final String KEY_CLUSTER_MODE_STATUS = "clusterModeStatus"; + public static final String KEY_CLUSTER_MODES = "clusterModes"; + public static final String KEY_MY_KEY = "myKey"; + public static final String KEY_FUEL_RANGE = "fuelRange"; + public static final String KEY_TURN_SIGNAL = "turnSignal"; + public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus"; + public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID"; + public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering"; + public static final String KEY_WINDOW_STATUS = "windowStatus"; + public static final String KEY_GEAR_STATUS = "gearStatus"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL = "fuelLevel"; + /** + * @deprecated + */ + @Deprecated + public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State"; + public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus"; + /** + * @since SmartDeviceLink 7.1.0 + */ + public static final String KEY_SEAT_OCCUPANCY = "seatOccupancy"; + /** + * Constructs a new UnsubscribeVehicleDataResponse object + */ + public UnsubscribeVehicleDataResponse() { + super(FunctionID.UNSUBSCRIBE_VEHICLE_DATA.toString()); + } + + /** + * Constructs a new UnsubscribeVehicleDataResponse object + * + * @param success whether the request is successfully processed + * @param resultCode whether the request is successfully processed + */ + public UnsubscribeVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) { + this(); + setSuccess(success); + setResultCode(resultCode); + } + + /** + * Constructs a new UnsubscribeVehicleDataResponse object indicated by the Hashtable + * parameter + * <p></p> + * + * @param hash The Hashtable to use to build this RPC + */ + public UnsubscribeVehicleDataResponse(Hashtable<String, Object> hash) { + super(hash); + } + + /** + * Sets Gps + * + * @param gps a VehicleDataResult related to GPS + */ + public UnsubscribeVehicleDataResponse setGps(VehicleDataResult gps) { + setParameters(KEY_GPS, gps); + return this; + } + + /** + * Gets Gps + * + * @return a VehicleDataResult related to GPS + */ + public VehicleDataResult getGps() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS); + } + + /** + * Sets Speed + * + * @param speed a VehicleDataResult related to speed + */ + public UnsubscribeVehicleDataResponse setSpeed(VehicleDataResult speed) { + setParameters(KEY_SPEED, speed); + return this; + } + + /** + * Gets Speed + * + * @return a VehicleDataResult related to speed + */ + public VehicleDataResult getSpeed() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED); + } + + /** + * Sets rpm + * + * @param rpm a VehicleDataResult related to RPM + */ + public UnsubscribeVehicleDataResponse setRpm(VehicleDataResult rpm) { + setParameters(KEY_RPM, rpm); + return this; + } + + /** + * Gets rpm + * + * @return a VehicleDataResult related to RPM + */ + public VehicleDataResult getRpm() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_RPM); + } + + /** + * Sets the fuelLevel. + * + * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public UnsubscribeVehicleDataResponse setFuelLevel(VehicleDataResult fuelLevel) { + setParameters(KEY_FUEL_LEVEL, fuelLevel); + return this; + } + + /** + * Gets the fuelLevel. + * + * @return VehicleDataResult The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec + * 7.0, please see fuelRange. + */ + @Deprecated + public VehicleDataResult getFuelLevel() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL); + } + + /** + * Sets Fuel Level State + * + * @param fuelLevelState a VehicleDataResult related to FuelLevel State + */ + @Deprecated + public UnsubscribeVehicleDataResponse setFuelLevelState(VehicleDataResult fuelLevelState) { + setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState); + return this; + } + + /** + * Gets Fuel Level State + * + * @return a VehicleDataResult related to FuelLevel State + */ + @Deprecated + public VehicleDataResult getFuelLevelState() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE); + } + + /** + * Sets Instant Fuel Consumption + * + * @param instantFuelConsumption a VehicleDataResult related to instant fuel consumption + */ + public UnsubscribeVehicleDataResponse setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) { + setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption); + return this; + } + + /** + * Gets Instant Fuel Consumption + * + * @return a VehicleDataResult related to instant fuel consumption + */ + public VehicleDataResult getInstantFuelConsumption() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_INSTANT_FUEL_CONSUMPTION); + } + + /** + * Sets External Temperature + * + * @param externalTemperature a VehicleDataResult related to external temperature + */ + public UnsubscribeVehicleDataResponse setExternalTemperature(VehicleDataResult externalTemperature) { + setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature); + return this; + } + + /** + * Gets External Temperature + * + * @return a VehicleDataResult related to external temperature + */ + public VehicleDataResult getExternalTemperature() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE); + } + + /** + * Sets the prndl. + * + * @param prndl See PRNDL. + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public UnsubscribeVehicleDataResponse setPrndl(VehicleDataResult prndl) { + setParameters(KEY_PRNDL, prndl); + return this; + } + + /** + * Gets the prndl. + * + * @return VehicleDataResult. + * @deprecated in SmartDeviceLink 7.0.0 + */ + @Deprecated + public VehicleDataResult getPrndl() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL); + } + + /** + * Sets Tire Pressure + * + * @param tirePressure a VehicleDataResult related to tire pressure + */ + public UnsubscribeVehicleDataResponse setTirePressure(VehicleDataResult tirePressure) { + setParameters(KEY_TIRE_PRESSURE, tirePressure); + return this; + } + + /** + * Gets Tire Pressure + * + * @return a VehicleDataResult related to tire pressure + */ + public VehicleDataResult getTirePressure() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE); + } + + /** + * Sets Odometer + * + * @param odometer a VehicleDataResult related to the odometer + */ + public UnsubscribeVehicleDataResponse setOdometer(VehicleDataResult odometer) { + setParameters(KEY_ODOMETER, odometer); + return this; + } + + /** + * Gets Odometer + * + * @return a VehicleDataResult related to the odometer + */ + public VehicleDataResult getOdometer() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER); + } + + /** + * Sets Belt Status + * + * @param beltStatus a VehicleDataResult related to the seat belt status + */ + public UnsubscribeVehicleDataResponse setBeltStatus(VehicleDataResult beltStatus) { + setParameters(KEY_BELT_STATUS, beltStatus); + return this; + } + + /** + * Gets Belt Status + * + * @return a VehicleDataResult related to the seat belt status + */ + public VehicleDataResult getBeltStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BELT_STATUS); + } + + /** + * Sets Body Information + * + * @param bodyInformation a VehicleDataResult related to the body info + */ + public UnsubscribeVehicleDataResponse setBodyInformation(VehicleDataResult bodyInformation) { + setParameters(KEY_BODY_INFORMATION, bodyInformation); + return this; + } + + /** + * Gets Body Information + * + * @return a VehicleDataResult related to the body info + */ + public VehicleDataResult getBodyInformation() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION); + } + + /** + * Sets Device Status + * + * @param deviceStatus a VehicleDataResult related to the device status of the connected device + */ + public UnsubscribeVehicleDataResponse setDeviceStatus(VehicleDataResult deviceStatus) { + setParameters(KEY_DEVICE_STATUS, deviceStatus); + return this; + } + + /** + * Gets Device Status + * + * @return a VehicleDataResult related to the device status of the connected device + */ + public VehicleDataResult getDeviceStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DEVICE_STATUS); + } + + /** + * Sets Driver Braking + * + * @param driverBraking a VehicleDataResult related to the driver breaking status + */ + public UnsubscribeVehicleDataResponse setDriverBraking(VehicleDataResult driverBraking) { + setParameters(KEY_DRIVER_BRAKING, driverBraking); + return this; + } + + /** + * Gets Driver Braking + * + * @return a VehicleDataResult related to the driver breaking status + */ + public VehicleDataResult getDriverBraking() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_DRIVER_BRAKING); + } + + /** + * Sets Wiper Status + * + * @param wiperStatus a VehicleDataResult related to the wiper status + */ + public UnsubscribeVehicleDataResponse setWiperStatus(VehicleDataResult wiperStatus) { + setParameters(KEY_WIPER_STATUS, wiperStatus); + return this; + } + + /** + * Gets Wiper Status + * + * @return a VehicleDataResult related to the wiper status + */ + public VehicleDataResult getWiperStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS); + } + + /** + * Sets Head Lamp Status + * + * @param headLampStatus a VehicleDataResult related to the headlamp status + */ + public UnsubscribeVehicleDataResponse setHeadLampStatus(VehicleDataResult headLampStatus) { + setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus); + return this; + } + + /** + * Gets Head Lamp Status + * + * @return a VehicleDataResult related to the headlamp status + */ + public VehicleDataResult getHeadLampStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HEAD_LAMP_STATUS); + } + + /** + * Sets Engine Torque + * + * @param engineTorque a VehicleDataResult related to the engine's torque + */ + public UnsubscribeVehicleDataResponse setEngineTorque(VehicleDataResult engineTorque) { + setParameters(KEY_ENGINE_TORQUE, engineTorque); + return this; + } + + /** + * Gets Engine Torque + * + * @return a VehicleDataResult related to the engine's torque + */ + public VehicleDataResult getEngineTorque() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE); + } + + /** + * Sets Engine Oil Life + * + * @param engineOilLife a VehicleDataResult related to the engine's oil life + */ + public UnsubscribeVehicleDataResponse setEngineOilLife(VehicleDataResult engineOilLife) { + setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife); + return this; + } + + /** + * Gets Engine Oil Life + * + * @return a VehicleDataResult related to the engine's oil life + */ + public VehicleDataResult getEngineOilLife() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_OIL_LIFE); + } + + /** + * Sets AccPedal Position + * + * @param accPedalPosition a VehicleDataResult related to the accelerator pedal's position + */ + public UnsubscribeVehicleDataResponse setAccPedalPosition(VehicleDataResult accPedalPosition) { + setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition); + return this; + } + + /** + * Gets AccPedal Position + * + * @return a VehicleDataResult related to the accelerator pedal's position + */ + public VehicleDataResult getAccPedalPosition() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ACC_PEDAL_POSITION); + } + + public UnsubscribeVehicleDataResponse setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) { + setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle); + return this; + } + + public VehicleDataResult getSteeringWheelAngle() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE); + } + + public UnsubscribeVehicleDataResponse setECallInfo(VehicleDataResult eCallInfo) { + setParameters(KEY_E_CALL_INFO, eCallInfo); + return this; + } + + public VehicleDataResult getECallInfo() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO); + } + + public UnsubscribeVehicleDataResponse setAirbagStatus(VehicleDataResult airbagStatus) { + setParameters(KEY_AIRBAG_STATUS, airbagStatus); + return this; + } + + public VehicleDataResult getAirbagStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS); + } + + public UnsubscribeVehicleDataResponse setEmergencyEvent(VehicleDataResult emergencyEvent) { + setParameters(KEY_EMERGENCY_EVENT, emergencyEvent); + return this; + } + + public VehicleDataResult getEmergencyEvent() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT); + } + + /** + * @deprecated use {@link #setClusterModes(VehicleDataResult clusterMode)} instead. + */ + @Deprecated + public UnsubscribeVehicleDataResponse setClusterModeStatus(VehicleDataResult clusterModeStatus) { + return setClusterModes(clusterModeStatus); + } + + /** + * @deprecated use {@link #getClusterModes()} instead. + */ + @Deprecated + public VehicleDataResult getClusterModeStatus() { + return getClusterModes(); + } + + /** + * Sets the status modes of the cluster + * + * @param clusterMode the status modes of the cluster + */ + public UnsubscribeVehicleDataResponse setClusterModes(VehicleDataResult clusterMode) { + setParameters(KEY_CLUSTER_MODES, clusterMode); + return this; + } + + /** + * Gets the status modes of the cluster + * + * @return The status modes of the cluster + */ + public VehicleDataResult getClusterModes() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODES); + } + + public UnsubscribeVehicleDataResponse setMyKey(VehicleDataResult myKey) { + setParameters(KEY_MY_KEY, myKey); + return this; + } + + public VehicleDataResult getMyKey() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_MY_KEY); + } + + /** + * Sets the fuelRange. + * + * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * @since SmartDeviceLink 5.0.0 + */ + public UnsubscribeVehicleDataResponse setFuelRange(VehicleDataResult fuelRange) { + setParameters(KEY_FUEL_RANGE, fuelRange); + return this; + } + + /** + * Gets the fuelRange. + * + * @return VehicleDataResult The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the + * vehicle. See struct FuelRange for details. + * @since SmartDeviceLink 5.0.0 + */ + public VehicleDataResult getFuelRange() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE); + } + + /** + * Sets turnSignal + * + * @param turnSignal a VehicleDataResult related to the turn signal status + */ + public UnsubscribeVehicleDataResponse setTurnSignal(VehicleDataResult turnSignal) { + setParameters(KEY_TURN_SIGNAL, turnSignal); + return this; + } + + /** + * Gets turnSignal + * + * @return a VehicleDataResult related to the turn signal status + */ + public VehicleDataResult getTurnSignal() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL); + } + + /** + * Sets electronicParkBrakeStatus + * + * @param electronicParkBrakeStatus a VehicleDataResult related to the electronic park brake status + */ + public UnsubscribeVehicleDataResponse setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus) { + setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus); + return this; + } + + /** + * Gets electronicParkBrakeStatus + * + * @return a VehicleDataResult related to the electronic park brake status + */ + public VehicleDataResult getElectronicParkBrakeStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ELECTRONIC_PARK_BRAKE_STATUS); + } + + /** + * Sets cloudAppVehicleID + * + * @param cloudAppVehicleID a VehicleDataResult related to the cloud app vehicle ID + */ + public UnsubscribeVehicleDataResponse setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID) { + setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID); + return this; + } + + /** + * Gets a VehicleDataResult for the unsubscribe response of the CloudAppVehicleID vehicle data item. + * + * @return a VehicleDataResult related to the cloud app vehicle ID + */ + public VehicleDataResult getCloudAppVehicleID() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLOUD_APP_VEHICLE_ID); + } + + /** + * Sets a value for OEM Custom VehicleData. + * + * @param vehicleDataName a String value + * @param vehicleDataState a VehicleDataResult value + */ + public UnsubscribeVehicleDataResponse setOEMCustomVehicleData(String vehicleDataName, VehicleDataResult vehicleDataState) { + setParameters(vehicleDataName, vehicleDataState); + return this; + } + + /** + * Gets a VehicleDataResult for the vehicle data item. + * + * @return a VehicleDataResult related to the vehicle data + */ + public VehicleDataResult getOEMCustomVehicleData(String vehicleDataName) { + return (VehicleDataResult) getObject(VehicleDataResult.class, vehicleDataName); + } + + /** + * Sets the handsOffSteering. + * + * @param handsOffSteering To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public UnsubscribeVehicleDataResponse setHandsOffSteering(VehicleDataResult handsOffSteering) { + setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering); + return this; + } + + /** + * Gets the handsOffSteering. + * + * @return VehicleDataResult To indicate whether driver hands are off the steering wheel + * @since SmartDeviceLink 7.0.0 + */ + public VehicleDataResult getHandsOffSteering() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_HANDS_OFF_STEERING); + } + + /** + * Sets the windowStatus. + * + * @param windowStatus See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public UnsubscribeVehicleDataResponse setWindowStatus(VehicleDataResult windowStatus) { + setParameters(KEY_WINDOW_STATUS, windowStatus); + return this; + } + + /** + * Gets the windowStatus. + * + * @return VehicleDataResult See WindowStatus + * @since SmartDeviceLink 7.0.0 + */ + public VehicleDataResult getWindowStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WINDOW_STATUS); + } + + /** + * Sets the gearStatus. + * + * @param gearStatus See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public UnsubscribeVehicleDataResponse setGearStatus(VehicleDataResult gearStatus) { + setParameters(KEY_GEAR_STATUS, gearStatus); + return this; + } + + /** + * Gets the gearStatus. + * + * @return VehicleDataResult See GearStatus + * @since SmartDeviceLink 7.0.0 + */ + public VehicleDataResult getGearStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GEAR_STATUS); + } + + /** + * Gets the stabilityControlsStatus. + * + * @return VehicleDataResult See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public VehicleDataResult getStabilityControlsStatus() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STABILITY_CONTROLS_STATUS); + } + + /** + * Sets the stabilityControlsStatus. + * + * @param stabilityControlsStatus See StabilityControlsStatus + * @since SmartDeviceLink 7.0.0 + */ + public UnsubscribeVehicleDataResponse setStabilityControlsStatus(VehicleDataResult stabilityControlsStatus) { + setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus); + return this; + } + + /** + * Sets the seatOccupancy. + * + * @param seatOccupancy See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public UnsubscribeVehicleDataResponse setSeatOccupancy(VehicleDataResult seatOccupancy) { + setParameters(KEY_SEAT_OCCUPANCY, seatOccupancy); + return this; + } + + /** + * Gets the seatOccupancy. + * + * @return VehicleDataResult See SeatOccupancy + * @since SmartDeviceLink 7.1.0 + */ + public VehicleDataResult getSeatOccupancy() { + return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SEAT_OCCUPANCY); + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java index 579607ebf..e4b8f00ed 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataResultCode.java @@ -1,98 +1,98 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Enumeration that describes possible result codes of a vehicle data entry request.
- *
- * @see com.smartdevicelink.proxy.rpc.DIDResult
- * @see com.smartdevicelink.proxy.rpc.ReadDID
- * @since SmartDeviceLink 2.0
- */
-
-public enum VehicleDataResultCode {
- /**
- * Individual vehicle data item / DTC / DID request or subscription successful
- */
-
- SUCCESS,
- /**
- * DTC / DID request successful, however, not all active DTCs or full contents of DID location available
- *
- * @since SmartDeviceLink 4.0
- */
-
- TRUNCATED_DATA,
- /**
- * This vehicle data item is not allowed for this app .The request is not authorized in local policies.
- */
-
- DISALLOWED,
- /**
- * The user has not granted access to this type of vehicle data item at this time.
- */
-
- USER_DISALLOWED,
- /**
- * The ECU ID referenced is not a valid ID on the bus / system.
- */
-
- INVALID_ID,
- /**
- * The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system.
- */
-
- VEHICLE_DATA_NOT_AVAILABLE,
- /**
- * The vehicle data item is already subscribed.
- */
-
- DATA_ALREADY_SUBSCRIBED,
- /**
- * The vehicle data item cannot be unsubscribed because it is not currently subscribed.
- */
-
- DATA_NOT_SUBSCRIBED,
- /**
- * The request for this item is ignored because it is already in progress
- */
-
- IGNORED;
-
- public static VehicleDataResultCode valueForString(String value) {
- try {
- return valueOf(value);
- } catch (Exception e) {
- return null;
- }
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc.enums; + +/** + * Enumeration that describes possible result codes of a vehicle data entry request. + * + * @see com.smartdevicelink.proxy.rpc.DIDResult + * @see com.smartdevicelink.proxy.rpc.ReadDID + * @since SmartDeviceLink 2.0 + */ + +public enum VehicleDataResultCode { + /** + * Individual vehicle data item / DTC / DID request or subscription successful + */ + + SUCCESS, + /** + * DTC / DID request successful, however, not all active DTCs or full contents of DID location available + * + * @since SmartDeviceLink 4.0 + */ + + TRUNCATED_DATA, + /** + * This vehicle data item is not allowed for this app .The request is not authorized in local policies. + */ + + DISALLOWED, + /** + * The user has not granted access to this type of vehicle data item at this time. + */ + + USER_DISALLOWED, + /** + * The ECU ID referenced is not a valid ID on the bus / system. + */ + + INVALID_ID, + /** + * The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system. + */ + + VEHICLE_DATA_NOT_AVAILABLE, + /** + * The vehicle data item is already subscribed. + */ + + DATA_ALREADY_SUBSCRIBED, + /** + * The vehicle data item cannot be unsubscribed because it is not currently subscribed. + */ + + DATA_NOT_SUBSCRIBED, + /** + * The request for this item is ignored because it is already in progress + */ + + IGNORED; + + public static VehicleDataResultCode valueForString(String value) { + try { + return valueOf(value); + } catch (Exception e) { + return null; + } + } +} diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java index 7d7219453..797ca32e7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java @@ -1,204 +1,208 @@ -/*
- * Copyright (c) 2017 - 2019, 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.
- */
-package com.smartdevicelink.proxy.rpc.enums;
-
-/**
- * Defines the vehicle data types that can be published and subscribed to.
- */
-public enum VehicleDataType {
- /**
- * Notifies GPSData may be subscribed
- */
- VEHICLEDATA_GPS,
- /**
- * Notifies SPEED Data may be subscribed
- */
- VEHICLEDATA_SPEED,
- /**
- * Notifies RPMData may be subscribed
- */
- VEHICLEDATA_RPM,
- /**
- * Notifies FUELLEVELData may be subscribed
- * until Smart Device Link 7.0
- */
- VEHICLEDATA_FUELLEVEL,
- /**
- * Notifies FUELLEVEL_STATEData may be subscribed
- * until Smart Device Link 7.0
- */
- VEHICLEDATA_FUELLEVEL_STATE,
- /**
- * Notifies FUELCONSUMPTIONData may be subscribed
- */
- VEHICLEDATA_FUELCONSUMPTION,
- /**
- * Notifies EXTERNTEMPData may be subscribed
- */
- VEHICLEDATA_EXTERNTEMP,
- /**
- * Notifies VINData may be subscribed
- */
- VEHICLEDATA_VIN,
- /**
- * Notifies PRNDLData may be subscribed
- */
- VEHICLEDATA_PRNDL,
- /**
- * Notifies TIREPRESSUREData may be subscribed
- */
- VEHICLEDATA_TIREPRESSURE,
- /**
- * Notifies ODOMETERData may be subscribed
- */
- VEHICLEDATA_ODOMETER,
- /**
- * Notifies BELTSTATUSData may be subscribed
- */
- VEHICLEDATA_BELTSTATUS,
- /**
- * Notifies BODYINFOData may be subscribed
- */
- VEHICLEDATA_BODYINFO,
- /**
- * Notifies DEVICESTATUSData may be subscribed
- */
- VEHICLEDATA_DEVICESTATUS,
- /**
- * Notifies BRAKINGData may be subscribed
- */
- VEHICLEDATA_BRAKING,
- /**
- * Notifies WIPERSTATUSData may be subscribed
- */
- VEHICLEDATA_WIPERSTATUS,
- /**
- * Notifies HEADLAMPSTATUSData may be subscribed
- */
- VEHICLEDATA_HEADLAMPSTATUS,
- /**
- * Notifies BATTVOLTAGEData may be subscribed
- */
- VEHICLEDATA_BATTVOLTAGE,
- /**
- * Notifies EGINETORQUEData may be subscribed
- */
- VEHICLEDATA_ENGINETORQUE,
- /**
- * Notifies ENGINEOILLIFEData may be subscribed
- */
- VEHICLEDATA_ENGINEOILLIFE,
- /**
- * Notifies ACCPEDALData may be subscribed
- */
- VEHICLEDATA_ACCPEDAL,
- /**
- * Notifies STEERINGWHEELData may be subscribed
- */
- VEHICLEDATA_STEERINGWHEEL,
- /**
- * Notifies ECALLINFOData may be subscribed
- */
- VEHICLEDATA_ECALLINFO,
- /**
- * Notifies AIRBAGSTATUSData may be subscribed
- */
- VEHICLEDATA_AIRBAGSTATUS,
- /**
- * Notifies EMERGENCYEVENTData may be subscribed
- */
- VEHICLEDATA_EMERGENCYEVENT,
- /**
- * Notifies CLUSTERMODESTATUSData may be subscribed
- */
- VEHICLEDATA_CLUSTERMODESTATUS,
- /**
- * Notifies MYKEYData may be subscribed
- */
- VEHICLEDATA_MYKEY,
-
- VEHICLEDATA_FUELRANGE,
-
- /**
- * Notifies TURNSIGNALData may be subscribed
- */
- VEHICLEDATA_TURNSIGNAL,
-
- /**
- * Notifies ELECTRONICPARKBRAKESTATUSData may be subscribed
- */
- VEHICLEDATA_ELECTRONICPARKBRAKESTATUS,
-
- /**
- * Notifies VEHICLEDATA_CLOUDAPPVEHICLEID may be subscribed
- */
- VEHICLEDATA_CLOUDAPPVEHICLEID,
- /**
- * Notifies VEHICLEDATA_OEM_CUSTOM_DATA may be subscribed
- *
- * @since SmartDeviceLink 6.0
- */
- VEHICLEDATA_OEM_CUSTOM_DATA,
-
- /**
- * @since SmartDeviceLink 7.0.0
- */
- VEHICLEDATA_HANDSOFFSTEERING,
-
- /**
- * @since SmartDeviceLink 7.0.0
- */
- VEHICLEDATA_STABILITYCONTROLSSTATUS,
- /**
- * @since SmartDeviceLink 7.0.0
- */
- VEHICLEDATA_WINDOWSTATUS,
- /**
- * @since SmartDeviceLink 7.0.0
- */
- VEHICLEDATA_GEARSTATUS;
-
- /**
- * Convert String to VehicleDataType
- *
- * @param value String
- * @return VehicleDataType
- */
-
- public static VehicleDataType valueForString(String value) {
- try {
- return valueOf(value);
- } catch (Exception e) {
- return null;
- }
- }
-}
+/* + * Copyright (c) 2017 - 2019, 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. + */ +package com.smartdevicelink.proxy.rpc.enums; + +/** + * Defines the vehicle data types that can be published and subscribed to. + */ +public enum VehicleDataType { + /** + * Notifies GPSData may be subscribed + */ + VEHICLEDATA_GPS, + /** + * Notifies SPEED Data may be subscribed + */ + VEHICLEDATA_SPEED, + /** + * Notifies RPMData may be subscribed + */ + VEHICLEDATA_RPM, + /** + * Notifies FUELLEVELData may be subscribed + * until Smart Device Link 7.0 + */ + VEHICLEDATA_FUELLEVEL, + /** + * Notifies FUELLEVEL_STATEData may be subscribed + * until Smart Device Link 7.0 + */ + VEHICLEDATA_FUELLEVEL_STATE, + /** + * Notifies FUELCONSUMPTIONData may be subscribed + */ + VEHICLEDATA_FUELCONSUMPTION, + /** + * Notifies EXTERNTEMPData may be subscribed + */ + VEHICLEDATA_EXTERNTEMP, + /** + * Notifies VINData may be subscribed + */ + VEHICLEDATA_VIN, + /** + * Notifies PRNDLData may be subscribed + */ + VEHICLEDATA_PRNDL, + /** + * Notifies TIREPRESSUREData may be subscribed + */ + VEHICLEDATA_TIREPRESSURE, + /** + * Notifies ODOMETERData may be subscribed + */ + VEHICLEDATA_ODOMETER, + /** + * Notifies BELTSTATUSData may be subscribed + */ + VEHICLEDATA_BELTSTATUS, + /** + * Notifies BODYINFOData may be subscribed + */ + VEHICLEDATA_BODYINFO, + /** + * Notifies DEVICESTATUSData may be subscribed + */ + VEHICLEDATA_DEVICESTATUS, + /** + * Notifies BRAKINGData may be subscribed + */ + VEHICLEDATA_BRAKING, + /** + * Notifies WIPERSTATUSData may be subscribed + */ + VEHICLEDATA_WIPERSTATUS, + /** + * Notifies HEADLAMPSTATUSData may be subscribed + */ + VEHICLEDATA_HEADLAMPSTATUS, + /** + * Notifies BATTVOLTAGEData may be subscribed + */ + VEHICLEDATA_BATTVOLTAGE, + /** + * Notifies EGINETORQUEData may be subscribed + */ + VEHICLEDATA_ENGINETORQUE, + /** + * Notifies ENGINEOILLIFEData may be subscribed + */ + VEHICLEDATA_ENGINEOILLIFE, + /** + * Notifies ACCPEDALData may be subscribed + */ + VEHICLEDATA_ACCPEDAL, + /** + * Notifies STEERINGWHEELData may be subscribed + */ + VEHICLEDATA_STEERINGWHEEL, + /** + * Notifies ECALLINFOData may be subscribed + */ + VEHICLEDATA_ECALLINFO, + /** + * Notifies AIRBAGSTATUSData may be subscribed + */ + VEHICLEDATA_AIRBAGSTATUS, + /** + * Notifies EMERGENCYEVENTData may be subscribed + */ + VEHICLEDATA_EMERGENCYEVENT, + /** + * Notifies CLUSTERMODESTATUSData may be subscribed + */ + VEHICLEDATA_CLUSTERMODESTATUS, + /** + * Notifies MYKEYData may be subscribed + */ + VEHICLEDATA_MYKEY, + + VEHICLEDATA_FUELRANGE, + + /** + * Notifies TURNSIGNALData may be subscribed + */ + VEHICLEDATA_TURNSIGNAL, + + /** + * Notifies ELECTRONICPARKBRAKESTATUSData may be subscribed + */ + VEHICLEDATA_ELECTRONICPARKBRAKESTATUS, + + /** + * Notifies VEHICLEDATA_CLOUDAPPVEHICLEID may be subscribed + */ + VEHICLEDATA_CLOUDAPPVEHICLEID, + /** + * Notifies VEHICLEDATA_OEM_CUSTOM_DATA may be subscribed + * + * @since SmartDeviceLink 6.0 + */ + VEHICLEDATA_OEM_CUSTOM_DATA, + + /** + * @since SmartDeviceLink 7.0.0 + */ + VEHICLEDATA_HANDSOFFSTEERING, + + /** + * @since SmartDeviceLink 7.0.0 + */ + VEHICLEDATA_STABILITYCONTROLSSTATUS, + /** + * @since SmartDeviceLink 7.0.0 + */ + VEHICLEDATA_WINDOWSTATUS, + /** + * @since SmartDeviceLink 7.0.0 + */ + VEHICLEDATA_GEARSTATUS, + /** + * @since SmartDeviceLink 7.1.0 + */ + VEHICLEDATA_SEATOCCUPANCY; + + /** + * Convert String to VehicleDataType + * + * @param value String + * @return VehicleDataType + */ + + public static VehicleDataType valueForString(String value) { + try { + return valueOf(value); + } catch (Exception e) { + return null; + } + } +} |