Skip to content

Commit 2764db6

Browse files
author
Brendan Whitfield
committed
updated protocol readme with expanded data field
1 parent bee7ed7 commit 2764db6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

obd/protocols/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
Notes
22
-----
33

4-
Each protocol object is callable, and accepts a list of raw input strings, and returns a list of parsed `Message` objects. The `data` field will contain a bytearray, corresponding to all relevant data returned by the command.
5-
6-
*Note: `Message.data` does not refer to the full data field of a message. Things like PCI/Mode/PID bytes are often removed. If you want to see these fields, use `Frame.data` for the full (per-spec) data field.*
4+
This code is meant to abstract the transport and physical layers of an OBD-II connection. Each protocol is a callable object, and accepts a list of strings as input (from the adapter), and returns a list of parsed `Message` objects. The `Message.data` field will contain a bytearray, corresponding to the application layer data returned by the command. This implementation is specific to the formatting of the ELM327 chip inside the adapter.
75

86
For example, these are the resultant `Message.data` fields for some single frame messages:
97

108
```
119
A CAN Message:
1210
7E8 06 41 00 BE 7F B8 13
13-
[ data ]
11+
[ data ]
1412
1513
A J1850 Message:
1614
48 6B 10 41 00 BE 7F B8 13 FF
17-
[ data ]
15+
[ data ]
1816
```
1917

2018
The parsing itself (invoking `__call__`) is stateless. The only stateful part of a `Protocol` is the `ECU_Map`. These objects correlate OBD transmitter IDs (`tx_id`'s) with the various ECUs in the car. This way, `Message` objects can be marked with ECU constants such as:

0 commit comments

Comments
 (0)