SELKIELogger  1.0.0
Datawell data format support
Collaboration diagram for Datawell data format support:

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...
 

Detailed Description

Support for Datawell data formats and device communications.

Typedef Documentation

◆ dw_bva

typedef struct dw_bva dw_bva

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.

◆ dw_hva

typedef struct dw_hva dw_hva

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.

◆ dw_hxv

typedef struct dw_hxv dw_hxv

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.

Enumeration Type Documentation

◆ dw_types

enum dw_types

DW Data format types.

Enumerator
DW_TYPE_UNKNOWN 

Default - type not known.

DW_TYPE_HVA 

HVA format data.

DW_TYPE_BVA 

HXV format data.

Definition at line 58 of file DWTypes.h.

Function Documentation

◆ dw_hxv_cycdat()

uint16_t dw_hxv_cycdat ( const dw_hxv in)

Extract cyclic data word from HXV input line.

Parameters
[in]inHXV data line
Returns
Cyclic data word

Definition at line 31 of file DWMessages.c.

◆ dw_hxv_north()

int16_t dw_hxv_north ( const dw_hxv in)

Extract north displacement component from HXV input line.

Parameters
[in]inHXV data line
Returns
Northerly displacement component in cm

Definition at line 52 of file DWMessages.c.

◆ dw_hxv_parity()

uint16_t dw_hxv_parity ( const dw_hxv in)

Extract parity word from HXV input line.

Parameters
[in]inHXV data line
Returns
HXV Line parity component

Definition at line 72 of file DWMessages.c.

◆ dw_hxv_vertical()

int16_t dw_hxv_vertical ( const dw_hxv in)

Extract vertical displacement component from HXV input line.

Parameters
[in]inHXV data line
Returns
Vertical displacement component in cm

Definition at line 39 of file DWMessages.c.

◆ dw_hxv_west()

int16_t dw_hxv_west ( const dw_hxv in)

Extract west displacement component from HXV input line.

Parameters
[in]inHXV data line
Returns
Westerly displacement component in cm

Definition at line 62 of file DWMessages.c.

◆ dw_spectral_block()

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.

Parameters
[in]arrCyclic data words
[in]ixComponent index to complete [0..3]
[out]outPointer to dw_spectrum structure to populate
Returns
True on success, False on error

Definition at line 109 of file DWMessages.c.

◆ dw_spectrum_from_array()

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.

Parameters
[in]arrCyclic data words
[out]outPointer to dw_spectrum structure to populate
Returns
True on success, False on error

Definition at line 87 of file DWMessages.c.

◆ dw_string_hxv()

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.

Parameters
[in]inPointer to character array containing input data
[in,out]endData length/position marker
[out]outPointer to dw_hxv structure to fill
Returns
True on success, false on error.

Definition at line 92 of file DWTypes.c.

◆ dw_system_from_array()

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.

Parameters
[in]arrSystem data words
[out]outPointer to dw_system structure to populate
Returns
True on success, False on error

Definition at line 141 of file DWMessages.c.

◆ hexpair_to_uint()

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).

Parameters
[in]inInput string containing two hexadecimal characters
[out]outPointer to output variable. Zeroed for error cases.
Returns
True on success, false on error.

Definition at line 34 of file DWTypes.c.