libRBR  v1.2.3
RBR instrument communication API
RBRInstrumentStreaming.h
Go to the documentation of this file.
1 
14 #ifndef LIBRBR_RBRINSTRUMENTSTREAMING_H
15 #define LIBRBR_RBRINSTRUMENTSTREAMING_H
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
25 #define RBRINSTRUMENT_OUTPUT_FORMAT_NAME_MAX 15
26 
34 {
36  int32_t count;
38  struct
39  {
46 
70  RBRInstrument *instrument,
71  RBRInstrumentChannelsList *channelsList);
72 
80 {
82  int32_t count;
88 
111  RBRInstrument *instrument,
112  RBRInstrumentLabelsList *labelsList);
113 
123 {
144 
153 
169  RBRInstrument *instrument,
170  RBRInstrumentOutputFormat *outputFormats);
171 
183  RBRInstrument *instrument,
184  RBRInstrumentOutputFormat *outputFormat);
185 
199  RBRInstrument *instrument,
200  RBRInstrumentOutputFormat outputFormat);
201 
214  RBRInstrument *instrument,
215  bool *enabled);
216 
229  RBRInstrument *instrument,
230  bool enabled);
231 
244  RBRInstrument *instrument,
245  bool *enabled);
246 
259  RBRInstrument *instrument,
260  bool enabled);
261 
270 {
271  /* Signal actively driven high. */
272  RBRINSTRUMENT_ACTIVE_HIGH,
273  /* Signal actively driven low. */
274  RBRINSTRUMENT_ACTIVE_LOW,
280 
291 
300 {
301  /* Passive, high-impedance signal. */
302  RBRINSTRUMENT_SLEEP_TRISTATE,
303  /* Signal actively driven high. */
304  RBRINSTRUMENT_SLEEP_HIGH,
305  /* Signal actively driven low. */
306  RBRINSTRUMENT_SLEEP_LOW,
312 
323 
333 {
339  uint8_t aux;
341  bool enabled;
352  int32_t setup;
362  int32_t hold;
374 
400  RBRInstrument *instrument,
401  RBRInstrumentAuxOutput *auxOutput);
402 
422  RBRInstrument *instrument,
423  const RBRInstrumentAuxOutput *auxOutput);
424 
429 {
441 
450 
463 
475 uint8_t RBRInstrumentReading_getError(double reading);
476 
487  uint8_t value);
488 
492 typedef struct RBRInstrumentSample
493 {
497  int32_t channels;
514 
529 
530 #ifdef __cplusplus
531 }
532 #endif
533 
534 #endif /* LIBRBR_RBRINSTRUMENTSTREAMING_H */
RBRInstrument_getLabelsList
RBRInstrumentError RBRInstrument_getLabelsList(RBRInstrument *instrument, RBRInstrumentLabelsList *labelsList)
Report a list of labels for active channels, in order.
RBRINSTRUMENT_UNKNOWN_SLEEP
@ RBRINSTRUMENT_UNKNOWN_SLEEP
Definition: RBRInstrumentStreaming.h:310
RBRInstrument_getOutputFormat
RBRInstrumentError RBRInstrument_getOutputFormat(RBRInstrument *instrument, RBRInstrumentOutputFormat *outputFormat)
Get the current output format.
RBRInstrumentLabelsList::labels
char labels[RBRINSTRUMENT_CHANNEL_MAX][RBRINSTRUMENT_CHANNEL_LABEL_MAX+1]
The label for each active channel as null-terminated C strings.
Definition: RBRInstrumentStreaming.h:86
RBRInstrument_getChannelsList
RBRInstrumentError RBRInstrument_getChannelsList(RBRInstrument *instrument, RBRInstrumentChannelsList *channelsList)
Report a list of names and units for active channels, in order.
RBRINSTRUMENT_OUTFORMAT_CALTEXT02
@ RBRINSTRUMENT_OUTFORMAT_CALTEXT02
Definition: RBRInstrumentStreaming.h:129
RBRINSTRUMENT_CHANNEL_MAX
#define RBRINSTRUMENT_CHANNEL_MAX
The maximum number of channels present on an instrument.
Definition: RBRInstrument.h:93
RBRInstrumentLabelsList
Response to the outputformat labelslist command.
Definition: RBRInstrumentStreaming.h:79
RBRInstrumentLabelsList::count
int32_t count
The number of active channels.
Definition: RBRInstrumentStreaming.h:82
RBRINSTRUMENT_CHANNEL_NAME_MAX
#define RBRINSTRUMENT_CHANNEL_NAME_MAX
The maximum number of characters in a channel name (e.g., “Temperature”).
Definition: RBRInstrument.h:109
RBRInstrumentReading_getFlag
RBRInstrumentReadingFlag RBRInstrumentReading_getFlag(double reading)
Get the error flag from a reading.
RBRINSTRUMENT_CHANNEL_UNIT_MAX
#define RBRINSTRUMENT_CHANNEL_UNIT_MAX
The maximum number of characters in a channel unit name (e.g., “C”).
Definition: RBRInstrument.h:123
RBRInstrumentAuxOutput::active
RBRInstrumentAuxOutputActiveLevel active
The active level of the auxiliary output signal seen by the external device during the setup time,...
Definition: RBRInstrumentStreaming.h:367
RBRInstrument_getAvailableOutputFormats
RBRInstrumentError RBRInstrument_getAvailableOutputFormats(RBRInstrument *instrument, RBRInstrumentOutputFormat *outputFormats)
Report a list of available output formats.
RBRInstrumentReading_setError
double RBRInstrumentReading_setError(RBRInstrumentReadingFlag flag, uint8_t value)
Synthesize a reading with an error set.
RBRINSTRUMENT_SLEEP_COUNT
@ RBRINSTRUMENT_SLEEP_COUNT
Definition: RBRInstrumentStreaming.h:308
RBRInstrumentAuxOutputActiveLevel
RBRInstrumentAuxOutputActiveLevel
Possible levels of the auxiliary output signal during the setup time, data transmission,...
Definition: RBRInstrumentStreaming.h:269
RBRInstrumentDateTime
int64_t RBRInstrumentDateTime
Definition: RBRInstrument.h:181
RBRInstrumentAuxOutputSleepLevel
RBRInstrumentAuxOutputSleepLevel
Possible levels of the auxiliary output signal while the instrument is asleep.
Definition: RBRInstrumentStreaming.h:299
RBRINSTRUMENT_OUTFORMAT_CALTEXT07
@ RBRINSTRUMENT_OUTFORMAT_CALTEXT07
Definition: RBRInstrumentStreaming.h:140
RBRInstrumentChannelsList::unit
char unit[RBRINSTRUMENT_CHANNEL_UNIT_MAX+1]
The unit of the channel as a null-terminated C string.
Definition: RBRInstrumentStreaming.h:43
RBRINSTRUMENT_CHANNEL_LABEL_MAX
#define RBRINSTRUMENT_CHANNEL_LABEL_MAX
The maximum number of characters in a channel label.
Definition: RBRInstrument.h:131
RBRInstrumentReading_getError
uint8_t RBRInstrumentReading_getError(double reading)
Get the error value from a reading.
RBRINSTRUMENT_OUTFORMAT_MAX
@ RBRINSTRUMENT_OUTFORMAT_MAX
Definition: RBRInstrumentStreaming.h:142
RBRInstrumentAuxOutput::enabled
bool enabled
Enables or disables the auxiliary output.
Definition: RBRInstrumentStreaming.h:341
RBRINSTRUMENT_READING_FLAG_COUNT
@ RBRINSTRUMENT_READING_FLAG_COUNT
Definition: RBRInstrumentStreaming.h:437
RBRINSTRUMENT_OUTFORMAT_CALTEXT04
@ RBRINSTRUMENT_OUTFORMAT_CALTEXT04
Definition: RBRInstrumentStreaming.h:136
RBRInstrument_readSample
RBRInstrumentError RBRInstrument_readSample(RBRInstrument *instrument)
Retrieve and parse data streamed from the instrument.
RBRInstrumentOutputFormat_name
const char * RBRInstrumentOutputFormat_name(RBRInstrumentOutputFormat format)
Get a human-readable string name for an output format.
RBRInstrumentChannelsList::count
int32_t count
The number of active channels.
Definition: RBRInstrumentStreaming.h:36
RBRInstrumentAuxOutput::setup
int32_t setup
The signal set-up time.
Definition: RBRInstrumentStreaming.h:352
RBRINSTRUMENT_OUTFORMAT_CALTEXT01
@ RBRINSTRUMENT_OUTFORMAT_CALTEXT01
Definition: RBRInstrumentStreaming.h:127
RBRInstrumentSample::readings
double readings[RBRINSTRUMENT_CHANNEL_MAX]
The sample readings.
Definition: RBRInstrumentStreaming.h:512
RBRInstrumentError
RBRInstrumentError
Errors which can be returned from library functions.
Definition: RBRInstrument.h:200
RBRInstrumentSample
struct RBRInstrumentSample RBRInstrumentSample
An instrument sample.
RBRInstrumentChannelsList::name
char name[RBRINSTRUMENT_CHANNEL_NAME_MAX+1]
The name of the channel as a null-terminated C string.
Definition: RBRInstrumentStreaming.h:41
RBRInstrumentChannelsList
struct RBRInstrumentChannelsList RBRInstrumentChannelsList
Response to the outputformat channelslist command.
RBRInstrumentReadingFlag
RBRInstrumentReadingFlag
A flag set on a sample reading.
Definition: RBRInstrumentStreaming.h:428
RBRINSTRUMENT_READING_FLAG_UNCALIBRATED
@ RBRINSTRUMENT_READING_FLAG_UNCALIBRATED
Definition: RBRInstrumentStreaming.h:433
RBRInstrumentOutputFormat
RBRInstrumentOutputFormat
Instrument output formats.
Definition: RBRInstrumentStreaming.h:122
RBRInstrumentSample
An instrument sample.
Definition: RBRInstrumentStreaming.h:492
RBRInstrumentAuxOutput::hold
int32_t hold
The signal hold time.
Definition: RBRInstrumentStreaming.h:362
RBRInstrumentAuxOutput::sleep
RBRInstrumentAuxOutputSleepLevel sleep
The level of the auxiliary output signal seen by the external device while the instrument is asleep.
Definition: RBRInstrumentStreaming.h:372
RBRInstrument_getAuxOutput
RBRInstrumentError RBRInstrument_getAuxOutput(RBRInstrument *instrument, RBRInstrumentAuxOutput *auxOutput)
Get the instrument auxiliary output signal parameters.
RBRInstrumentSample::timestamp
RBRInstrumentDateTime timestamp
The timestamp of the sample.
Definition: RBRInstrumentStreaming.h:495
RBRINSTRUMENT_READING_FLAG_NONE
@ RBRINSTRUMENT_READING_FLAG_NONE
Definition: RBRInstrumentStreaming.h:431
RBRInstrument_setAuxOutput
RBRInstrumentError RBRInstrument_setAuxOutput(RBRInstrument *instrument, const RBRInstrumentAuxOutput *auxOutput)
Set the instrument auxiliary output signal parameters.
RBRINSTRUMENT_OUTFORMAT_NONE
@ RBRINSTRUMENT_OUTFORMAT_NONE
Definition: RBRInstrumentStreaming.h:125
RBRInstrumentSample::channels
int32_t channels
The number of populated sample readings.
Definition: RBRInstrumentStreaming.h:497
RBRInstrumentLabelsList
struct RBRInstrumentLabelsList RBRInstrumentLabelsList
Response to the outputformat labelslist command.
RBRInstrumentAuxOutput
struct RBRInstrumentAuxOutput RBRInstrumentAuxOutput
Instrument streamserial command parameters relating to the auxiliary output signal functionality.
RBRInstrumentAuxOutputSleepLevel_name
const char * RBRInstrumentAuxOutputSleepLevel_name(RBRInstrumentAuxOutputSleepLevel level)
Get a human-readable string name for a signal level of a sleeping auxiliary output.
RBRInstrumentChannelsList::channels
struct RBRInstrumentChannelsList::@1 channels[RBRINSTRUMENT_CHANNEL_MAX]
The name and unit of each active channel.
RBRInstrument_setUSBStreamingState
RBRInstrumentError RBRInstrument_setUSBStreamingState(RBRInstrument *instrument, bool enabled)
Set the USB streaming state.
RBRInstrument_getUSBStreamingState
RBRInstrumentError RBRInstrument_getUSBStreamingState(RBRInstrument *instrument, bool *enabled)
Get the USB streaming state.
RBRINSTRUMENT_UNKNOWN_READING_FLAG
@ RBRINSTRUMENT_UNKNOWN_READING_FLAG
Definition: RBRInstrumentStreaming.h:439
RBRInstrumentAuxOutput
Instrument streamserial command parameters relating to the auxiliary output signal functionality.
Definition: RBRInstrumentStreaming.h:332
RBRInstrumentChannelsList
Response to the outputformat channelslist command.
Definition: RBRInstrumentStreaming.h:33
RBRINSTRUMENT_READING_FLAG_ERROR
@ RBRINSTRUMENT_READING_FLAG_ERROR
Definition: RBRInstrumentStreaming.h:435
RBRInstrumentAuxOutputActiveLevel_name
const char * RBRInstrumentAuxOutputActiveLevel_name(RBRInstrumentAuxOutputActiveLevel level)
Get a human-readable string name for a signal level of an active auxiliary output.
RBRInstrument
Core library context object.
Definition: RBRInstrument.h:591
RBRInstrument_setOutputFormat
RBRInstrumentError RBRInstrument_setOutputFormat(RBRInstrument *instrument, RBRInstrumentOutputFormat outputFormat)
Set the current output format.
RBRINSTRUMENT_ACTIVE_COUNT
@ RBRINSTRUMENT_ACTIVE_COUNT
Definition: RBRInstrumentStreaming.h:276
RBRInstrumentReadingFlag_name
const char * RBRInstrumentReadingFlag_name(RBRInstrumentReadingFlag flag)
Get a human-readable string name for a reading flag.
RBRInstrument_setSerialStreamingState
RBRInstrumentError RBRInstrument_setSerialStreamingState(RBRInstrument *instrument, bool enabled)
Set the serial streaming state.
RBRINSTRUMENT_OUTFORMAT_CALTEXT03
@ RBRINSTRUMENT_OUTFORMAT_CALTEXT03
Definition: RBRInstrumentStreaming.h:134
RBRInstrument_getSerialStreamingState
RBRInstrumentError RBRInstrument_getSerialStreamingState(RBRInstrument *instrument, bool *enabled)
Get the serial streaming state.
RBRInstrumentAuxOutput::aux
uint8_t aux
Which auxiliary output signal settings to retrieve or configure.
Definition: RBRInstrumentStreaming.h:339
RBRINSTRUMENT_UNKNOWN_ACTIVE
@ RBRINSTRUMENT_UNKNOWN_ACTIVE
Definition: RBRInstrumentStreaming.h:278