libRBR v1.2.3
RBR instrument communication API
Data Fields
RBRInstrument Struct Reference

Core library context object. More...

#include <RBRInstrument.h>

Data Fields

struct RBRInstrumentId id
 The instrument identifier. More...
 
RBRInstrumentGeneration generation
 The generation of the instrument. More...
 
RBRInstrumentCallbacks callbacks
 The set of callbacks to be used by the connection.
 
RBRInstrumentDateTime commandTimeout
 The command timeout in milliseconds. More...
 
void * userData
 Arbitrary user data; useful in callbacks.
 
int32_t commandBufferLength
 The number of used bytes in the command buffer.
 
int32_t responseBufferLength
 The number of used bytes in the response buffer.
 
RBRInstrumentDateTime lastActivityTime
 The time at which instrument communication last occurred. More...
 
int32_t lastResponseLength
 The length in bytes of the most recent response. More...
 
uint8_t commandBuffer [RBRINSTRUMENT_COMMAND_BUFFER_MAX]
 The next command to be sent to the instrument. More...
 
uint8_t responseBuffer [RBRINSTRUMENT_RESPONSE_BUFFER_MAX]
 Data received from the instrument. More...
 
RBRInstrumentResponse response
 The most recent response received from the instrument. More...
 
bool managedAllocation
 Whether the instance memory was dynamically allocated by the constructor.
 

Detailed Description

Core library context object.

Users are strongly discouraged from accessing the fields of this structure directly as layout and field availability maybe unstable from version to version. Getter and setter functions are available for safely reading from and writing to fields where necessary.

See also
RBRInstrument_open() to open an instrument connection
RBRInstrument_close() to close an instrument connection

Field Documentation

◆ commandBuffer

uint8_t RBRInstrument::commandBuffer[RBRINSTRUMENT_COMMAND_BUFFER_MAX]

The next command to be sent to the instrument.

Intentionally not a char array to discourage the use of str functions. Commands may contain binary data and should not be assumed to be null-terminated.

◆ commandTimeout

RBRInstrumentDateTime RBRInstrument::commandTimeout

The command timeout in milliseconds.

See Timeouts for details on how the library handles timeouts.

◆ generation

RBRInstrumentGeneration RBRInstrument::generation

The generation of the instrument.

Detected while establishing the instrument connection.

◆ id

struct RBRInstrumentId RBRInstrument::id

The instrument identifier.

Cached every time RBRInstrument_getId() is called.

◆ lastActivityTime

RBRInstrumentDateTime RBRInstrument::lastActivityTime

The time at which instrument communication last occurred.

Used to determine whether the instrument needs to be woken before further commands are sent.

◆ lastResponseLength

int32_t RBRInstrument::lastResponseLength

The length in bytes of the most recent response.

Used when moving the last response out of the parse buffer before receiving new data.

◆ response

RBRInstrumentResponse RBRInstrument::response

The most recent response received from the instrument.

After the response parser identifies and terminates a command response, attributes of the response and its beginning position within the response buffer are recorded within this struct.

◆ responseBuffer

uint8_t RBRInstrument::responseBuffer[RBRINSTRUMENT_RESPONSE_BUFFER_MAX]

Data received from the instrument.

Intentionally not a char array to discourage the use of str functions. Responses may contain binary data and should not be assumed to be null-terminated. RBRInstrumentResponse::response, when non-NULL, provides null-terminated, C-string access to the response.


The documentation for this struct was generated from the following file: