Products
-
-
- Accessories
- Breakout boards
This is an old revision of the document!
The parameters system makes all the gettable and settable parameters of the copter accessible. The copter holds a table of parameters which can be retrieved. In this table every parameter name is associated with an ID and a group name. Three IDs are used to acces the TOC and the parameters:
Port | Channel | Function |
---|---|---|
2 | 0 | TOC access |
2 | 1 | Parameter read |
2 | 2 | Parameter write |
These messages permit to access the parameters table of content. The first byte of the message is a message ID, three messages ID are defined:
Message ID | Meaning in upstream packets | Meaning in downstream packets |
---|---|---|
0 | Reset TOC pointer | Last TOC element |
1 | Get next TOC element | TOC element (ID, type, group, name) |
3 | Get TOC CRC32 | Number of parameters, TOC CRC32 |
The upstream ID are commands and are sent alone. The downstream has the following formats:
Bytes 1 1 1 Null terminated strings +---+------------+------+----------+--------------+ | 0 | | | | | +---+ Param ID | Type | Group | Name | | 1 | | | | | +---+------------+------+---+------+--------------+ | 3 | Num. Param | CRC32 | +---+------------+----------+ Bytes 1 1 4
The parameters are sequentially requested by the PC until the end. When the last parameter is reached it has the ID 0 'Last TOC element'. The reset command permits to reset the TOC pointers so that the next sent TOC element will be the first one. The “Get TOC CRC” command also returns the number of parameters.
The CRC32 is a hash of the copter TOC. This is aimed at implementing caching of the TOC in the PC Utils to avoid fetching the full TOC each time the copter is connected.
The following messages are sent from the client to the Crazyflie:
Request for | Byte | Description |
---|---|---|
Parameter read | 0 | The id of the parameter to read |
Parameter write | 0 | The id of the parameter to write |
1 | The value to set |
The following messages are sent from the Crazyflie to the client:
Reply for | Byte | Description |
---|---|---|
Parameter read & write | 0 | Parameter id |
1-n | Parameter value |