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:crtp:log [2013-03-20 09:32] arnaud |
projects:crazyflie:crtp:log [2013-03-20 10:45] macke |
||
---|---|---|---|
Line 2: | Line 2: | ||
For more information on how to use this and how this is implemented have a look [[projects: | For more information on how to use this and how this is implemented have a look [[projects: | ||
- | ===== State machine | + | ====== State machines ====== |
+ | ===== Downloading the Table Of Contents ===== | ||
< | < | ||
- | / | + | /----------------\ |
- | | + | --> | Fetch TOC info |----->| Fetch TOC item |---->| More items? |--------> |
- | \----------------/ | + | \----------------/ |
+ | | ||
+ | | ||
+ | | ||
+ | Yes | ||
</ | </ | ||
- | + | ====== Communication protocol | |
- | + | ||
- | ===== Communication protocol ===== | + | |
The log port is separated in 3 channels: | The log port is separated in 3 channels: | ||
^ **Port** | ^ **Port** | ||
- | | | + | | |
- | | | + | | |
- | | | + | | |
- | + | ||
- | ==== Table of content access ==== | + | |
- | This channel is used to access | + | ===== Table of content access ===== |
+ | This channel is used to download the Table Of Contents that contains all the variables | ||
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. | 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. | ||
Line 30: | Line 31: | ||
| 1 | GET_INFO | | 1 | GET_INFO | ||
- | === Get TOC item === | + | ==== 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). | 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). | ||
Line 62: | Line 63: | ||
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. | ||
- | === Get Info === | + | ==== 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. | 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. | ||
Line 90: | Line 91: | ||
| 7 | LOG_MAX_OPS | | 7 | LOG_MAX_OPS | ||
- | ==== Log control ==== | + | ===== Log control |
The log control channel permits to setup, activate, deactivate and remove log packets. Like the TOC access channel the first data byte represents a command. | The log control channel permits to setup, activate, deactivate and remove log packets. Like the TOC access channel the first data byte represents a command. | ||
Line 101: | Line 102: | ||
| 4 | STOP_BLOCK | | 4 | STOP_BLOCK | ||
- | === Create block === | + | ==== Create block ==== |
- | === Append variable to block === | + | ==== Append variable to block ==== |
- | === Delete block === | + | ==== Delete block ==== |
- | === Start block === | + | ==== Start block ==== |
- | === Stop block === | + | ==== Stop block ==== |
- | ==== Log data ==== | + | ===== Log data ===== |
The log data channel is used by the copter to send the log blocks at the programmed rate. The packet format is | The log data channel is used by the copter to send the log blocks at the programmed rate. The packet format is | ||
Line 127: | Line 128: | ||
| 1 | ID | Timestamp in ms from the copter startup as a little-endian 3 bytes integer | | | 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 | | | 4.. | Log variable values | Packed log values in little endian format | | ||
- |