An open, cross platform, cross endian-ness data format for efficient writing and transfer of IoT observation data, with minimal dependencies and no need for dynamic memory usage.
Note: Observations must have timestamps sorted chronologically (ascending).
- uint8 - unsigned char
- uint16 - unsigned short16
- unint32 - unsigned int32
- int32 - signed int32
- uint64 - unsigned int64
- int64 - signed int64
version uint8 // Always 1 for this version.
header_flags uint8 // Encoded according to "Header Flags" table below.
sections_count uint16 // Number of sections included in dataset.
sections COS Section // Observation data sections multiplied by "section_count".
0x1 <Reserved>
0x2 <Reserved>
0x4 <Reserved>
0x8 <Reserved>
0x10 <Reserved>
0x20 Use multiple observation descriptors in section.
0x40 Use multiple timestamps in section.
0x80 Use int64 timestamps ("ticks"), if not set, assume uint32 timestamps ("unix time").
observation_descr Observation Descriptor // Present only if flag 0x20 is not set.
timestamp_abs uint32 | int64 // Data type depends on header flag 0x80.
observations_count uint16 // Number of observations in section.
observations COS Observation // Repeated observations_count times.
observation_descr Observation Descriptor // Present only if header flag 0x20 is set.
timestamp_rel uint16 | int64 // Present only if header flag 0x40 is set, data type depends on header flag 0x80.
value ObservationType // Data type depends on "observation_descr" element "observations_type".
Serialized as a 16 bit unsigned short.
Bits 15-12: observation_type // Numeric value according to "Observation Types" table below.
Bits 11-0: observation_id // Observation identifier (max id: 4095).
- boolean
- double
- float
- int32
- int16
- uint16
- int8
- uint8
- position2d
- position3d
- ascii
- utf8
Provided as unsigned char, 0 = false, 1 = true.
Provided as native double type.
Provided as native float type.
Provided as native signed int.
Provided as native signed short.
Provided as native unsigned short.
Provided as native signed char.
Provided as native unsigned char.
Structure consisting of the following elements:
- Latitude provided as native float (decimal degrees in WGS84 datum).
- Longitude provided as native float (decimal degrees in WGS84 datum).
Structure consisting of the following elements:
- Latitude provided as native float (decimal degrees in WGS84 datum).
- Longitude provided as native float (decimal degrees in WGS84 datum).
- Altitude provided as native float (meters in WGS84 datum).
Structure consisting of the following elements:
- Length of string provided as unsigned short.
- Char array provided as char[].
Structure consisting of the following elements:
- Length of string provided as unsigned short.
- Char array provided as unsigned char[] with UTF8 encoding.
Example provided in example.c.
Example provided in example.c.
Example provided in example.c.