SELKIELogger
1.0.0
|
Classes | |
struct | csv_msg_handler |
Typedefs | |
typedef char *(* | csv_header_fn) (const uint8_t, const uint8_t, const char *, const char *) |
typedef char *(* | csv_data_fn) (const msg_t *) |
Functions | |
int | sort_uint (const void *a, const void *b) |
qsort() comparison function More... | |
char * | csv_all_timestamp_headers (const uint8_t source, const uint8_t type, const char *sourceName, const char *channelName) |
Generate CSV header for timestamp messages (SLCHAN_TSTAMP) More... | |
char * | csv_all_timestamp_data (const msg_t *msg) |
Convert timestamp (SLCHAN_TSTAMP) to string. More... | |
char * | csv_gps_position_headers (const uint8_t source, const uint8_t type, const char *sourceName, const char *channelName) |
Generate CSV header for GPS position fields. More... | |
char * | csv_gps_position_data (const msg_t *msg) |
Convert GPS position information to CSV string. More... | |
char * | csv_gps_velocity_headers (const uint8_t source, const uint8_t type, const char *sourceName, const char *channelName) |
Generate CSV header for GPS velocity information. More... | |
char * | csv_gps_velocity_data (const msg_t *msg) |
Convert GPS velocity information to CSV string. More... | |
char * | csv_gps_datetime_headers (const uint8_t source, const uint8_t type, const char *sourceName, const char *channelName) |
Generate CSV header for GPS date and time information. More... | |
char * | csv_gps_datetime_data (const msg_t *msg) |
Convert GPS date and time information to appropriate CSV string. More... | |
char * | csv_all_float_headers (const uint8_t source, const uint8_t type, const char *sourceName, const char *channelName) |
Generate CSV header for any single value floating point channel. More... | |
char * | csv_all_float_data (const msg_t *msg) |
Convert single value floating point data channel to CSV string. More... | |
typedef char*(* csv_data_fn) (const msg_t *) |
CSV field generating functions
These functions are passed a pointer to a msg_t structure that matches the source and type registered. Commas are only to be included to separate fields internal to this string, not as first or last character.
If no message of this type was received, the input pointer will be NULL. In this case, the function must generate an appropriate number of empty fields to ensure the output fields remain aligned - or an empty string if the function normally only outputs a single value.
Strings will be freed by caller
typedef char*(* csv_header_fn) (const uint8_t, const uint8_t, const char *, const char *) |
CSV Header generating functions
Each function with this type is provided with the message source and type ID, along with the corresponding names (in that order). The function must then allocate an return a string to be incorporated into the CSV header line.
Commas are only to be included to separate fields internal to this string, not as first or last character.
Strings will be freed by caller
char * csv_all_float_data | ( | const msg_t * | msg | ) |
char * csv_all_float_headers | ( | const uint8_t | source, |
const uint8_t | type, | ||
const char * | sourceName, | ||
const char * | channelName | ||
) |
Generate CSV header for any single value floating point channel.
Generic handler for channels representing single floating point values.
Returned string must be freed by caller
[in] | source | Source number |
[in] | type | Channel number (ignored) |
[in] | sourceName | Name of this source (ignored) |
[in] | channelName | Name of this channel |
char * csv_all_timestamp_data | ( | const msg_t * | msg | ) |
char * csv_all_timestamp_headers | ( | const uint8_t | source, |
const uint8_t | type, | ||
const char * | sourceName, | ||
const char * | channelName | ||
) |
Generate CSV header for timestamp messages (SLCHAN_TSTAMP)
Returned string must be freed by caller
[in] | source | Source number |
[in] | type | Channel number (ignored) |
[in] | sourceName | Name of this source (ignored) |
[in] | channelName | Name of this channel (ignored) |
char * csv_gps_datetime_data | ( | const msg_t * | msg | ) |
Convert GPS date and time information to appropriate CSV string.
Returns field containing comma separated values corresponding to the headers in csv_gps_datetime_headers().
Returned string must be freed by caller
[in] | msg | Message containing GPS data |
char * csv_gps_datetime_headers | ( | const uint8_t | source, |
const uint8_t | type, | ||
const char * | sourceName, | ||
const char * | channelName | ||
) |
Generate CSV header for GPS date and time information.
Returned string must be freed by caller
[in] | source | Source number |
[in] | type | Channel number (ignored) |
[in] | sourceName | Name of this source (ignored) |
[in] | channelName | Name of this channel (ignored) |
char * csv_gps_position_data | ( | const msg_t * | msg | ) |
Convert GPS position information to CSV string.
Returns field containing comma separated values corresponding to the headers in csv_gps_position_headers().
Returned string must be freed by caller
[in] | msg | Message containing GPS data |
char * csv_gps_position_headers | ( | const uint8_t | source, |
const uint8_t | type, | ||
const char * | sourceName, | ||
const char * | channelName | ||
) |
Generate CSV header for GPS position fields.
Returned string must be freed by caller
[in] | source | Source number |
[in] | type | Channel number (ignored) |
[in] | sourceName | Name of this source (ignored) |
[in] | channelName | Name of this channel (ignored) |
char * csv_gps_velocity_data | ( | const msg_t * | msg | ) |
Convert GPS velocity information to CSV string.
Returns field containing comma separated values corresponding to the headers in csv_gps_velocity_headers().
Returned string must be freed by caller
[in] | msg | Message containing GPS data |
char * csv_gps_velocity_headers | ( | const uint8_t | source, |
const uint8_t | type, | ||
const char * | sourceName, | ||
const char * | channelName | ||
) |
Generate CSV header for GPS velocity information.
Returned string must be freed by caller
[in] | source | Source number |
[in] | type | Channel number (ignored) |
[in] | sourceName | Name of this source (ignored) |
[in] | channelName | Name of this channel (ignored) |