Zephyr Scientific Library (zscilib)
|
#include <measurement.h>
Data Fields | |
union { | |
struct { | |
uint8_t base_type | |
uint8_t ext_type | |
union { | |
struct { | |
uint16_t data_format: 3 | |
uint16_t encoding: 4 | |
uint16_t compression: 3 | |
uint16_t timestamp: 3 | |
uint16_t _rsvd: 3 | |
} flags | |
uint16_t flags_bits | |
} | |
} filter | |
uint32_t filter_bits | |
}; | |
union { | |
struct { | |
uint16_t si_unit | |
The SI unit and default scale used for this measurement. Must be a member of zsl_mes_unit_si. More... | |
uint8_t ctype | |
The data type that this SI unit is represented by in C. Must be a member of zsl_mes_unit_ctype. More... | |
int8_t scale_factor | |
The amount to scale the measurement value up or down (10^n), starting from the unit and scale indicated by si_unit. Typically, but not necessarily a member of zsl_mes_unit_scale. More... | |
} unit | |
uint32_t unit_bits | |
}; | |
union { | |
struct { | |
uint16_t len | |
struct { | |
uint8_t fragment: 2 | |
uint8_t _rsvd: 2 | |
uint8_t samples: 4 | |
} | |
uint8_t sourceid | |
} srclen | |
uint32_t srclen_bits | |
}; | |
Measurement header. All fields in little endian.
Definition at line 63 of file measurement.h.
union { ... } |
Filter (header upper word).
union { ... } |
Unit (header middle word).
union { ... } |
Src/Len (header lower word).
uint16_t zsl_mes_header::_rsvd |
Reserved for future use. Must be set to 0.
Definition at line 83 of file measurement.h.
uint8_t zsl_mes_header::_rsvd |
Reserved for future use. Must be set to 0.
Definition at line 132 of file measurement.h.
uint8_t zsl_mes_header::base_type |
Base measurement type.
Definition at line 68 of file measurement.h.
uint16_t zsl_mes_header::compression |
Compression algorithm used (1 = LZ4).
Definition at line 79 of file measurement.h.
uint8_t zsl_mes_header::ctype |
The data type that this SI unit is represented by in C. Must be a member of zsl_mes_unit_ctype.
This field can be used to determine how many bytes are required to represent this measurement value, and how to interpret the value in memory.
Definition at line 110 of file measurement.h.
uint16_t zsl_mes_header::data_format |
Data format used (1 = CBOR).
Definition at line 75 of file measurement.h.
uint16_t zsl_mes_header::encoding |
Payload encoding used (1 = BASE64).
Definition at line 77 of file measurement.h.
uint8_t zsl_mes_header::ext_type |
Extended measurement type (meaning depends on base type).
Definition at line 70 of file measurement.h.
struct { ... } zsl_mes_header::filter |
uint32_t zsl_mes_header::filter_bits |
32-bit representation of all Filter bits.
Definition at line 90 of file measurement.h.
struct { ... } zsl_mes_header::flags |
uint16_t zsl_mes_header::flags_bits |
Flag bits (cbor, timestamp, etc.).
Definition at line 86 of file measurement.h.
uint8_t zsl_mes_header::fragment |
Indicates this is a fragment of a larger packet.
Definition at line 130 of file measurement.h.
uint16_t zsl_mes_header::len |
Payload length, excluding the header, including timestamp.
Definition at line 127 of file measurement.h.
uint8_t zsl_mes_header::samples |
Sample count (2^n), 0 = 1 sample
Definition at line 134 of file measurement.h.
int8_t zsl_mes_header::scale_factor |
The amount to scale the measurement value up or down (10^n), starting from the unit and scale indicated by si_unit. Typically, but not necessarily a member of zsl_mes_unit_scale.
Definition at line 117 of file measurement.h.
uint16_t zsl_mes_header::si_unit |
The SI unit and default scale used for this measurement. Must be a member of zsl_mes_unit_si.
Definition at line 100 of file measurement.h.
uint8_t zsl_mes_header::sourceid |
Data source registery ID associated with this sample.
Definition at line 137 of file measurement.h.
struct { ... } zsl_mes_header::srclen |
uint32_t zsl_mes_header::srclen_bits |
32-bit representation of all Src/Len bits.
Definition at line 140 of file measurement.h.
uint16_t zsl_mes_header::timestamp |
Timestamp format (1 = epoch32, 2 = epoch64).
Definition at line 81 of file measurement.h.
struct { ... } zsl_mes_header::unit |
uint32_t zsl_mes_header::unit_bits |
32-bit representation of si_unit, ctype and scale_factor.
Definition at line 120 of file measurement.h.