|
|
@@ -2,10 +2,12 @@
|
|
|
# Simple wrapper for DataFrame
|
|
|
|
|
|
Create formatted frame from basic types:
|
|
|
- - uint8_t, int8_t
|
|
|
- - uint16_t, int16_t
|
|
|
- - uint32_t, int32_t
|
|
|
- - float
|
|
|
+ - uint8_t, int8_t => 1Byte
|
|
|
+ - uint16_t, int16_t => 2Bytes
|
|
|
+ - uint32_t, int32_t => 4Bytes
|
|
|
+ - float => 4Bytes
|
|
|
+
|
|
|
+ Data are stared in Little Endian format.
|
|
|
|
|
|
Structure of data frame:
|
|
|
- starting byte (0xCC)
|
|
|
@@ -25,10 +27,13 @@ Structure of data frame:
|
|
|
packet_create(data, 128);
|
|
|
|
|
|
packet_add_uint8(0xAB);
|
|
|
- packet_add_uint16(0xABCD);
|
|
|
+ packet_add_uint16(65874);
|
|
|
+ packet_add_int16(-45874);
|
|
|
packet_add_uint32(0x12345678);
|
|
|
+ packet_add_int32(-0xA2345678);
|
|
|
|
|
|
packet_add_float(0.265);
|
|
|
+ packet_add_float(-3.1415);
|
|
|
|
|
|
int data_length = packet_commit();
|
|
|
}
|