This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
projects:crazyflie:firmware:log [2012-10-07 15:44] arnaud [Crazyflie LOG subsystem] |
projects:crazyflie:firmware:log [2013-03-20 10:14] arnaud |
||
---|---|---|---|
Line 8: | Line 8: | ||
{{: | {{: | ||
- | |||
- | ===== Communication protocol ===== | ||
- | |||
- | The log port is separated in 3 channels: | ||
- | |||
- | ^ **Port** | ||
- | | | ||
- | | | ||
- | | | ||
- | |||
- | ==== Table of content access ==== | ||
- | |||
- | This channel is used to access the loggable variables table of content. | ||
- | |||
- | The first byte of each messages correspond a command. All communication on this port are initated by the client and all answer from the copter will contain the same command byte. | ||
- | |||
- | ^ TOC command byte ^ Command | ||
- | | 0 | GET_ITEM | ||
- | | 1 | GET_INFO | ||
- | |||
- | === Get TOC item === | ||
- | |||
- | The GET_ITEM TOC command permits to retrieved the log variables name, group and types from the copter. This command is intended to be requested from all the ID from 0 to LOG_LEN (see GET_INFO). | ||
- | |||
- | < | ||
- | Request (PC to Copter): | ||
- | +--------------+----+ | ||
- | | GET_ITEM (0) | ID | | ||
- | +--------------+----+ | ||
- | Length | ||
- | |||
- | Answer (Copter to PC): | ||
- | +--------------+----+ | ||
- | | GET_ITEM (0) | ID | If index out of range | ||
- | +--------------+----+------+------------+--------------+ | ||
- | | GET_ITEM (0) | ID | Type | | ||
- | +--------------+----+------+------------+--------------+ | ||
- | Length | ||
- | </ | ||
- | ^ Request fields ^ Content | ||
- | | GET_ITEM | ||
- | | ID | ID of the item to be retrieved. The variables are numbered from 0 to LOG_LEN (see GET_INFO command) | | ||
- | |||
- | ^ Answer fields | ||
- | | GET_ITEM | ||
- | | ID | ID of the item returned | ||
- | | Type | Variable type of the element. See variable types list | | ||
- | | Group | Null-terminated string containing variable group | | ||
- | | Name | Null-terminated string containing the variable name | | ||
- | |||
- | Type, group and name are not sent if the required ID is higher than TOC_LEN-1. | ||
- | |||
- | === Get Info === | ||
- | |||
- | The get info command is intended to be requested first when connecting to the copter. This permits to know the number of variable, the limitations of the log implementation and the fingerprint of the log variables. | ||
- | |||
- | < | ||
- | Request (PC to Copter): | ||
- | +--------------+ | ||
- | | GET_INFO (1) | | ||
- | +--------------+ | ||
- | Length | ||
- | |||
- | Answer (Copter to PC): | ||
- | +--------------+---------+---------+-----------------+-------------+ | ||
- | | GET_INFO (1) | LOG_LEN | LOG_CRC | LOG_MAX_PACKET | LOG_MAX_OPS | | ||
- | +--------------+---------+---------+-----------------+-------------+ | ||
- | Length | ||
- | </ | ||
- | |||
- | ^ Request fields ^ Content | ||
- | | GET_INFO | ||
- | |||
- | ^ Answer fields | ||
- | | GET_INFO | ||
- | | LOG_LEN | ||
- | | LOG_CRC | ||
- | | LOG_MAX_PACKET | Maximum number of log packets that can be programmed in the copter | | ||
- | | LOG_MAX_OPS | ||