The purpose of this guide is to explain how vehicle data items can be exposed to app developers through the HMI.
Vehicle data can be exposed to app developers by creating a VehicleInfo
component within your HMI. To communicate with this component, you will first need to register it with the message broker and respond to the VehicleInfo.IsReady
message from SDL (see the Component Readiness Requests section for more information).
Below are descriptions for the primary RPCs used by the VehicleInfo
component of SDL. More information regarding this component is available in the VehicleInfo
section of the HMI Documentation.
Description:
A request from Core to retrieve specific vehicle data items from the system.
Example Request:
{ "id": 123, "jsonrpc": "2.0", "method": "VehicleInfo.GetVehicleData", "params" : { "speed" : true } }
Example Response:
{ "id": 123, "jsonrpc": "2.0", "result" : { "speed" : 100 } }
Description:
A request from Core to receive periodic updates for specific vehicle data items from the system.
Example Request:
{ "id": 123, "jsonrpc": "2.0", "method": "VehicleInfo.SubscribeVehicleData", "params" : { "speed" : true } }
Example Response:
{ "id": 123, "jsonrpc": "2.0", "result" : { "speed" : { "dataType" : "VEHICLEDATA_SPEED", "resultCode" : "SUCCESS" } } }
Description:
A request from Core to stop receiving periodic updates for specific vehicle data items from the system.
Example Request:
{ "id": 123, "jsonrpc": "2.0", "method": "VehicleInfo.UnsubscribeVehicleData", "params" : { "speed" : true } }
Example Response:
{ "id": 123, "jsonrpc": "2.0", "result" : { "speed" : { "dataType" : "VEHICLEDATA_SPEED", "resultCode" : "SUCCESS" } } }
Description:
A notification from the HMI indicating that one or more of the subscribed vehicle data items were updated.
Example Notification:
{ "jsonrpc": "2.0", "method": "VehicleInfo.OnVehicleData", "result" : { "speed" : 100 } }
Below is a list of all of the vehicle data items which are available via SDL as of Release 6.1.0 of SDL Core. New vehicle data items are proposed regularly via the SDL Evolution process.
Name | Result Type | Description |
---|---|---|
accPedalPosition | Float | Accelerator pedal position (as a number from 0 to 100 representing percentage depressed) |
beltStatus | Common.BeltStatus | The status of each of the seat belts in the vehicle |
bodyInformation | Common.BodyInformation | The body information for the vehicle, including information such as ignition status and door status |
climateData | Common.ClimateData | Describes the climate status within the vehicle. |
cloudAppVehicleID | String | Parameter used by cloud apps to identify a head unit |
deviceStatus | Common.DeviceStatus | The device status, including information such as signal and battery strength |
driverBraking | Common.VehicleDataEventStatus | The status of the brake pedal |
electronicParkBrakeStatus | Common.ElectronicParkBrakeStatus | The status of the park brake as provided by Electric Park Brake (EPB) system |
engineOilLife | Float | The estimated percentage of remaining oil life of the engine |
engineTorque | Float | Torque value for the engine (in N*m) on non-diesel variants |
externalTemperature | Float | The external temperature in degrees celsius |
fuelLevel_State | Common.ComponentVolumeStatus | The status value corresponding to the general fuel level in the tank |
fuelLevel | Float | The fuel level in the tank (as a percentage value) |
fuelRange | Common.FuelRange Array | The estimate range in KM the vehicle can travel based on fuel level and consumption. Contains information on all fuel sources available to the vehicle (eg. GASOLINE and BATTERY for hybrid vehicles). |
gearStatus | Common.GearStatus | The current status of the gear shifter. |
gps | Common.GPSData | Location data from the onboard GPS in the vehicle |
handsOffSteering | Boolean | Indicates whether the driver's hands are off the steering wheel. |
headLampStatus | Common.HeadLampStatus | The current status of each of the head lamps |
instantFuelConsumption | Float | The instantaneous fuel consumption of the vehicle in microlitres |
odometer | Integer | The odometer value in kilometers |
prndl | Common.PRNDL | The current status of the gear shifter. This parameter is deprecated and it is now covered in gearStatus . |
rpm | Integer | The number of revolutions per minute of the engine |
seatOccupancy | Common.SeatOccupancy | Describes the occupancy, belted status, and location for each seat in the vehicle. |
speed | Float | The vehicle speed in kilometers per hour |
stabilityControlsStatus | Common.StabilityControlsStatus | Describes the ignition switch stability. |
steeringWheelAngle | Float | The current angle of the steering wheel (in degrees) |
tirePressure | Common.TireStatus | Status information for each of the vehicle's tires |
turnSignal | Common.TurnSignal | The current state of the turn signal indicator |
vin | String | Vehicle identification number |
windowStatus | Common.WindowStatus Array | Describes the status of each window for each door/liftgate etc. |
wiperStatus | Common.WiperStatus | The current status of the wipers |
Starting with SDL Core version 6.0.0, custom vehicle data items can be defined via the policy table. See SDL-0173 for the full proposal details. These items are structured in a similar manner to the Mobile API and contained in the vehicle_data
section of the policy table.
In addition to custom items, this feature can be used to expose other vehicle data items that were introduced to the project in later versions. This can be useful when the software version on the head unit cannot be updated easily. If a vehicle data item is added into the project, the definition of this item will be included in the policy table by default. Any vehicle data items which are defined in Core's local Mobile API will be ignored from the policy table, but newer items will be interpreted as custom items. This allows apps to use these data items normally if they are exposed by the head unit, even when they were not initially supported.
"vehicle_data": { "schema_version": "1.0.0", "schema_items": [ ... { "name": "customString", "key": "KEY_CUSTOM_STRING", "minlength": 0, "maxlength": 100, "type": "String", "mandatory": false }, { "name": "customInt", "key": "KEY_CUSTOM_INT", "minvalue": 0, "maxvalue": 100, "type": "Integer", "mandatory": false }, { "name": "customFloat", "key": "KEY_CUSTOM_FLOAT", "minvalue": 0.0, "maxvalue": 100.0, "type": "Float", "mandatory": false }, { "name": "customBool", "key": "KEY_CUSTOM_BOOL", "type": "Boolean", "mandatory": false }, { "name": "customArray", "key": "KEY_CUSTOM_ARRAY", "type": "String", "array": true, "minsize": 0, "maxsize": 100, "mandatory": false }, { "name": "customStruct", "params": [ { "name": "customStructVal", "key": "KEY_CUSTOM_STRUCT_VAL", "type": "String", "mandatory": true }, { "name": "customStructVal2", "key": "KEY_CUSTOM_STRUCT_VAL2", "minvalue": 0, "maxvalue": 100, "type": "Integer", "mandatory": true }, { "name": "customDeprecatedVal", "key": "KEY_CUSTOM_DEPRECATED_VAL", "minvalue": 0, "maxvalue": 100, "type": "Integer", "mandatory": true, "until": "7.0" }, { "name": "customDeprecatedVal", "key": "KEY_CUSTOM_DEPRECATED_VAL", "minvalue": 0, "maxvalue": 100, "type": "Integer", "mandatory": true, "deprecated": true, "since": "7.0" } ], "key": "KEY_CUSTOM_STRUCT", "type": "Struct", "mandatory": false } ] }
customStruct
) for structure definition.Custom vehicle data requests have a separate structure to normal vehicle data requests. While normal vehicle data items are requested using the key structure of "<name>: true"
, custom items are constructed using the key field and can have a nested structure (when requesting Struct items). For example, when requesting all of the vehicle data items which are defined above, the HMI would receive the following message:
{ "id" : 139, "jsonrpc" : "2.0", "method" : "VehicleInfo.GetVehicleData", "params" : { "KEY_CUSTOM_STRING": true, "KEY_CUSTOM_INT": true, "KEY_CUSTOM_FLOAT": true, "KEY_CUSTOM_BOOL": true, "KEY_CUSTOM_ARRAY": true, "KEY_CUSTOM_STRUCT": { "KEY_CUSTOM_STRUCT_VAL": true, "KEY_CUSTOM_STRUCT_VAL2": true, "KEY_CUSTOM_DEPRECATED_VAL": true } } }
Since these keys may not be immediately known by the HMI, a vehicle data mapping file can be used to connect these keys to actual readable values from the vehicle. The HMI primarily uses this file to convert CAN data values into an SDL-compatible format. The location where this file is hosted can be specified in the policy table in the module_config.endpoints.custom_vehicle_data_mapping
field (see Policy Endpoints). The format of this file is OEM-defined.
{ "version":"0.0.1", "date":"01-01-2020", "vehicleDataTable": [ { "CGEA1.3c":{ "defaultPowertrain": { "vehicleData": [ ] }, "PHEV":{ "vehicleData":[ { "key":"OEM_REF_FUELLEVEL", "type":"Integer", "minFrequency":200, "maxLatency":10, "messageName":"Cluster_Info3", "messageID":"0x434", "signalName":"FuelLvl_Pc_Dsply", "transportChannel":"HS3", "resolution":0.109, "offset":-5.2174 } ] } } } ] }
In order for the HMI to determine when this file needs to be updated, this file can be assigned a version via the module_config.endpoint_properties.custom_vehicle_data_mapping.version
field. The HMI can retrieve this field using the SDL.GetPolicyConfigurationData RPC.
In addition to complex vehicle data items, the vehicle data mapping file can also be used to make some CAN values directly readable via a String value:
{ "name":"messageName", "type":"String", "key":"OEM_REF_MSG", "array":true, "mandatory":false, "since":"X.x", "maxsize":100, "params":[] }
{ "messageName": "AB 04 D1 9E 84 5C B8 22" }