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 14:04] arnaud [Table of content access] |
projects:crazyflie:firmware:log [2013-03-20 10:14] arnaud |
||
---|---|---|---|
Line 5: | Line 5: | ||
This mechanism is used both for regular log operation (ie. user requested log to inspect and debug flight data) but also to update indication in the GUI application. | This mechanism is used both for regular log operation (ie. user requested log to inspect and debug flight data) but also to update indication in the GUI application. | ||
- | Each variable to log is contained in a | + | Each variable to log is contained in a group group and has a name. The system is designed to make it easy to add a log variable in the Firmware and have it available in the ground station GUI: |
- | ===== 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 element === | ||
- | |||
- | < | ||
- | Request (PC to Copter): | ||
- | +--------------+------------+ | ||
- | | GET_ITEM (0) | Element ID | | ||
- | +--------------+------------+ | ||
- | Length | ||
- | |||
- | Answer (Copter to PC): | ||
- | +--------------+------------+------+------------+--------------+ | ||
- | | GET_ITEM (0) | Element ID | Type | | ||
- | +--------------+------------+------+------------+--------------+ | ||
- | Length | ||
- | </ | ||
- | ^ Request fields ^ Content | ||
- | | GET_ITEM | ||
- | | Element ID | ID of the element to be retrieved. The variables are numbered from 0 to LOG_LEN (see GET_INFO command) | | ||
- | |||
- | ^ Answer fields | ||
- | | GET_ITEM | ||
- | | Element ID | ID of the element 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 | | ||