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 22:31] arnaud |
projects:crazyflie:firmware:log [2012-12-09 22:31] arnaud [Log control] |
||
---|---|---|---|
Line 14: | Line 14: | ||
^ **Port** | ^ **Port** | ||
- | | 5 | 0 | Table of content access | | + | | 1 | 0 | Table of content access | |
- | | 5 | 1 | Log control | | + | | 1 | 1 | Log control | |
- | | 5 | 2 | Log data | | + | | 1 | 2 | Log data | |
==== Table of content access ==== | ==== Table of content access ==== | ||
Line 47: | Line 47: | ||
Length | Length | ||
</ | </ | ||
- | ^ Request fields ^ Content | + | ^ Byte ^ Request fields ^ Content |
- | | GET_ITEM | + | | 0 | GET_ITEM |
- | | ID | ID of the item to be retrieved. The variables are numbered from 0 to LOG_LEN (see GET_INFO command) | | + | | 1 | ID | ID of the item to be retrieved. The variables are numbered from 0 to LOG_LEN (see GET_INFO command) | |
- | ^ Answer fields | + | ^ Byte ^ Answer fields |
- | | GET_ITEM | + | | 0 | GET_ITEM |
- | | ID | ID of the item returned | + | | 1 | ID | ID of the item returned |
- | | Type | Variable type of the element. See variable types list | | + | | 2 | Type | Variable type of the element. See variable types list | |
- | | Group | Null-terminated string containing variable group | | + | | 3.. |
- | | 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. | Type, group and name are not sent if the required ID is higher than TOC_LEN-1. | ||
Line 78: | Line 78: | ||
</ | </ | ||
- | ^ Request fields ^ Content | + | ^ Byte ^ Request fields ^ Content |
- | | GET_INFO | + | | 0 | GET_INFO |
- | ^ Answer fields | + | ^ Byte ^ Answer fields |
- | | GET_INFO | + | | 0 | GET_INFO |
- | | LOG_LEN | + | | 1 | LOG_LEN |
- | | LOG_CRC | + | | 2 | LOG_CRC |
- | | LOG_MAX_PACKET | Maximum number of log packets that can be programmed in the copter | | + | | 6 | LOG_MAX_PACKET | Maximum number of log packets that can be programmed in the copter | |
- | | LOG_MAX_OPS | + | | 7 | LOG_MAX_OPS |
==== Log control ==== | ==== Log control ==== | ||
Line 93: | Line 93: | ||
^ Control command byte ^ Command | ^ Control command byte ^ Command | ||
- | | 0 | ADD_BLOCK | + | | 0 | CREATE_BLOCK |
| 1 | APPEND_BLOCK | | 1 | APPEND_BLOCK | ||
- | | 2 | DEL_BLOCK | + | | 2 | DELETE_BLOCK |
| 3 | START_BLOCK | | 3 | START_BLOCK | ||
| 4 | STOP_BLOCK | | 4 | STOP_BLOCK | ||
+ | === Create block === | ||
+ | |||
+ | === Append variable to block === | ||
+ | |||
+ | === Delete block === | ||
+ | |||
+ | === Start block === | ||
+ | |||
+ | === Stop block === | ||
+ | |||
+ | ==== Log data ==== | ||
+ | |||
+ | The log data channel is used by the copter to send the log blocks at the programmed rate. The packet format is | ||
+ | |||
+ | < | ||
+ | Answer (Copter to PC): | ||
+ | +---------+------------+---------// | ||
+ | | BLOC_ID | TIME_STAMP | LOG VARIABLE VALUES | | ||
+ | +---------+------------+---------// | ||
+ | Length | ||
+ | </ | ||
+ | |||
+ | ^ Byte ^ Answer fields | ||
+ | | 0 | BLOCK_ID | ||
+ | | 1 | ID | Timestamp in ms from the copter startup as a little-endian 3 bytes integer | | ||
+ | | 4.. | Log variable values | Packed log values in little endian format | | ||