64 uint32_t tstamp = 3503357677;
71 uint8_t bytes[20] = {0x01, 0x05, 0xFD, 0xFC, 0x03, 0x02, 0x06, 0xFE, 0xFD, 0x04,
72 0x03, 0x06, 0xFF, 0xFE, 0x05, 0x00, 0x04, 0xFC, 0xFB, 0x02};
76 float f[3] = {1.1, 2.2, 3.14159};
86 FILE *tmp = tmpfile();
87 int tmpfd = fileno(tmp);
116 while (!(feof(tmp) || exit == 1)) {
117 msg_t tMessage = {0};
123 fprintf(stdout,
"%s\n", str);
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_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_t * msg_new_timestamp(const uint8_t source, const uint8_t type, const uint32_t ts)
Create a timestamp message.
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_ERROR
An error code is returned in data.value.
bool mp_readMessage(int handle, msg_t *out)
Static wrapper around mp_readMessage_buf.
bool mp_writeMessage(int handle, const msg_t *out)
Send message to attached device.
#define SLCHAN_TSTAMP
Source timestamp (milliseconds, arbitrary epoch)
#define SLCHAN_MAP
Channel name map (excludes log channels)
#define SLCHAN_NAME
Name of source device.
#define SLSOURCE_TEST1
Test data source ID (1/3)
void sa_destroy(strarray *sa)
Destroy array and contents.
strarray * sa_new(int entries)
Allocate storage for a new array.
bool sa_create_entry(strarray *array, const int index, const size_t len, const char *src)
Create an string in a given position from a character array and length.
msg_data_t data
Embedded data.
msg_dtype_t dtype
Embedded data type.
float value
Generic numerical data.