libRBR  v1.2.3
RBR instrument communication API
Data Structures | Typedefs | Enumerations | Functions
RBRInstrumentCommunication.h File Reference

Instrument commands and structures pertaining to the communication interfaces of the instrument. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RBRInstrumentSerial
 Instrument serial command parameters. More...
 
struct  RBRInstrumentWiFi
 Instrument wifi command parameters. More...
 

Typedefs

typedef enum RBRInstrumentLink RBRInstrumentLink
 Instrument link types. More...
 
typedef enum RBRInstrumentSerialBaudRate RBRInstrumentSerialBaudRate
 Instrument serial baud rates. More...
 
typedef enum RBRInstrumentSerialMode RBRInstrumentSerialMode
 Instrument serial modes. More...
 
typedef struct RBRInstrumentSerial RBRInstrumentSerial
 Instrument serial command parameters. More...
 
typedef enum RBRInstrumentWiFiState RBRInstrumentWiFiState
 The state of the Wi-Fi connection. More...
 
typedef struct RBRInstrumentWiFi RBRInstrumentWiFi
 Instrument wifi command parameters. More...
 

Enumerations

enum  RBRInstrumentLink {
  RBRINSTRUMENT_LINK_USB, RBRINSTRUMENT_LINK_SERIAL, RBRINSTRUMENT_LINK_WIFI, RBRINSTRUMENT_LINK_COUNT,
  RBRINSTRUMENT_UNKNOWN_LINK
}
 Instrument link types. More...
 
enum  RBRInstrumentSerialBaudRate {
  RBRINSTRUMENT_SERIAL_BAUD_NONE = 0, RBRINSTRUMENT_SERIAL_BAUD_300 = 1 << 0, RBRINSTRUMENT_SERIAL_BAUD_600 = 1 << 1, RBRINSTRUMENT_SERIAL_BAUD_1200 = 1 << 2,
  RBRINSTRUMENT_SERIAL_BAUD_2400 = 1 << 3, RBRINSTRUMENT_SERIAL_BAUD_4800 = 1 << 4, RBRINSTRUMENT_SERIAL_BAUD_9600 = 1 << 5, RBRINSTRUMENT_SERIAL_BAUD_19200 = 1 << 6,
  RBRINSTRUMENT_SERIAL_BAUD_28800 = 1 << 7, RBRINSTRUMENT_SERIAL_BAUD_38400 = 1 << 8, RBRINSTRUMENT_SERIAL_BAUD_57600 = 1 << 9, RBRINSTRUMENT_SERIAL_BAUD_115200 = 1 << 10,
  RBRINSTRUMENT_SERIAL_BAUD_230400 = 1 << 11, RBRINSTRUMENT_SERIAL_BAUD_460800 = 1 << 12, RBRINSTRUMENT_SERIAL_BAUD_921600 = 1 << 13, RBRINSTRUMENT_SERIAL_BAUD_MAX = RBRINSTRUMENT_SERIAL_BAUD_921600
}
 Instrument serial baud rates. More...
 
enum  RBRInstrumentSerialMode {
  RBRINSTRUMENT_SERIAL_MODE_NONE = 0, RBRINSTRUMENT_SERIAL_MODE_RS232 = 1 << 0, RBRINSTRUMENT_SERIAL_MODE_RS485F = 1 << 1, RBRINSTRUMENT_SERIAL_MODE_RS485H = 1 << 2,
  RBRINSTRUMENT_SERIAL_MODE_UART = 1 << 3, RBRINSTRUMENT_SERIAL_MODE_UART_IDLE_LOW = 1 << 4, RBRINSTRUMENT_SERIAL_MODE_MAX = RBRINSTRUMENT_SERIAL_MODE_UART_IDLE_LOW
}
 Instrument serial modes. More...
 
enum  RBRInstrumentWiFiState {
  RBRINSTRUMENT_WIFI_NA, RBRINSTRUMENT_WIFI_ON, RBRINSTRUMENT_WIFI_OFF, RBRINSTRUMENT_WIFI_COUNT,
  RBRINSTRUMENT_UNKNOWN_WIFI
}
 The state of the Wi-Fi connection. More...
 

Functions

const char * RBRInstrumentLink_name (RBRInstrumentLink link)
 Get a human-readable string name for a communication link. More...
 
RBRInstrumentError RBRInstrument_getLink (RBRInstrument *instrument, RBRInstrumentLink *link)
 Get the type of connectivity for the instrument connection. More...
 
const char * RBRInstrumentSerialBaudRate_name (RBRInstrumentSerialBaudRate baud)
 Get a human-readable string name for a baud rate. More...
 
const char * RBRInstrumentSerialMode_name (RBRInstrumentSerialMode mode)
 Get a human-readable string name for a serial mode. More...
 
RBRInstrumentError RBRInstrument_getSerial (RBRInstrument *instrument, RBRInstrumentSerial *serial)
 Retrieve the current and available serial baud rates and modes. More...
 
RBRInstrumentError RBRInstrument_setSerial (RBRInstrument *instrument, const RBRInstrumentSerial *serial)
 Reconfigure the instrument serial baud rate and mode. More...
 
RBRInstrumentError RBRInstrument_sleep (RBRInstrument *instrument)
 Immediately shut down communications and implement any possible power-saving measures. More...
 
const char * RBRInstrumentWiFiState_name (RBRInstrumentWiFiState state)
 Get a human-readable string name for a Wi-Fi connection state. More...
 
RBRInstrumentError RBRInstrument_getWiFi (RBRInstrument *instrument, RBRInstrumentWiFi *wifi)
 Retrieve the current instrument Wi-Fi settings. More...
 
RBRInstrumentError RBRInstrument_setWiFi (RBRInstrument *instrument, const RBRInstrumentWiFi *wifi)
 Reconfigure the instrument Wi-Fi settings. More...
 

Detailed Description

Instrument commands and structures pertaining to the communication interfaces of the instrument.

See also
https://docs.rbr-global.com/L3commandreference/commands/communications

Typedef Documentation

◆ RBRInstrumentLink

◆ RBRInstrumentSerial

◆ RBRInstrumentSerialBaudRate

Instrument serial baud rates.

Most of these baud rates are unsupported by the instrument, but are included for sake of completeness. Call RBRInstrument_getBaudRates() to determine which rates are supported by a given instrument.

See also
RBRInstrumentSerial
RBRInstrument_getSerial()
RBRInstrument_setSerial()
https://docs.rbr-global.com/L3commandreference/commands/communications/serial

◆ RBRInstrumentSerialMode

Instrument serial modes.

All modes are 8N1, use no flow control, and are full-duplex unless otherwise noted.

See also
RBRInstrumentSerial
RBRInstrument_getSerial()
RBRInstrument_setSerial()
https://docs.rbr-global.com/L3commandreference/commands/communications/serial

◆ RBRInstrumentWiFi

◆ RBRInstrumentWiFiState

The state of the Wi-Fi connection.

See also
RBRInstrumentWiFi

Enumeration Type Documentation

◆ RBRInstrumentLink

Instrument link types.

See also
RBRInstrument_getLink()
https://docs.rbr-global.com/L3commandreference/commands/communications/link
Enumerator
RBRINSTRUMENT_LINK_USB 

USB CDC connectivity.

RBRINSTRUMENT_LINK_SERIAL 

Serial connectivity.

RBRINSTRUMENT_LINK_WIFI 

Wi-Fi connectivity.

RBRINSTRUMENT_LINK_COUNT 

The number of specific link types.

RBRINSTRUMENT_UNKNOWN_LINK 

An unknown or unrecognized link type.

◆ RBRInstrumentSerialBaudRate

Instrument serial baud rates.

Most of these baud rates are unsupported by the instrument, but are included for sake of completeness. Call RBRInstrument_getBaudRates() to determine which rates are supported by a given instrument.

See also
RBRInstrumentSerial
RBRInstrument_getSerial()
RBRInstrument_setSerial()
https://docs.rbr-global.com/L3commandreference/commands/communications/serial
Enumerator
RBRINSTRUMENT_SERIAL_BAUD_NONE 

None

RBRINSTRUMENT_SERIAL_BAUD_300 

300 Bd

RBRINSTRUMENT_SERIAL_BAUD_600 

600 Bd

RBRINSTRUMENT_SERIAL_BAUD_1200 

1,200 Bd

RBRINSTRUMENT_SERIAL_BAUD_2400 

2,400 Bd

RBRINSTRUMENT_SERIAL_BAUD_4800 

4,800 Bd

RBRINSTRUMENT_SERIAL_BAUD_9600 

9,600 Bd

RBRINSTRUMENT_SERIAL_BAUD_19200 

19,200 Bd

RBRINSTRUMENT_SERIAL_BAUD_28800 

28,800 Bd

RBRINSTRUMENT_SERIAL_BAUD_38400 

38,400 Bd

RBRINSTRUMENT_SERIAL_BAUD_57600 

57,600 Bd

RBRINSTRUMENT_SERIAL_BAUD_115200 

115,200 Bd

RBRINSTRUMENT_SERIAL_BAUD_230400 

230,400 Bd

RBRINSTRUMENT_SERIAL_BAUD_460800 

460,800 Bd

RBRINSTRUMENT_SERIAL_BAUD_921600 

921,600 Bd

RBRINSTRUMENT_SERIAL_BAUD_MAX 

Corresponds to the largest baud rate enum value.

◆ RBRInstrumentSerialMode

Instrument serial modes.

All modes are 8N1, use no flow control, and are full-duplex unless otherwise noted.

See also
RBRInstrumentSerial
RBRInstrument_getSerial()
RBRInstrument_setSerial()
https://docs.rbr-global.com/L3commandreference/commands/communications/serial
Enumerator
RBRINSTRUMENT_SERIAL_MODE_NONE 

No serial mode

RBRINSTRUMENT_SERIAL_MODE_RS232 

RS-232/EIA-232/TIA-232.

RBRINSTRUMENT_SERIAL_MODE_RS485F 

RS-485/EIA-485/TIA-485.

RBRINSTRUMENT_SERIAL_MODE_RS485H 

RS-485/EIA-485/TIA-485 (half-duplex). Unimplemented by the logger.

RBRINSTRUMENT_SERIAL_MODE_UART 

0-3.3V logic, idle high.

RBRINSTRUMENT_SERIAL_MODE_UART_IDLE_LOW 

0-3.3V logic, idle low.

RBRINSTRUMENT_SERIAL_MODE_MAX 

Corresponds to the largest UART mode enum value.

◆ RBRInstrumentWiFiState

The state of the Wi-Fi connection.

See also
RBRInstrumentWiFi
Enumerator
RBRINSTRUMENT_WIFI_NA 

The Wi-Fi connection is disabled.

RBRINSTRUMENT_WIFI_ON 

The Wi-Fi radio is powered up and ready to communicate.

RBRINSTRUMENT_WIFI_OFF 

The Wi-Fi radio is powered down.

RBRINSTRUMENT_WIFI_COUNT 

The number of specific states.

RBRINSTRUMENT_UNKNOWN_WIFI 

An unknown or unrecognized state.

Function Documentation

◆ RBRInstrument_getLink()

RBRInstrumentError RBRInstrument_getLink ( RBRInstrument instrument,
RBRInstrumentLink link 
)

Get the type of connectivity for the instrument connection.

Parameters
[in]instrumentthe instrument connection
[out]linkthe link type
Returns
RBRINSTRUMENT_SUCCESS when the setting is successfully read
RBRINSTRUMENT_TIMEOUT when a timeout occurs
RBRINSTRUMENT_CALLBACK_ERROR returned by a callback
See also
https://docs.rbr-global.com/L3commandreference/commands/communications/link

◆ RBRInstrument_getSerial()

RBRInstrumentError RBRInstrument_getSerial ( RBRInstrument instrument,
RBRInstrumentSerial serial 
)

Retrieve the current and available serial baud rates and modes.

Parameters
[in]instrumentthe instrument connection
[out]serialthe current and available serial parameters
Returns
RBRINSTRUMENT_SUCCESS when the setting is successfully read
RBRINSTRUMENT_TIMEOUT when a timeout occurs
RBRINSTRUMENT_CALLBACK_ERROR returned by a callback
See also
RBRInstrument_setSerial()
https://docs.rbr-global.com/L3commandreference/commands/communications/serial

◆ RBRInstrument_getWiFi()

RBRInstrumentError RBRInstrument_getWiFi ( RBRInstrument instrument,
RBRInstrumentWiFi wifi 
)

Retrieve the current instrument Wi-Fi settings.

Parameters
[in]instrumentthe instrument connection
[out]wifithe current Wi-Fi parameters
Returns
RBRINSTRUMENT_SUCCESS when the setting is successfully read
RBRINSTRUMENT_TIMEOUT when a timeout occurs
RBRINSTRUMENT_CALLBACK_ERROR returned by a callback
RBRINSTRUMENT_HARDWARE_ERROR when the feature is unavailable
See also
RBRInstrument_setWiFi()
https://docs.rbr-global.com/L3commandreference/commands/communications/wifi

◆ RBRInstrument_setSerial()

RBRInstrumentError RBRInstrument_setSerial ( RBRInstrument instrument,
const RBRInstrumentSerial serial 
)

Reconfigure the instrument serial baud rate and mode.

A hardware error will occur if the baud rate or mode is unsupported by the instrument. See RBRInstrumentSerial.availableBaudRates and RBRInstrumentSerial.availableSerialModes to determine supported rates/modes.

The new serial mode and/or baud rate will take effect immediately after the response to this command has been produced. Make sure you alter the configuration of your connection to the instrument correspondingly.

Parameters
[in]instrumentthe instrument connection
[in]serialthe new serial parameters
Returns
RBRINSTRUMENT_SUCCESS when the setting is successfully written
RBRINSTRUMENT_TIMEOUT when a timeout occurs
RBRINSTRUMENT_CALLBACK_ERROR returned by a callback
RBRINSTRUMENT_HARDWARE_ERROR when a value is not supported
RBRINSTRUMENT_INVALID_PARAMETER_VALUE when the baud/mode is invalid
See also
RBRInstrument_getSerial()
https://docs.rbr-global.com/L3commandreference/commands/communications/serial

◆ RBRInstrument_setWiFi()

RBRInstrumentError RBRInstrument_setWiFi ( RBRInstrument instrument,
const RBRInstrumentWiFi wifi 
)

Reconfigure the instrument Wi-Fi settings.

For Logger3 instruments, this sends the values of RBRInstrumentWiFi.enabled, RBRInstrumentWiFi.powerTimeout, and RBRInstrumentWiFi.commandTimeout. For Logger2 instruments, this sends only the values of RBRInstrumentWiFi.powerTimeout and RBRInstrumentWiFi.commandTimeout as the RBRInstrumentWiFi.enabled parameter does not exist for that generation of instruments.

Parameters
[in]instrumentthe instrument connection
[out]wifithe new Wi-Fi parameters
Returns
RBRINSTRUMENT_SUCCESS when the setting is successfully written
RBRINSTRUMENT_TIMEOUT when a timeout occurs
RBRINSTRUMENT_CALLBACK_ERROR returned by a callback
RBRINSTRUMENT_HARDWARE_ERROR when the feature is unavailable
RBRINSTRUMENT_INVALID_PARAMETER_VALUE when parameter values are out of range
See also
RBRInstrument_getWifi()
https://docs.rbr-global.com/L3commandreference/commands/communications/wifi

◆ RBRInstrument_sleep()

RBRInstrumentError RBRInstrument_sleep ( RBRInstrument instrument)

Immediately shut down communications and implement any possible power-saving measures.

Parameters
[in]instrumentthe instrument connection
Returns
RBRINSTRUMENT_SUCCESS when the instrument has been put to sleep
RBRINSTRUMENT_CALLBACK_ERROR returned by a callback
See also
https://docs.rbr-global.com/L3commandreference/commands/communications/sleep

◆ RBRInstrumentLink_name()

const char* RBRInstrumentLink_name ( RBRInstrumentLink  link)

Get a human-readable string name for a communication link.

Parameters
[in]linkthe communication link
Returns
a string name for the communication link
See also
RBRInstrumentError_name() for a description of the format of names

◆ RBRInstrumentSerialBaudRate_name()

const char* RBRInstrumentSerialBaudRate_name ( RBRInstrumentSerialBaudRate  baud)

Get a human-readable string name for a baud rate.

Parameters
[in]baudthe baud rate
Returns
a string name for the baud rate
See also
RBRInstrumentError_name() for a description of the format of names

◆ RBRInstrumentSerialMode_name()

const char* RBRInstrumentSerialMode_name ( RBRInstrumentSerialMode  mode)

Get a human-readable string name for a serial mode.

Parameters
[in]modethe serial mode
Returns
a string name for the serial mode
See also
RBRInstrumentError_name() for a description of the format of names

◆ RBRInstrumentWiFiState_name()

const char* RBRInstrumentWiFiState_name ( RBRInstrumentWiFiState  state)

Get a human-readable string name for a Wi-Fi connection state.

Parameters
[in]statethe Wi-Fi connection state
Returns
a string name for the Wi-Fi connection state
See also
RBRInstrumentError_name() for a description of the format of names