MIP_SDK  v3.0.0
MicroStrain Communications Library for embedded systems
Classes | Typedefs | Functions
microstrain::C Namespace Reference

Classes

struct  microstrain_serializer
 Structure used for serialization. More...
 

Typedefs

typedef uint32_t microstrain_embedded_timestamp
 Type used for packet timestamps and timeouts. More...
 
typedef microstrain_embedded_timestamp microstrain_embedded_timeout
 
typedef struct microstrain::C::microstrain_serializer microstrain_serializer
 Structure used for serialization. More...
 

Functions

void microstrain_serializer_init_insertion (microstrain_serializer *serializer, uint8_t *buffer, size_t buffer_size)
 
void microstrain_serializer_init_extraction (microstrain_serializer *serializer, const uint8_t *buffer, size_t buffer_size)
 
size_t microstrain_serializer_capacity (const microstrain_serializer *serializer)
 
size_t microstrain_serializer_length (const microstrain_serializer *serializer)
 
int microstrain_serializer_remaining (const microstrain_serializer *serializer)
 
bool microstrain_serializer_is_ok (const microstrain_serializer *serializer)
 
bool microstrain_serializer_is_complete (const microstrain_serializer *serializer)
 
void microstrain_insert_bool (microstrain_serializer *serializer, bool value)
 
void microstrain_insert_char (microstrain_serializer *serializer, char value)
 
void microstrain_insert_u8 (microstrain_serializer *serializer, uint8_t value)
 
void microstrain_insert_u16 (microstrain_serializer *serializer, uint16_t value)
 
void microstrain_insert_u32 (microstrain_serializer *serializer, uint32_t value)
 
void microstrain_insert_u64 (microstrain_serializer *serializer, uint64_t value)
 
void microstrain_insert_s8 (microstrain_serializer *serializer, int8_t value)
 
void microstrain_insert_s16 (microstrain_serializer *serializer, int16_t value)
 
void microstrain_insert_s32 (microstrain_serializer *serializer, int32_t value)
 
void microstrain_insert_s64 (microstrain_serializer *serializer, int64_t value)
 
void microstrain_insert_float (microstrain_serializer *serializer, float value)
 
void microstrain_insert_double (microstrain_serializer *serializer, double value)
 
void microstrain_extract_bool (microstrain_serializer *serializer, bool *value)
 
void microstrain_extract_char (microstrain_serializer *serializer, char *value)
 
void microstrain_extract_u8 (microstrain_serializer *serializer, uint8_t *value)
 
void microstrain_extract_u16 (microstrain_serializer *serializer, uint16_t *value)
 
void microstrain_extract_u32 (microstrain_serializer *serializer, uint32_t *value)
 
void microstrain_extract_u64 (microstrain_serializer *serializer, uint64_t *value)
 
void microstrain_extract_s8 (microstrain_serializer *serializer, int8_t *value)
 
void microstrain_extract_s16 (microstrain_serializer *serializer, int16_t *value)
 
void microstrain_extract_s32 (microstrain_serializer *serializer, int32_t *value)
 
void microstrain_extract_s64 (microstrain_serializer *serializer, int64_t *value)
 
void microstrain_extract_float (microstrain_serializer *serializer, float *value)
 
void microstrain_extract_double (microstrain_serializer *serializer, double *value)
 
void microstrain_extract_count (microstrain_serializer *serializer, uint8_t *count_out, uint8_t max_count)
 

Typedef Documentation

◆ microstrain_embedded_timeout

◆ microstrain_embedded_timestamp

Type used for packet timestamps and timeouts.

Timestamps must be monotonic except for overflow at the maximum value back to 0. The units can be anything, but typically are milliseconds. Choose a long enough unit so that consecutive calls to the parser will not exceed half of the maximum value for this type. For milliseconds, the time to overflow is approximately 50 days, so the parser should be invoked at least every 25 days. Failure to observe this requirement may result in false timeouts or delays in getting parsed packets.