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:comm_protocol [2013-09-16 16:20] ledvinap |
projects:crazyflie:firmware:comm_protocol [2013-09-16 19:32] ledvinap [Logging] |
||
---|---|---|---|
Line 216: | Line 216: | ||
The following format is used to identify a variable that is to be logged from the Crazyflie | The following format is used to identify a variable that is to be logged from the Crazyflie | ||
+ | Log Type represents type of value sent in packet. Logged value is converted to this type before storing into log packet. Upper bytes will be discarded if Log Type is integer and value does not fit. | ||
^ **Log Type** | ^ **Log Type** | ||
Line 227: | Line 228: | ||
| | | | ||
- | ^ **Storage Type** | + | ^ **Storage Type** |
- | | | + | | |
| | | | ||
| | | | ||
Line 237: | Line 238: | ||
| | | | ||
+ | TOC variable request (Storage type is ignored): | ||
< | < | ||
7 | 7 | ||
+---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | ||
- | | Log type | Storage type | + | | Storage type |
+---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | ||
| Variable ID | | | Variable ID | | ||
Line 246: | Line 248: | ||
</ | </ | ||
+ | Arbitrary memory address request: | ||
< | < | ||
7 | 7 | ||
+---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | ||
- | | Log type | + | | Storage type | Log type | |
+ | +---+---+---+---+---+---+---+---+ | ||
+ | | 0xff | | ||
+---+---+---+---+---+---+---+---+ | +---+---+---+---+---+---+---+---+ | ||
| Mem Address 0 | | | Mem Address 0 | | ||
Line 262: | Line 267: | ||
- | == List of return codes == | + | == List of return codes ( errno.h codes are used ) == |
^ **Error** | ^ **Error** | ||
- | | 0x00 | + | | |
- | | 0x01 | + | | |
- | | 0x02 | + | | E2BIG (7) |
- | | 0xFF | + | | |
+ | | ENOMEM (12) | No memory to allocate Log Block or Log Item | ||
== Usage == | == Usage == | ||
- | Adding a new log block to the settings: | + | Adding a new log block with id 0x0a with variable 0x55 type uint32_t and variable 0x66 type float32 |
< | < | ||
| | ||
| | ||
- | Add log packet | + | Add log block |
- | < | + | < |
[DONE] | [DONE] | ||
Packet structure: | Packet structure: | ||
- | Computer -> CF : 0x[5,1] 0x00 0x01 0x0A 0x02 0x55 | + | Computer -> CF : 0x[5,1] 0x00 0x0a 0x03 0x55 0x07 0x66 |
- | CF -> Computer : 0x[5,1] 0x00 0x55 0x00 | + | CF -> Computer : 0x[5,1] 0x00 0x0a 0x00 |
</ | </ | ||
- | Deleting an existing log block from the settings: | + | Deleting an existing log block 0x55 from the settings: |
< | < | ||
| | ||
Line 300: | Line 306: | ||
< | < | ||
- | Adding a log block logging variable ID 0x55 at 100ms interval and of type uint16: | + | Adding a log block 0xbb at 100ms interval |
- | Computer -> CF : 0x[5,1] 0x00 0x01 0x0A 0x02 0x55 | + | Computer -> CF : 0x[5,1] 0x00 0xbb 0x02 0x55 // create logging block |
CF -> Computer : 0x[5,1] 0x00 0x55 0x00 | CF -> Computer : 0x[5,1] 0x00 0x55 0x00 | ||
+ | Computer -> CF : 0x[5,1] 0x00 0xbb 0x0A // start sending block with 100ms interval | ||
- | Receiving a log block logging variable (value 0xBABE): | + | Receiving a log block 0xbb 1300ms |
- | CF -> Computer : 0x[5, | + | CF -> Computer : 0x[5, |
</ | </ | ||
==== Parameters ==== | ==== Parameters ==== |