Newer
Older
The MicroCART project uses custom packets to communicate with the quad. This may seem complex at first
but the structure of all packets is the same it is just the way the data is formatted that changes
between packets. The basic structure is shown below.
| Index | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|:-----------------:|:---------------:|:------------:|:----------:|:-----------:|:----:|:--------:|:-------------:|
| Message Parameter | Begin Character | Message Type | Message ID | Data Length | Data | Checksum | End Character |
| Bytes | 1 | 2 | 2 | 2 | var | 1 | 1 |
Both the begin and end characters are defined in (communication.h)[]. Message types are defined within an enum in
(commands.h)[]. Message ID is managed within the backend and is just a counter that is defined in (backend.c)[] of.
Data length varies with the command that is being sent, but the length of a command is constant. The data is sent
in a specific format set by commands. Lastly, checksum is computed within (backend.c)[].