User Tools

Site Tools


projects:crazyflie:firmware:comm_protocol

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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**  ^  **Description**  ^ ^  **Log Type**  ^  **Description**  ^
Line 227: Line 228:
 |              | float16       | |              | float16       |
  
-^  **Storage Type**  ^  **Description**  +^  **Storage Type**  ^  **Description**                         
-|                  | Variable in TOC       |+|                  | Variable in TOC                          |
 |                  | Memory address pointing to uint8_t       | |                  | Memory address pointing to uint8_t       |
 |                  | Memory address pointing to uint16_t      | |                  | Memory address pointing to uint16_t      |
Line 237: Line 238:
 |                  | Memory address pointing to float32       | |                  | Memory address pointing to float32       |
  
 +TOC variable request (Storage type is ignored):
 <code> <code>
   7               0   7               0
 +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
-|    Log type   | Storage type  |+| Storage type  |    Log type   |
 +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
 |        Variable ID            | |        Variable ID            |
Line 246: Line 248:
 </code> </code>
  
 +Arbitrary memory address request:
 <code> <code>
   7               0   7               0
 +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
-|    Log type   Storage 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**  ^  **Description**  ^ ^  **Error**  ^  **Description**  ^
-    0x00    | No error          + 0  | No error  
-    0x01    | Block not found   + ENOENT (2)  | Block or variable not found  
-    0x02    Block already created, needs delete + E2BIG (7)  Log block is too long  
-    0xFF    Generic error |+ ENOEXEC (8)  unknown command received 
 +|  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 to the settings:
 <code> <code>
    Computer                 Crazyflie    Computer                 Crazyflie
    --------                 ---------    --------                 ---------
-Add log packet     ---> +Add log block      ---> 
-                   <---     Log packet added ok+                   <---     Log block added ok
 [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                   
 </code> </code>
  
-Deleting an existing log block from the settings:+Deleting an existing log block 0x55 from the settings:
 <code> <code>
    Computer                 Crazyflie    Computer                 Crazyflie
Line 300: Line 306:
  
 <code> <code>
-Adding a log block logging variable ID 0x55 at 100ms interval and of type uint16: +Adding a log block 0xbb at 100ms interval logging variable ID 0x55 of type uint16: 
-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 logging variable (value 0xBABE): 
-CF -> Computer : 0x[5,2] 0x55 0xBA 0xBE+CF -> Computer : 0x[5,2] 0xBB 0xA3 0xA2 0xA1 0xBA 0xBE
 </code> </code>
 ==== Parameters ==== ==== Parameters ====
projects/crazyflie/firmware/comm_protocol.txt · Last modified: 2021-06-24 16:49 by kimberly