Skip to content

Commit 7037c88

Browse files
committed
readme update
1 parent efd6ef1 commit 7037c88

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

readme.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,24 @@ To use this port, in this project, an ELM327 chip has been used, since it can ab
7272
#### Caveats
7373

7474
Although the OBD-2 port could been reverse-engineered and read data such as steering angles and air-bag crashes, these change from manufacturer to manufacturer. This project uses only standard codes so that it can remain valid for every car manufacturer. This is the reason why currently only the deceleration is taken into account when DENM are generated.
75+
76+
## Message Structure
77+
78+
The structure is used both for the DENM and the CAM, so a `type_message` enum is used to distinguish them.
79+
80+
```cpp
81+
enum type_message : uint8_t{
82+
CAM = 0,
83+
DEMN = 1
84+
};
85+
86+
typedef struct{
87+
type_message type;
88+
uint8_t sender_address[6]; //original sender, not change when the message is forwarded
89+
uint8_t coordinates[3]; //currently not used, but present in the standard
90+
uint8_t severity; //from 0 to 5, used only for the DENM
91+
uint8_t speed; //read from the ODB port
92+
uint8_t debug; //boolean; when debugging, the speed is random
93+
uint8_t rebroadcasted; //boolean; becomes true after the first time the packet is forwarded
94+
} message;
95+
```

0 commit comments

Comments
 (0)