SELKIELogger
1.0.0
|
Modules | |
Channel Status | |
Files | |
file | DWMessages.h |
file | DWTypes.h |
Classes | |
struct | dw_hva |
Internal representation of a Datawell HVA message. More... | |
struct | dw_bva |
Internal representation of a Datawell BVA message. More... | |
struct | dw_hxv |
Internal representation of a Datawell HXV message. More... | |
struct | dw_spectrum |
Internal representation of HXV spectral messages. More... | |
struct | dw_system |
Internal representation of HXV system messages. More... | |
Typedefs | |
typedef enum dw_types | dw_types |
DW Data format types. | |
typedef struct dw_hva | dw_hva |
Internal representation of a Datawell HVA message. More... | |
typedef struct dw_bva | dw_bva |
Internal representation of a Datawell BVA message. More... | |
typedef struct dw_hxv | dw_hxv |
Internal representation of a Datawell HXV message. More... | |
Enumerations | |
enum | dw_types { DW_TYPE_UNKNOWN = -1 , DW_TYPE_HVA = 0 , DW_TYPE_HXV , DW_TYPE_BVA } |
DW Data format types. More... | |
Functions | |
uint16_t | dw_hxv_cycdat (const dw_hxv *in) |
Extract cyclic data word from HXV input line. More... | |
int16_t | dw_hxv_vertical (const dw_hxv *in) |
Extract vertical displacement component from HXV input line. More... | |
int16_t | dw_hxv_north (const dw_hxv *in) |
Extract north displacement component from HXV input line. More... | |
int16_t | dw_hxv_west (const dw_hxv *in) |
Extract west displacement component from HXV input line. More... | |
uint16_t | dw_hxv_parity (const dw_hxv *in) |
Extract parity word from HXV input line. More... | |
bool | dw_spectrum_from_array (const uint16_t *arr, dw_spectrum *out) |
Populate dw_spectrum from array of cyclic data words. More... | |
bool | dw_spectral_block (const uint16_t *arr, const int ix, dw_spectrum *out) |
Populate a specific component of dw_spectrum from array of cyclic data words. More... | |
bool | dw_system_from_array (const uint16_t *arr, dw_system *out) |
Extract system data from array of cyclic data words. More... | |
bool | hexpair_to_uint (const char *in, uint8_t *out) |
Convert a string of hexadecimal characters to corresponding value. More... | |
bool | dw_string_hxv (const char *in, size_t *end, dw_hxv *out) |
Read a line of HXV data from string and convert. More... | |
Support for Datawell data formats and device communications.
Internal representation of a Datawell BVA message.
The data is identical to that stored in a dw_hva structure, but without any status or sequencing information.
Internal representation of a Datawell HVA message.
Transmitted as text, terminated by a carriage return (not stored). The sequence number and data arrays are transmitted as hexadecimal characters, with two characters representing each byte stored.
Internal representation of a Datawell HXV message.
Transmitted as text, terminated by a carriage return (not stored).
All data transmitted as hexadecimal characters, with two characters representing each byte stored.
enum dw_types |
uint16_t dw_hxv_cycdat | ( | const dw_hxv * | in | ) |
Extract cyclic data word from HXV input line.
[in] | in | HXV data line |
Definition at line 31 of file DWMessages.c.
int16_t dw_hxv_north | ( | const dw_hxv * | in | ) |
Extract north displacement component from HXV input line.
[in] | in | HXV data line |
Definition at line 52 of file DWMessages.c.
uint16_t dw_hxv_parity | ( | const dw_hxv * | in | ) |
Extract parity word from HXV input line.
[in] | in | HXV data line |
Definition at line 72 of file DWMessages.c.
int16_t dw_hxv_vertical | ( | const dw_hxv * | in | ) |
Extract vertical displacement component from HXV input line.
[in] | in | HXV data line |
Definition at line 39 of file DWMessages.c.
int16_t dw_hxv_west | ( | const dw_hxv * | in | ) |
Extract west displacement component from HXV input line.
[in] | in | HXV data line |
Definition at line 62 of file DWMessages.c.
bool dw_spectral_block | ( | const uint16_t * | arr, |
const int | ix, | ||
dw_spectrum * | out | ||
) |
Populate a specific component of dw_spectrum from array of cyclic data words.
Populate spectral parameters in a dw_spectrum structure for one of the four frequency components present in this block of cyclic data.
[in] | arr | Cyclic data words |
[in] | ix | Component index to complete [0..3] |
[out] | out | Pointer to dw_spectrum structure to populate |
Definition at line 109 of file DWMessages.c.
bool dw_spectrum_from_array | ( | const uint16_t * | arr, |
dw_spectrum * | out | ||
) |
Populate dw_spectrum from array of cyclic data words.
Populate a dw_spectrum structure using the data from an array of cyclic data words.
Calls dw_spectral_block() to fill data for each of the 4 frequency components contained within this set of data.
[in] | arr | Cyclic data words |
[out] | out | Pointer to dw_spectrum structure to populate |
Definition at line 87 of file DWMessages.c.
bool dw_string_hxv | ( | const char * | in, |
size_t * | end, | ||
dw_hxv * | out | ||
) |
Read a line of HXV data from string and convert.
Read up to end
characters from in
and populate the dw_hxv structure pointed to by out
.
Looks for a carriage return character to mark the end of a line, then attempts to read a HXV line from the data immediately preceding it.
The data
parameter initially indicates the number of characters available, and will be set to the number of characters read at exit.
[in] | in | Pointer to character array containing input data |
[in,out] | end | Data length/position marker |
[out] | out | Pointer to dw_hxv structure to fill |
bool dw_system_from_array | ( | const uint16_t * | arr, |
dw_system * | out | ||
) |
Extract system data from array of cyclic data words.
Populate a dw_system structure using the data from an array of system data words.
[in] | arr | System data words |
[out] | out | Pointer to dw_system structure to populate |
Definition at line 141 of file DWMessages.c.
bool hexpair_to_uint | ( | const char * | in, |
uint8_t * | out | ||
) |
Convert a string of hexadecimal characters to corresponding value.
Character array pointed to by in
must contain at least two characters (i.e. char[1] must be a valid read).
[in] | in | Input string containing two hexadecimal characters |
[out] | out | Pointer to output variable. Zeroed for error cases. |