modbus_server_misc.c
void modbusServerCloseConnection(ModbusClientConnection *connection)
Close network connection.
Definition: modbus_server_transport.c:236
@ MODBUS_CONNECTION_STATE_CONNECT_TLS
Definition: modbus_server.h:146
void modbusServerLock(ModbusClientConnection *connection)
Lock Modbus table.
Definition: modbus_server_misc.c:502
Modbus/TCP security layer.
error_t modbusServerWriteCoil(ModbusClientConnection *connection, uint16_t address, bool_t state, bool_t commit)
Write a single coil.
Definition: modbus_server_misc.c:625
error_t modbusServerFormatMbapHeader(ModbusClientConnection *connection, size_t length)
Format response MBAP header.
Definition: modbus_server_misc.c:410
void modbusServerUnlock(ModbusClientConnection *connection)
Unlock Modbus table.
Definition: modbus_server_misc.c:523
error_t modbusServerReadDiscreteInput(ModbusClientConnection *connection, uint16_t address, bool_t *state)
Read a single discrete input.
Definition: modbus_server_misc.c:582
error_t modbusServerReadInputReg(ModbusClientConnection *connection, uint16_t address, uint16_t *value)
Read a single input register.
Definition: modbus_server_misc.c:701
@ MODBUS_CONNECTION_STATE_SHUTDOWN_TLS
Definition: modbus_server.h:149
error_t modbusServerParseMbapHeader(ModbusClientConnection *connection)
Parse request MBAP header.
Definition: modbus_server_misc.c:352
void modbusServerProcessConnectionEvents(ModbusClientConnection *connection)
Connection event handler.
Definition: modbus_server_misc.c:174
@ MODBUS_EXCEPTION_SLAVE_DEVICE_FAILURE
Definition: modbus_common.h:107
ModbusExceptionCode modbusServerTranslateExceptionCode(error_t status)
Translate exception code.
Definition: modbus_server_misc.c:777
Modbus/TCP server.
@ MODBUS_CONNECTION_STATE_SHUTDOWN_RX
Definition: modbus_server.h:151
Helper functions for Modbus/TCP server.
bool_t tlsIsTxReady(TlsContext *context)
Check whether some data is ready for transmission.
Definition: tls.c:2228
Transport protocol abstraction layer.
@ MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS
Definition: modbus_common.h:105
@ MODBUS_EXCEPTION_SLAVE_DEVICE_BUSY
Definition: modbus_common.h:109
error_t modbusServerShutdownConnection(ModbusClientConnection *connection)
Shutdown network connection.
Definition: modbus_server_transport.c:168
void modbusServerRegisterConnectionEvents(ModbusClientConnection *connection, SocketEventDesc *eventDesc)
Register connection events.
Definition: modbus_server_misc.c:103
error_t modbusServerReceiveData(ModbusClientConnection *connection, void *data, size_t size, size_t *received, uint_t flags)
Receive data using the relevant transport protocol.
Definition: modbus_server_transport.c:318
error_t modbusServerProcessRequest(ModbusClientConnection *connection)
Process Modbus request.
Definition: modbus_server_pdu.c:51
bool_t tlsIsRxReady(TlsContext *context)
Check whether some data is available in the receive buffer.
Definition: tls.c:2262
error_t modbusServerSendData(ModbusClientConnection *connection, const void *data, size_t length, size_t *written, uint_t flags)
Send data using the relevant transport protocol.
Definition: modbus_server_transport.c:284
void * modbusServerGetRequestPdu(ModbusClientConnection *connection, size_t *length)
Retrieve request PDU.
Definition: modbus_server_misc.c:461
error_t modbusServerWriteReg(ModbusClientConnection *connection, uint16_t address, uint16_t value, bool_t commit)
Write a single register.
Definition: modbus_server_misc.c:744
error_t modbusServerReadHoldingReg(ModbusClientConnection *connection, uint16_t address, uint16_t *value)
Read a single holding register.
Definition: modbus_server_misc.c:660
void modbusServerTick(ModbusServerContext *context)
Handle periodic operations.
Definition: modbus_server_misc.c:51
void * modbusServerGetResponsePdu(ModbusClientConnection *connection)
Retrieve response PDU.
Definition: modbus_server_misc.c:490
error_t modbusServerReadCoil(ModbusClientConnection *connection, uint16_t address, bool_t *state)
Read a single coil.
Definition: modbus_server_misc.c:547
Modbus PDU processing.
error_t modbusServerEstablishSecureConnection(ModbusClientConnection *connection)
Establish secure connection.
Definition: modbus_server_security.c:234
@ MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE
Definition: modbus_common.h:106
@ MODBUS_CONNECTION_STATE_SHUTDOWN_TX
Definition: modbus_server.h:150
Debugging facilities.