|
Instrument Neutral Distributed Interface INDI 2.2.5
|
#include <nanomodbus.h>
Public Attributes | |
| nmbs_transport | transport |
| int32_t(* | read )(uint8_t *buf, uint16_t count, int32_t byte_timeout_ms, void *arg) |
| int32_t(* | write )(const uint8_t *buf, uint16_t count, int32_t byte_timeout_ms, void *arg) |
| void * | arg |
nanoMODBUS platform configuration struct. Passed to nmbs_server_create() and nmbs_client_create().
read() and write() are the platform-specific methods that read/write data to/from a serial port or a TCP connection.
Both methods should block until either:
count bytes of data are read/writtenbyte_timeout_ms >= 0, expiresA value < 0 for byte_timeout_ms means no timeout.
Their return value should be the number of bytes actually read/written, or < 0 in case of error. A return value between 0 and count - 1 will be treated as if a timeout occurred on the transport side. All other values will be treated as transport errors.
These methods accept a pointer to arbitrary user-data, which is the arg member of this struct. After the creation of an instance it can be changed with nmbs_set_platform_arg().
Definition at line 145 of file nanomodbus.h.
| void* nmbs_platform_conf::arg |
User data, will be passed to functions above
Definition at line 151 of file nanomodbus.h.
| int32_t(* nmbs_platform_conf::read) (uint8_t *buf, uint16_t count, int32_t byte_timeout_ms, void *arg) |
Bytes read transport function pointer
Definition at line 147 of file nanomodbus.h.
| nmbs_transport nmbs_platform_conf::transport |
Transport type
Definition at line 146 of file nanomodbus.h.
| int32_t(* nmbs_platform_conf::write) (const uint8_t *buf, uint16_t count, int32_t byte_timeout_ms, void *arg) |
Bytes write transport function pointer
Definition at line 149 of file nanomodbus.h.