modbus_server_pdu.c
error_t modbusDumpRequestPdu(const void *pdu, size_t length)
Dump Modbus request PDU for debugging purpose.
Definition: modbus_debug.c:99
error_t modbusServerProcessReadDiscreteInputsReq(ModbusClientConnection *connection, const ModbusReadDiscreteInputsReq *request, size_t length)
Process Read Discrete Inputs request.
Definition: modbus_server_pdu.c:338
error_t modbusServerProcessReadCoilsReq(ModbusClientConnection *connection, const ModbusReadCoilsReq *request, size_t length)
Process Read Coils request.
Definition: modbus_server_pdu.c:240
void modbusServerLock(ModbusClientConnection *connection)
Lock Modbus table.
Definition: modbus_server_misc.c:502
error_t modbusDumpResponsePdu(const void *pdu, size_t length)
Dump Modbus response PDU for debugging purpose.
Definition: modbus_debug.c:212
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
error_t modbusServerProcessReadHoldingRegsReq(ModbusClientConnection *connection, const ModbusReadHoldingRegsReq *request, size_t length)
Process Read Holding Registers request.
Definition: modbus_server_pdu.c:436
@ MODBUS_FUNCTION_READ_DISCRETE_INPUTS
Definition: modbus_common.h:77
@ MODBUS_FUNCTION_READ_WRITE_MULTIPLE_REGS
Definition: modbus_common.h:92
ModbusExceptionCode modbusServerTranslateExceptionCode(error_t status)
Translate exception code.
Definition: modbus_server_misc.c:777
Modbus/TCP server.
@ MODBUS_FUNCTION_WRITE_MULTIPLE_REGS
Definition: modbus_common.h:87
error_t modbusServerProcessReadInputRegsReq(ModbusClientConnection *connection, const ModbusReadInputRegsReq *request, size_t length)
Process Read Input Registers request.
Definition: modbus_server_pdu.c:514
Helper functions for Modbus/TCP server.
error_t modbusServerProcessRequest(ModbusClientConnection *connection)
Process Modbus request.
Definition: modbus_server_pdu.c:51
error_t modbusServerProcessWriteMultipleCoilsReq(ModbusClientConnection *connection, const ModbusWriteMultipleCoilsReq *request, size_t length)
Process Write Multiple Coils request.
Definition: modbus_server_pdu.c:731
void * modbusServerGetRequestPdu(ModbusClientConnection *connection, size_t *length)
Retrieve request PDU.
Definition: modbus_server_misc.c:461
Data logging functions for debugging purpose (Modbus/TCP)
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 modbusServerProcessReadWriteMultipleRegsReq(ModbusClientConnection *connection, const ModbusReadWriteMultipleRegsReq *request, size_t length)
Process Read/Write Multiple Registers request.
Definition: modbus_server_pdu.c:1004
error_t modbusServerReadHoldingReg(ModbusClientConnection *connection, uint16_t address, uint16_t *value)
Read a single holding register.
Definition: modbus_server_misc.c:660
error_t modbusServerProcessWriteSingleCoilReq(ModbusClientConnection *connection, const ModbusWriteSingleCoilReq *request, size_t length)
Process Write Single Coil request.
Definition: modbus_server_pdu.c:592
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 modbusServerFormatExceptionResp(ModbusClientConnection *connection, ModbusFunctionCode functionCode, ModbusExceptionCode exceptionCode)
Format exception response.
Definition: modbus_server_pdu.c:1115
error_t modbusServerProcessWriteMultipleRegsReq(ModbusClientConnection *connection, const ModbusWriteMultipleRegsReq *request, size_t length)
Process Write Multiple Registers request.
Definition: modbus_server_pdu.c:828
@ MODBUS_FUNCTION_WRITE_MULTIPLE_COILS
Definition: modbus_common.h:86
error_t modbusServerProcessWriteSingleRegReq(ModbusClientConnection *connection, const ModbusWriteSingleRegReq *request, size_t length)
Process Write Single Register request.
Definition: modbus_server_pdu.c:669
Debugging facilities.
error_t modbusServerProcessMaskWriteRegReq(ModbusClientConnection *connection, const ModbusMaskWriteRegReq *request, size_t length)
Process Mask Write Register request.
Definition: modbus_server_pdu.c:926