libRBR
v1.2.3
RBR instrument communication API
|
Instrument commands and structures pertaining to real-time data acquisition. More...
Go to the source code of this file.
Data Structures | |
struct | RBRInstrumentChannelsList |
Response to the outputformat channelslist command. More... | |
struct | RBRInstrumentLabelsList |
Response to the outputformat labelslist command. More... | |
struct | RBRInstrumentAuxOutput |
Instrument streamserial command parameters relating to the auxiliary output signal functionality. More... | |
struct | RBRInstrumentSample |
An instrument sample. More... | |
Macros | |
#define | RBRINSTRUMENT_OUTPUT_FORMAT_NAME_MAX 15 |
The maximum number of characters in an output format name (e.g., “caltext01”). | |
Typedefs | |
typedef struct RBRInstrumentChannelsList | RBRInstrumentChannelsList |
Response to the outputformat channelslist command. More... | |
typedef struct RBRInstrumentLabelsList | RBRInstrumentLabelsList |
Response to the outputformat labelslist command. More... | |
typedef enum RBRInstrumentOutputFormat | RBRInstrumentOutputFormat |
Instrument output formats. More... | |
typedef enum RBRInstrumentAuxOutputActiveLevel | RBRInstrumentAuxOutputActiveLevel |
Possible levels of the auxiliary output signal during the setup time, data transmission, and hold time. More... | |
typedef enum RBRInstrumentAuxOutputSleepLevel | RBRInstrumentAuxOutputSleepLevel |
Possible levels of the auxiliary output signal while the instrument is asleep. More... | |
typedef struct RBRInstrumentAuxOutput | RBRInstrumentAuxOutput |
Instrument streamserial command parameters relating to the auxiliary output signal functionality. More... | |
typedef enum RBRInstrumentReadingFlag | RBRInstrumentReadingFlag |
A flag set on a sample reading. | |
typedef struct RBRInstrumentSample | RBRInstrumentSample |
An instrument sample. | |
Functions | |
RBRInstrumentError | RBRInstrument_getChannelsList (RBRInstrument *instrument, RBRInstrumentChannelsList *channelsList) |
Report a list of names and units for active channels, in order. More... | |
RBRInstrumentError | RBRInstrument_getLabelsList (RBRInstrument *instrument, RBRInstrumentLabelsList *labelsList) |
Report a list of labels for active channels, in order. More... | |
const char * | RBRInstrumentOutputFormat_name (RBRInstrumentOutputFormat format) |
Get a human-readable string name for an output format. More... | |
RBRInstrumentError | RBRInstrument_getAvailableOutputFormats (RBRInstrument *instrument, RBRInstrumentOutputFormat *outputFormats) |
Report a list of available output formats. More... | |
RBRInstrumentError | RBRInstrument_getOutputFormat (RBRInstrument *instrument, RBRInstrumentOutputFormat *outputFormat) |
Get the current output format. More... | |
RBRInstrumentError | RBRInstrument_setOutputFormat (RBRInstrument *instrument, RBRInstrumentOutputFormat outputFormat) |
Set the current output format. More... | |
RBRInstrumentError | RBRInstrument_getUSBStreamingState (RBRInstrument *instrument, bool *enabled) |
Get the USB streaming state. More... | |
RBRInstrumentError | RBRInstrument_setUSBStreamingState (RBRInstrument *instrument, bool enabled) |
Set the USB streaming state. More... | |
RBRInstrumentError | RBRInstrument_getSerialStreamingState (RBRInstrument *instrument, bool *enabled) |
Get the serial streaming state. More... | |
RBRInstrumentError | RBRInstrument_setSerialStreamingState (RBRInstrument *instrument, bool enabled) |
Set the serial streaming state. More... | |
const char * | RBRInstrumentAuxOutputActiveLevel_name (RBRInstrumentAuxOutputActiveLevel level) |
Get a human-readable string name for a signal level of an active auxiliary output. More... | |
const char * | RBRInstrumentAuxOutputSleepLevel_name (RBRInstrumentAuxOutputSleepLevel level) |
Get a human-readable string name for a signal level of a sleeping auxiliary output. More... | |
RBRInstrumentError | RBRInstrument_getAuxOutput (RBRInstrument *instrument, RBRInstrumentAuxOutput *auxOutput) |
Get the instrument auxiliary output signal parameters. More... | |
RBRInstrumentError | RBRInstrument_setAuxOutput (RBRInstrument *instrument, const RBRInstrumentAuxOutput *auxOutput) |
Set the instrument auxiliary output signal parameters. More... | |
const char * | RBRInstrumentReadingFlag_name (RBRInstrumentReadingFlag flag) |
Get a human-readable string name for a reading flag. More... | |
RBRInstrumentReadingFlag | RBRInstrumentReading_getFlag (double reading) |
Get the error flag from a reading. More... | |
uint8_t | RBRInstrumentReading_getError (double reading) |
Get the error value from a reading. More... | |
double | RBRInstrumentReading_setError (RBRInstrumentReadingFlag flag, uint8_t value) |
Synthesize a reading with an error set. More... | |
RBRInstrumentError | RBRInstrument_readSample (RBRInstrument *instrument) |
Retrieve and parse data streamed from the instrument. More... | |
Instrument commands and structures pertaining to real-time data acquisition.
typedef struct RBRInstrumentAuxOutput RBRInstrumentAuxOutput |
Instrument streamserial
command parameters relating to the auxiliary output signal functionality.
Possible levels of the auxiliary output signal during the setup time, data transmission, and hold time.
Possible levels of the auxiliary output signal while the instrument is asleep.
typedef struct RBRInstrumentChannelsList RBRInstrumentChannelsList |
Response to the outputformat channelslist
command.
typedef struct RBRInstrumentLabelsList RBRInstrumentLabelsList |
Response to the outputformat labelslist
command.
typedef enum RBRInstrumentOutputFormat RBRInstrumentOutputFormat |
Possible levels of the auxiliary output signal during the setup time, data transmission, and hold time.
Enumerator | |
---|---|
RBRINSTRUMENT_ACTIVE_COUNT | The number of active output levels. |
RBRINSTRUMENT_UNKNOWN_ACTIVE | An unknown or unrecognized active output level. |
Possible levels of the auxiliary output signal while the instrument is asleep.
Enumerator | |
---|---|
RBRINSTRUMENT_SLEEP_COUNT | The number of sleep output levels. |
RBRINSTRUMENT_UNKNOWN_SLEEP | An unknown or unrecognized sleep output level. |
Instrument output formats.
A flag set on a sample reading.
RBRInstrumentError RBRInstrument_getAuxOutput | ( | RBRInstrument * | instrument, |
RBRInstrumentAuxOutput * | auxOutput | ||
) |
Get the instrument auxiliary output signal parameters.
RBRInstrumentAuxOutput.aux must be set to the index of the auxiliary output for which signal parameters are to be retrieved. Currently, it can only ever be set to 1
(AUX1). For example:
[in] | instrument | the instrument connection |
[in,out] | auxOutput | the auxiliary output signal parameters |
1
RBRInstrumentError RBRInstrument_getAvailableOutputFormats | ( | RBRInstrument * | instrument, |
RBRInstrumentOutputFormat * | outputFormats | ||
) |
Report a list of available output formats.
outputFormats will be treated as a bit field representation of available output formats as defined by RBRInstrumentOutputFormat. For details, consult Working with Bit Fields.
[in] | instrument | the instrument connection |
[out] | outputFormats | available output formats |
RBRInstrumentError RBRInstrument_getChannelsList | ( | RBRInstrument * | instrument, |
RBRInstrumentChannelsList * | channelsList | ||
) |
Report a list of names and units for active channels, in order.
Helpful for identifying the channel corresponding to each value in the transmitted data.
RBRInstrumentChannelsList.channels will be populated in the order reported by the instrument. Unpopulated entries will have zero-length name and unit members.
This parameter is unavailable for Logger2 instruments. Use RBRInstrument_getChannels() and RBRInstrument_getChannel().
[in] | instrument | the instrument connection |
[out] | channelsList | the channels list |
RBRInstrumentError RBRInstrument_getLabelsList | ( | RBRInstrument * | instrument, |
RBRInstrumentLabelsList * | labelsList | ||
) |
Report a list of labels for active channels, in order.
Helpful for identifying the channel corresponding to each value in the transmitted data.
RBRInstrumentLabelsList.channels will be populated in the order reported by the instrument. Unpopulated entries will be zero-length.
This parameter is unavailable for Logger2 instruments. Use RBRInstrument_getChannels() and RBRInstrument_getChannel().
[in] | instrument | the instrument connection |
[out] | labelsList | the channel labels list |
RBRInstrumentError RBRInstrument_getOutputFormat | ( | RBRInstrument * | instrument, |
RBRInstrumentOutputFormat * | outputFormat | ||
) |
Get the current output format.
[in] | instrument | the instrument connection |
[out] | outputFormat | the current output format |
RBRInstrumentError RBRInstrument_getSerialStreamingState | ( | RBRInstrument * | instrument, |
bool * | enabled | ||
) |
Get the serial streaming state.
[in] | instrument | the instrument connection |
[out] | enabled | whether serial streaming is enabled |
RBRInstrumentError RBRInstrument_getUSBStreamingState | ( | RBRInstrument * | instrument, |
bool * | enabled | ||
) |
Get the USB streaming state.
[in] | instrument | the instrument connection |
[out] | enabled | whether USB streaming is enabled |
RBRInstrumentError RBRInstrument_readSample | ( | RBRInstrument * | instrument | ) |
Retrieve and parse data streamed from the instrument.
This function waits for a streamed sample to arrive, parses it, then calls the RBRInstrumentSampleCallback provided to the instrument via RBRInstrumentCallbacks.sample.
[in] | instrument | the instrument connection |
RBRInstrumentError RBRInstrument_setAuxOutput | ( | RBRInstrument * | instrument, |
const RBRInstrumentAuxOutput * | auxOutput | ||
) |
Set the instrument auxiliary output signal parameters.
Hardware errors may occur if:
[in] | instrument | the instrument connection |
[out] | auxOutput | the auxiliary output signal parameters |
RBRInstrumentError RBRInstrument_setOutputFormat | ( | RBRInstrument * | instrument, |
RBRInstrumentOutputFormat | outputFormat | ||
) |
Set the current output format.
[in] | instrument | the instrument connection |
[in] | outputFormat | the current output format |
RBRInstrumentError RBRInstrument_setSerialStreamingState | ( | RBRInstrument * | instrument, |
bool | enabled | ||
) |
Set the serial streaming state.
[in] | instrument | the instrument connection |
[in] | enabled | whether serial streaming is enabled |
RBRInstrumentError RBRInstrument_setUSBStreamingState | ( | RBRInstrument * | instrument, |
bool | enabled | ||
) |
Set the USB streaming state.
[in] | instrument | the instrument connection |
[in] | enabled | whether USB streaming is enabled |
const char* RBRInstrumentAuxOutputActiveLevel_name | ( | RBRInstrumentAuxOutputActiveLevel | level | ) |
Get a human-readable string name for a signal level of an active auxiliary output.
[in] | level | the signal level |
const char* RBRInstrumentAuxOutputSleepLevel_name | ( | RBRInstrumentAuxOutputSleepLevel | level | ) |
Get a human-readable string name for a signal level of a sleeping auxiliary output.
[in] | level | the signal level |
const char* RBRInstrumentOutputFormat_name | ( | RBRInstrumentOutputFormat | format | ) |
Get a human-readable string name for an output format.
[in] | format | the output format |
uint8_t RBRInstrumentReading_getError | ( | double | reading | ) |
Get the error value from a reading.
If the reading is not a NaN, returns the error value encoded within the NaN. Otherwise, returns 0.
reading | the reading |
RBRInstrumentReadingFlag RBRInstrumentReading_getFlag | ( | double | reading | ) |
Get the error flag from a reading.
If the reading is not a NaN, returns the error flag encoded within the NaN. Otherwise, returns RBRINSTRUMENT_READING_FLAG_NONE.
reading | the reading |
double RBRInstrumentReading_setError | ( | RBRInstrumentReadingFlag | flag, |
uint8_t | value | ||
) |
Synthesize a reading with an error set.
flag | the error flag |
value | the error value |
const char* RBRInstrumentReadingFlag_name | ( | RBRInstrumentReadingFlag | flag | ) |
Get a human-readable string name for a reading flag.
[in] | flag | the reading flag |