DoCAN OBD-II Server Demo
There is an example implementation of OBD-II server available in apps folder. In this implementation, a model ECU is created to mimic various features.
Following DTC test codes are available in the example:
DTC Record |
Size |
Description |
---|---|---|
0x12 |
4 Bytes |
CAN transmit counter |
0x34 |
4 Bytes |
CAN receive counter |
0x56 |
1 Byte |
AIR Bag status |
Following Parameter IDs are available in the example:
Service ID |
PID number |
Size |
Description |
---|---|---|---|
0x01 |
0x01 |
1 Byte |
DTC Count: Number of stored diagnostic trouble codes (DTCs). |
0x01 |
0x05 |
1 Byte |
Coolant Temperature: Engine coolant temperature in degrees Celsius. |
0x01 |
0x0A |
1 Byte |
Fuel Pressure: Fuel rail pressure in kPa (kilopascals). |
0x01 |
0x0B |
1 Byte |
Manifold Pressure: Intake manifold pressure in kPa. |
0x01 |
0x0C |
2 Bytes |
Engine RPM: Engine speed in RPM (revolutions per minute). |
0x01 |
0x0D |
1 Byte |
Vehicle Speed: Vehicle speed in km/h (kilometers per hour). |
0x01 |
0x0E |
1 Byte |
Timing Advance: Ignition timing advance in degrees before top dead center (BTDC). |
0x01 |
0x0F |
1 Byte |
Intake Air Temperature: Intake air temperature in degrees Celsius. |
0x01 |
0x11 |
1 Byte |
Throttle Position: Throttle position as a percentage of maximum. |
0x01 |
0x2F |
1 Byte |
Fuel Tank Level: Fuel tank level as a percentage of full. |
0x01 |
0x5A |
1 Byte |
Accelerator Position: Accelerator pedal position as a percentage. |
0x01 |
0x5C |
1 Byte |
Oil Temperature: Engine oil temperature in degrees Celsius. |
0x01 |
0x5E |
1 Byte |
Fuel Flow Rate: Fuel flow rate in liters per hour. |
0x09 |
0x02 |
21 Byte |
VIN Number value “Hello From OBD Server” |
0x09 |
0x0A |
21 Byte |
ECU Name value “HELLO TECH:SYS:01234” |
While all the implementation are meant to be tested without any underlying hardware, enabling a compile time macro PLATFORM_TEST_SUPPORT, will call some function that can be used to certain real functionalities such as LED on etc.
Request Current Diagnostic Data (0x01) service
Requests real-time data from the vehicle’s ECU. like Engine RPM, Vehicle Speed etc
Freeze Frame Data (0x02) service
Yet to be implemented for example
Request Diagnostic Trouble Codes (DTCs) (0x03) service
The DTC group code is printed out. In PLATFORM_TEST_SUPPORT mode,CAN transmit/receive counters are cleared.
Clear Diagnostic Information (0x04) service
The DTC group code is printed out.
Request Oxygen Sensor Monitoring Test Results (0x05) service
Yet to be implemented for example
Request On-Board Monitoring Test Results for Specific Monitored Systems (0x06) service
Yet to be implemented for example
Request Control of On-Board System, Test or Component (0x08) service
Yet to be implemented for example
Request Vehicle Information (0x09) service
Requests vehicle-specific information such as VIN and ECU name.
Refer to the OBD protocol page for more details ISO15031 - OBD Protocol.