rodbus (C++ API) 1.3.1
|
main namespace for the rodbus library More...
Namespaces | |
namespace | functional |
helpers functions to create interface implementations using lambdas | |
Classes | |
class | AddressFilter |
Filter used to restrict which IP addresses may communicate with a server. More... | |
struct | AddressRange |
Range of 16-bit addresses sent in a request from the client to the server. More... | |
class | AuthorizationHandler |
User implemented interface defines which request and roles are allowed for different functions when implementing Modbus security. More... | |
class | BitReadCallback |
Callbacks received when reading coils or discrete inputs. More... | |
struct | BitValue |
Index/value tuple of a bit type. More... | |
class | BitValueIterator |
Iterator over BitValue instances. More... | |
class | ClientChannel |
Abstract representation of a client communication channel. More... | |
class | ClientStateListener |
Callback for monitoring the state of a TCP/TLS connection state. More... | |
class | Database |
Class used to add, remove, update, and retrieve values. More... | |
class | DatabaseCallback |
Callback used to access the internal database while it is locked. More... | |
struct | DecodeLevel |
Controls the decoding of transmitted and received data at the application, frame, and physical layer. More... | |
class | DeviceMap |
Maps endpoint handlers to Modbus address. More... | |
class | Logger |
Logging interface that receives the log messages and writes them somewhere. More... | |
class | Logging |
Provides a static method for configuring logging. More... | |
struct | LoggingConfig |
Logging configuration options. More... | |
class | ParamException |
Exception type corresponding to the underlying error enum ParamError. More... | |
class | PortStateListener |
Callback interface for receiving updates about the state of a serial port. More... | |
class | RegisterReadCallback |
Callbacks received when reading reading holding or input registers. More... | |
struct | RegisterValue |
Index/value tuple of a register type. More... | |
class | RegisterValueIterator |
Iterator over RegisterValue instances. More... | |
class | RequestException |
Exception type corresponding to the underlying error enum RequestError. More... | |
struct | RequestParam |
Address and timeout parameters for requests. More... | |
struct | RetryStrategy |
Retry strategy configuration. More... | |
class | Runtime |
Handle to the underlying runtime. More... | |
struct | RuntimeConfig |
Runtime configuration. More... | |
struct | SerialPortSettings |
Serial port settings. More... | |
class | Server |
Handle to the running server. The server runs on a background task until this class is destroyed. More... | |
struct | TlsClientConfig |
TLS client configuration. More... | |
struct | TlsServerConfig |
TLS server configuration. More... | |
class | WriteCallback |
Callback methods received from asynchronous write operations. More... | |
class | WriteHandler |
Interface used to handle write requests received from the client. More... | |
struct | WriteResult |
Describes to the server if a write operation was successful or not. More... | |
Enumerations | |
enum class | ParamError { ok = 0 , no_support = 1 , null_parameter = 2 , logging_already_configured = 3 , runtime_creation_failure = 4 , runtime_destroyed = 5 , runtime_cannot_block_within_async = 6 , invalid_ip_address = 7 , invalid_range = 8 , invalid_request = 9 , invalid_index = 10 , server_bind_error = 11 , invalid_unit_id = 12 , invalid_peer_certificate = 13 , invalid_local_certificate = 14 , invalid_private_key = 15 , invalid_dns_name = 16 , bad_tls_config = 17 , shutdown = 18 , invalid_utf8 = 19 } |
Error type that indicates a bad parameter or bad programmer logic. More... | |
enum class | Nothing { nothing = 0 } |
A single value enum which is used as a placeholder for futures that don't return a value. More... | |
enum class | AppDecodeLevel { nothing = 0 , function_code = 1 , data_headers = 2 , data_values = 3 } |
Controls how transmitted and received message at the application layer are decoded at the INFO log level. More... | |
enum class | FrameDecodeLevel { nothing = 0 , header = 1 , payload = 2 } |
Controls how the transmitted and received frames are decoded at the INFO log level. More... | |
enum class | PhysDecodeLevel { nothing = 0 , length = 1 , data = 2 } |
Controls how data transmitted at the physical layer (TCP, serial, etc) is logged. More... | |
enum class | RequestError { ok = 0 , shutdown = 1 , no_connection = 2 , response_timeout = 3 , bad_request = 4 , bad_response = 5 , io_error = 6 , bad_framing = 7 , internal_error = 8 , bad_argument = 9 , modbus_exception_illegal_function = 10 , modbus_exception_illegal_data_address = 11 , modbus_exception_illegal_data_value = 12 , modbus_exception_server_device_failure = 13 , modbus_exception_acknowledge = 14 , modbus_exception_server_device_busy = 15 , modbus_exception_memory_parity_error = 16 , modbus_exception_gateway_path_unavailable = 17 , modbus_exception_gateway_target_device_failed_to_respond = 18 , modbus_exception_unknown = 19 } |
Error information returned from asynchronous functions calls. More... | |
enum class | ModbusException { illegal_function = 1 , illegal_data_address = 2 , illegal_data_value = 3 , server_device_failure = 4 , acknowledge = 5 , server_device_busy = 6 , memory_parity_error = 8 , gateway_path_unavailable = 10 , gateway_target_device_failed_to_respond = 11 , unknown = 255 } |
Error information returned during asynchronous API calls. More... | |
enum class | DataBits { five = 0 , six = 1 , seven = 2 , eight = 3 } |
Number of bits per character. More... | |
enum class | FlowControl { none = 0 , software = 1 , hardware = 2 } |
Flow control modes. More... | |
enum class | Parity { none = 0 , odd = 1 , even = 2 } |
Parity checking modes. More... | |
enum class | StopBits { one = 0 , two = 1 } |
Number of stop bits. More... | |
enum class | MinTlsVersion { v12 = 0 , v13 = 1 } |
Minimum TLS version to allow. More... | |
enum class | CertificateMode { authority_based = 0 , self_signed = 1 } |
Determines how the certificate(s) presented by the peer are validated. More... | |
enum class | LogLevel { error = 0 , warn = 1 , info = 2 , debug = 3 , trace = 4 } |
Log level. More... | |
enum class | LogOutputFormat { text = 0 , json = 1 } |
Describes how each log event is formatted. More... | |
enum class | TimeFormat { none = 0 , rfc_3339 = 1 , system = 2 } |
Describes if and how the time will be formatted in log messages. More... | |
enum class | ClientState { disabled = 0 , connecting = 1 , connected = 2 , wait_after_failed_connect = 3 , wait_after_disconnect = 4 , shutdown = 5 } |
State of the client connection. More... | |
enum class | PortState { disabled = 0 , wait = 1 , open = 2 , shutdown = 3 } |
State of the serial port. More... | |
enum class | Authorization { allow = 0 , deny = 1 } |
Authorization result used by AuthorizationHandler. More... | |
Functions | |
const char * | to_string (ParamError value) |
convert an instance of enum ParamError into a C-style string More... | |
const char * | to_string (Nothing value) |
convert an instance of enum Nothing into a C-style string More... | |
const char * | to_string (AppDecodeLevel value) |
convert an instance of enum AppDecodeLevel into a C-style string More... | |
const char * | to_string (FrameDecodeLevel value) |
convert an instance of enum FrameDecodeLevel into a C-style string More... | |
const char * | to_string (PhysDecodeLevel value) |
convert an instance of enum PhysDecodeLevel into a C-style string More... | |
const char * | to_string (RequestError value) |
convert an instance of enum RequestError into a C-style string More... | |
const char * | to_string (ModbusException value) |
convert an instance of enum ModbusException into a C-style string More... | |
const char * | to_string (DataBits value) |
convert an instance of enum DataBits into a C-style string More... | |
const char * | to_string (FlowControl value) |
convert an instance of enum FlowControl into a C-style string More... | |
const char * | to_string (Parity value) |
convert an instance of enum Parity into a C-style string More... | |
const char * | to_string (StopBits value) |
convert an instance of enum StopBits into a C-style string More... | |
const char * | to_string (MinTlsVersion value) |
convert an instance of enum MinTlsVersion into a C-style string More... | |
const char * | to_string (CertificateMode value) |
convert an instance of enum CertificateMode into a C-style string More... | |
const char * | to_string (LogLevel value) |
convert an instance of enum LogLevel into a C-style string More... | |
const char * | to_string (LogOutputFormat value) |
convert an instance of enum LogOutputFormat into a C-style string More... | |
const char * | to_string (TimeFormat value) |
convert an instance of enum TimeFormat into a C-style string More... | |
const char * | to_string (ClientState value) |
convert an instance of enum ClientState into a C-style string More... | |
const char * | to_string (PortState value) |
convert an instance of enum PortState into a C-style string More... | |
const char * | to_string (Authorization value) |
convert an instance of enum Authorization into a C-style string More... | |
Variables | |
constexpr uint64_t | rodbus_version_major = 1 |
major version number More... | |
constexpr uint64_t | rodbus_version_minor = 3 |
minor version number More... | |
constexpr uint64_t | rodbus_version_patch = 1 |
patch version number More... | |
constexpr char const * | rodbus_version_string = "1.3.1" |
version number as the string major.minor.patch More... | |
main namespace for the rodbus library
|
strong |
Controls how transmitted and received message at the application layer are decoded at the INFO log level.
Application-layer messages are referred to as Protocol Data Units (PDUs) in the specification.
|
strong |
Authorization result used by AuthorizationHandler.
Enumerator | |
---|---|
allow | Client is authorized to perform the operation. |
deny | Client is NOT authorized to perform the operation. |
|
strong |
Determines how the certificate(s) presented by the peer are validated.
This validation always occurs after the handshake signature has been verified.
|
strong |
State of the client connection.
Used by the ClientStateListener.
|
strong |
|
strong |
|
strong |
Controls how the transmitted and received frames are decoded at the INFO log level.
Transport-specific framing wraps the application-layer traffic. You'll see these frames called ADUs in the Modbus specification.
On TCP, this is the MBAP decoding. On serial, this controls the serial line PDU.
Enumerator | |
---|---|
nothing | Log nothing. |
header | Decode the header. |
payload | Decode the header and the raw payload as hexadecimal. |
|
strong |
Log level.
Used in Logger::on_message() callback to identify the log level of a message.
Enumerator | |
---|---|
error | Error log level. |
warn | Warning log level. |
info | Information log level. |
debug | Debugging log level. |
trace | Trace log level. |
|
strong |
|
strong |
|
strong |
Error information returned during asynchronous API calls.
|
strong |
|
strong |
Error type that indicates a bad parameter or bad programmer logic.
Enumerator | |
---|---|
ok | Success, i.e. no error occurred. |
no_support | The FFI library was compiled without support for this feature. |
null_parameter | Null parameter. |
logging_already_configured | Logging can only be configured once. |
runtime_creation_failure | Failed to create Tokio runtime. |
runtime_destroyed | Runtime was already disposed of. |
runtime_cannot_block_within_async | Runtime cannot execute blocking call within asynchronous context. |
invalid_ip_address | Invalid IP address. |
invalid_range | Invalid Modbus address range. |
invalid_request | Invalid Modbus request. |
invalid_index | Invalid index. |
server_bind_error | Server failed to bind to the specified port. |
invalid_unit_id | The specified unit id is not associated to this server. |
invalid_peer_certificate | Invalid peer certificate file. |
invalid_local_certificate | Invalid local certificate file. |
invalid_private_key | Invalid private key file. |
invalid_dns_name | Invalid DNS name. |
bad_tls_config | Bad TLS configuration. |
shutdown | The task has been shutdown. |
invalid_utf8 | String argument was not valid UTF-8. |
|
strong |
|
strong |
|
strong |
State of the serial port.
Used by the PortStateListener.
Enumerator | |
---|---|
disabled | Disabled until enabled. |
wait | Waiting to perform an open retry. |
open | Port is open. |
shutdown | Task has been shut down. |
|
strong |
Error information returned from asynchronous functions calls.
Unlike ParamError, the values here generally represent spontaneous failures that are outside developer control, e.g. network failures, etc
|
strong |
|
strong |
const char * rodbus::to_string | ( | AppDecodeLevel | value | ) |
convert an instance of enum AppDecodeLevel into a C-style string
value | enum value |
const char * rodbus::to_string | ( | Authorization | value | ) |
convert an instance of enum Authorization into a C-style string
value | enum value |
const char * rodbus::to_string | ( | CertificateMode | value | ) |
convert an instance of enum CertificateMode into a C-style string
value | enum value |
const char * rodbus::to_string | ( | ClientState | value | ) |
convert an instance of enum ClientState into a C-style string
value | enum value |
const char * rodbus::to_string | ( | DataBits | value | ) |
convert an instance of enum DataBits into a C-style string
value | enum value |
const char * rodbus::to_string | ( | FlowControl | value | ) |
convert an instance of enum FlowControl into a C-style string
value | enum value |
const char * rodbus::to_string | ( | FrameDecodeLevel | value | ) |
convert an instance of enum FrameDecodeLevel into a C-style string
value | enum value |
const char * rodbus::to_string | ( | LogLevel | value | ) |
convert an instance of enum LogLevel into a C-style string
value | enum value |
const char * rodbus::to_string | ( | LogOutputFormat | value | ) |
convert an instance of enum LogOutputFormat into a C-style string
value | enum value |
const char * rodbus::to_string | ( | MinTlsVersion | value | ) |
convert an instance of enum MinTlsVersion into a C-style string
value | enum value |
const char * rodbus::to_string | ( | ModbusException | value | ) |
convert an instance of enum ModbusException into a C-style string
value | enum value |
const char * rodbus::to_string | ( | Nothing | value | ) |
convert an instance of enum Nothing into a C-style string
value | enum value |
const char * rodbus::to_string | ( | ParamError | value | ) |
convert an instance of enum ParamError into a C-style string
value | enum value |
const char * rodbus::to_string | ( | Parity | value | ) |
convert an instance of enum Parity into a C-style string
value | enum value |
const char * rodbus::to_string | ( | PhysDecodeLevel | value | ) |
convert an instance of enum PhysDecodeLevel into a C-style string
value | enum value |
const char * rodbus::to_string | ( | PortState | value | ) |
convert an instance of enum PortState into a C-style string
value | enum value |
const char * rodbus::to_string | ( | RequestError | value | ) |
convert an instance of enum RequestError into a C-style string
value | enum value |
const char * rodbus::to_string | ( | StopBits | value | ) |
convert an instance of enum StopBits into a C-style string
value | enum value |
const char * rodbus::to_string | ( | TimeFormat | value | ) |
convert an instance of enum TimeFormat into a C-style string
value | enum value |
|
constexpr |
major version number
|
constexpr |
minor version number
|
constexpr |
patch version number
|
constexpr |
version number as the string major.minor.patch