OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
obd2.obd_pid_decoder.ObdPidDecoder Class Reference

Decoder contract for a standardized OBD-II PID. More...

Public Member Functions

int mode (self)
 Return the SAE J1979 service mode.
int pid (self)
 Return the parameter identifier.
str unit (self)
 Return the canonical unit of the decoded value.
T_co|None decode (self, bytes data)
 Decode response payload bytes.

Detailed Description

Decoder contract for a standardized OBD-II PID.

Decoders return values in the canonical units defined by SAE J1979. Display-unit conversion belongs in the application or presentation layer.

Member Function Documentation

◆ decode()

T_co | None obd2.obd_pid_decoder.ObdPidDecoder.decode ( self,
bytes data )

Decode response payload bytes.

Parameters
dataPID payload excluding mode and PID bytes.
Returns
Decoded value, or None when payload bytes are insufficient.

The documentation for this class was generated from the following file:
  • protocols/obd2/obd_pid_decoder.py