libdata-unified-status
1.1.1
|
Enumerations | |
enum | unified_status_tag_t { unified_status_tag_clock , unified_status_tag_gps , unified_status_tag_channel , unified_status_tag_mass_pos , unified_status_tag_temp , unified_status_tag_inclination } |
Possible tag types. More... | |
Functions | |
int | unified_status_read_tag (const char *st, enum unified_status_tag_t *tag_type, int *data_words) |
Read tag type and length. More... | |
Allows the analysis of a tag. Will retrieve the tag type (allowing the tag to be fully decoded if it is of a known type) and length. Since the length is an explicit part of the tag type, unknown tags can simply be skipped when parsing a complete block.
enum unified_status_tag_t |
Possible tag types.
Enumerator | |
---|---|
unified_status_tag_clock | Clock status (see Clock status). |
unified_status_tag_gps | GPS status (see GPS receiver status). |
unified_status_tag_channel | Channel status (see Channel status). |
unified_status_tag_mass_pos | Mass position (see Mass position). |
unified_status_tag_temp | Temperature (see Temperature). |
unified_status_tag_inclination | Inclination (see Inclination). |
int unified_status_read_tag | ( | const char * | st, |
enum unified_status_tag_t * | tag_type, | ||
int * | data_words | ||
) |
Read tag type and length.
st | Pointer to position in status packet to read. | |
[out] | tag_type | The overall type of tag, excluding any specific data (e.g. which channel it applies to). May be 0. |
[out] | data_words | The number of data words. May be 0. |
0 | on success. |
-1 | on error (unrecognised tag). |
Reads a 32-bit unified status tag; if the tag type is known, it will write the type into tag_type. This can be used to intepret the data. If the tag type is unknown, -1 will be returned, but data_words will still be set correctly. This allows a reader to skip unknown tags. The data_words count excludes the tag word itself.