libdata-unified-status  1.1.1
Data Structures | Functions
Mass position

Data Structures

struct  unified_status_mass_pos_t
 Mass position details. More...
 

Functions

int unified_status_read_mass_pos (const char *st, struct unified_status_mass_pos_t *out)
 Interpret mass position tag. More...
 
void unified_status_write_mass_pos (struct membuf_t *buf, const struct unified_status_mass_pos_t *in)
 Compose a mass position tag. More...
 
int soh_store_get_mass_pos (const struct soh_store_t *store, struct iso8601_date *timestamp, struct unified_status_mass_pos_t *mass_pos)
 Retrieve mass position from persistent store object. More...
 

Detailed Description

Per-channel mass position reading. The mass position is expressed as a ratio of full scale deflection. Since the value is the result of analog to digital conversion, it is possible that the the result could be slightly outside of the interval [-1.0,1.0].

Function Documentation

int unified_status_read_mass_pos ( const char *  st,
struct unified_status_mass_pos_t out 
)

Interpret mass position tag.

Parameters
stPointer to status data (must coincide with start of tag).
[out]outMass position written here.
Return values
0on success.
-1on error.

Interprets mass position tag at st, storing the result in out.

void unified_status_write_mass_pos ( struct membuf_t *  buf,
const struct unified_status_mass_pos_t in 
)

Compose a mass position tag.

Parameters
bufBuffer to write result into.
inMass position.

Encodes the mass position in in, appending the result onto buf.

int soh_store_get_mass_pos ( const struct soh_store_t *  store,
struct iso8601_date *  timestamp,
struct unified_status_mass_pos_t mass_pos 
)

Retrieve mass position from persistent store object.

Parameters
storePersistent storage object.
[out]timestampTimestamp of last update. May be 0.
[out]mass_posMass position structure. May be 0.
Return values
0on success.
-1on error (no status information seen).