modbus_client.h
error_t modbusClientReadHoldingRegs(ModbusClientContext *context, uint16_t address, uint_t quantity, uint16_t *value)
Read holding registers.
Definition: modbus_client.c:415
error_t modbusClientInit(ModbusClientContext *context)
Initialize Modbus/TCP client context.
Definition: modbus_client.c:51
error_t modbusClientWriteSingleReg(ModbusClientContext *context, uint16_t address, uint16_t value)
Write single register.
Definition: modbus_client.c:611
error_t modbusClientConnect(ModbusClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort)
Establish connection with the Modbus/TCP server.
Definition: modbus_client.c:187
error_t modbusClientClose(ModbusClientContext *context)
Close the connection with the Modbus/TCP server.
Definition: modbus_client.c:1041
error_t modbusClientReadCoils(ModbusClientContext *context, uint16_t address, uint_t quantity, uint8_t *value)
Read coils.
Definition: modbus_client.c:279
error_t modbusClientBindToInterface(ModbusClientContext *context, NetInterface *interface)
Bind the Modbus/TCP client to a particular network interface.
Definition: modbus_client.c:164
error_t modbusClientReadInputRegs(ModbusClientContext *context, uint16_t address, uint_t quantity, uint16_t *value)
Read input registers.
Definition: modbus_client.c:483
General definitions for cryptographic algorithms.
error_t modbusClientMaskWriteReg(ModbusClientContext *context, uint16_t address, uint16_t andMask, uint16_t orMask)
Apply AND/OR bitmask to a register.
Definition: modbus_client.c:810
error_t modbusClientSetUnitId(ModbusClientContext *context, uint8_t unitId)
Set unit identifier.
Definition: modbus_client.c:143
error_t modbusClientWriteMultipleCoils(ModbusClientContext *context, uint16_t address, uint_t quantity, const uint8_t *value)
Write multiple coils.
Definition: modbus_client.c:673
error_t(* ModbusClientTlsInitCallback)(ModbusClientContext *context, TlsContext *tlsContext)
TLS initialization callback function.
Definition: modbus_client.h:117
void modbusClientDeinit(ModbusClientContext *context)
Release Modbus/TCP client context.
Definition: modbus_client.c:1062
Definitions common to Modbus/TCP client and server.
error_t modbusClientRegisterTlsInitCallback(ModbusClientContext *context, ModbusClientTlsInitCallback callback)
Register TLS initialization callback function.
Definition: modbus_client.c:98
error_t modbusClientWriteMultipleRegs(ModbusClientContext *context, uint16_t address, uint_t quantity, const uint16_t *value)
Write multiple registers.
Definition: modbus_client.c:741
TLS (Transport Layer Security)
ModbusClientTlsInitCallback tlsInitCallback
TLS initialization callback function.
Definition: modbus_client.h:137
error_t modbusClientReadWriteMultipleRegs(ModbusClientContext *context, uint16_t readAddress, uint_t readQuantity, uint16_t *readValue, uint16_t writeAddress, uint_t writeQuantity, const uint16_t *writeValue)
Read/write multiple registers.
Definition: modbus_client.c:877
error_t modbusClientWriteSingleCoil(ModbusClientContext *context, uint16_t address, bool_t value)
Write single coil.
Definition: modbus_client.c:550
TCP/IP stack core.
error_t modbusClientSetTimeout(ModbusClientContext *context, systime_t timeout)
Set timeout value for blocking operations.
Definition: modbus_client.c:122
error_t modbusClientDisconnect(ModbusClientContext *context)
Gracefully disconnect from the Modbus/TCP server.
Definition: modbus_client.c:964
error_t modbusClientReadDiscreteInputs(ModbusClientContext *context, uint16_t address, uint_t quantity, uint8_t *value)
Read discrete inputs.
Definition: modbus_client.c:347
error_t modbusClientGetExceptionCode(ModbusClientContext *context, ModbusExceptionCode *exceptionCode)
Retrieve exception code.
Definition: modbus_client.c:943