21 #ifndef SELKIELoggerBase_Messages
22 #define SELKIELoggerBase_Messages
86 msg_t *
msg_new_string(
const uint8_t source,
const uint8_t type,
const size_t len,
const char *str);
92 msg_t *
msg_new_bytes(
const uint8_t source,
const uint8_t type,
const size_t len,
const uint8_t *bytes);
msg_t * msg_new_string(const uint8_t source, const uint8_t type, const size_t len, const char *str)
Create a new message with a single string embedded.
char * msg_data_to_string(const msg_t *msg)
Generate string representation of message data.
char * msg_to_string(const msg_t *msg)
Generate string representation of message.
void msg_destroy(msg_t *msg)
Destroy a message.
msg_t * msg_new_string_array(const uint8_t source, const uint8_t type, const strarray *array)
Create a new message containing an array of strings.
msg_t * msg_new_bytes(const uint8_t source, const uint8_t type, const size_t len, const uint8_t *bytes)
Create a new message containing raw binary data.
msg_dtype_t
Each data type should map to an entry in the msg_data_t union.
char * msg_data_sarr_to_string(const msg_t *msg)
Represent string array as single string.
msg_t * msg_new_timestamp(const uint8_t source, const uint8_t type, const uint32_t ts)
Create a timestamp message.
char * msg_data_narr_to_string(const msg_t *msg)
Convert numerical array to string.
msg_t * msg_new_float_array(const uint8_t source, const uint8_t type, const size_t entries, const float *array)
Create a new message containing an array of floating point data.
msg_t * msg_new_float(const uint8_t source, const uint8_t type, const float val)
Create new message with a single numeric value.
@ MSG_NUMARRAY
Array of floating point values.
@ MSG_ERROR
An error code is returned in data.value.
@ MSG_FLOAT
Generic numerical data.
@ MSG_BYTES
Raw binary data.
@ MSG_STRING
Single string.
@ MSG_UNDEF
Undefined/Uninitialised message.
@ MSG_STRARRAY
Array of strings.
@ MSG_TIMESTAMP
Timestamp (milliseconds since defined epoch/event)
size_t length
Data type dependent, see the msg_new functions.
msg_data_t data
Embedded data.
uint8_t type
Message type. Common types to be documented.
uint8_t source
Maps to a specific sensor unit or data source.
msg_dtype_t dtype
Embedded data type.
float * farray
Array of floats.
string string
Single character array with length.
uint32_t timestamp
Intended to represent millisecond level clock.
float value
Generic numerical data.
strarray names
Array of strings, intended for use to provide channel names.
uint8_t * bytes
Our "raw" binary type.