modbus_server.c
void modbusServerDeinit(ModbusServerContext *context)
Release Modbus/TCP server context.
Definition: modbus_server.c:420
OsTaskId osCreateTask(const char_t *name, OsTaskCode taskCode, void *arg, const OsTaskParameters *params)
Create a task.
Definition: os_port_chibios.c:80
error_t socketBind(Socket *socket, const IpAddr *localIpAddr, uint16_t localPort)
Associate a local address with a socket.
Definition: socket.c:1316
error_t tlsInitTicketContext(TlsTicketContext *ticketContext)
Initialize ticket encryption context.
Definition: tls_ticket.c:49
void modbusServerCloseConnection(ModbusClientConnection *connection)
Close network connection.
Definition: modbus_server_transport.c:236
ModbusServerTlsInitCallback tlsInitCallback
TLS initialization callback function.
Definition: modbus_server.h:258
ModbusServerOpenCallback openCallback
TCP connection open callback function.
Definition: modbus_server.h:255
ModbusServerReadCoilCallback readDiscreteInputCallback
Get discrete input state callback function.
Definition: modbus_server.h:263
error_t modbusServerStop(ModbusServerContext *context)
Stop Modbus/TCP server.
Definition: modbus_server.c:261
void modbusServerGetDefaultSettings(ModbusServerSettings *settings)
Initialize settings with default values.
Definition: modbus_server.c:49
ModbusServerUnlockCallback unlockCallback
Unlock Modbus table callback function.
Definition: modbus_server.h:261
error_t modbusServerInit(ModbusServerContext *context, const ModbusServerSettings *settings)
Initialize Modbus/TCP server context.
Definition: modbus_server.c:108
ModbusServerReadRegCallback readHoldingRegCallback
Get holding register value callback function.
Definition: modbus_server.h:266
ModbusServerWriteCoilCallback writeCoilCallback
Set coil state callback function.
Definition: modbus_server.h:264
ModbusServerLockCallback lockCallback
Lock Modbus table callback function.
Definition: modbus_server.h:260
ModbusServerCloseCallback closeCallback
TCP connection close callback function.
Definition: modbus_server.h:256
void modbusServerProcessConnectionEvents(ModbusClientConnection *connection)
Connection event handler.
Definition: modbus_server_misc.c:174
ModbusServerReadCoilCallback readCoilCallback
Get coil state callback function.
Definition: modbus_server.h:262
Modbus/TCP server.
Helper functions for Modbus/TCP server.
ModbusServerProcessPduCallback processPduCallback
PDU processing callback function.
Definition: modbus_server.h:269
ModbusServerReadRegCallback readRegCallback
Get register value callback function.
Definition: modbus_server.h:265
Transport protocol abstraction layer.
void modbusServerAcceptConnection(ModbusServerContext *context)
Accept connection request.
Definition: modbus_server_transport.c:50
Socket * socketOpen(uint_t type, uint_t protocol)
Create a socket (UDP or TCP)
Definition: socket.c:125
void modbusServerRegisterConnectionEvents(ModbusClientConnection *connection, SocketEventDesc *eventDesc)
Register connection events.
Definition: modbus_server_misc.c:103
ModbusServerReadRegCallback readInputRegCallback
Get input register value callback function.
Definition: modbus_server.h:267
error_t socketPoll(SocketEventDesc *eventDesc, uint_t size, OsEvent *extEvent, systime_t timeout)
Wait for one of a set of sockets to become ready to perform I/O.
Definition: socket.c:2149
void modbusServerTask(ModbusServerContext *context)
Modbus/TCP server task.
Definition: modbus_server.c:314
void modbusServerTick(ModbusServerContext *context)
Handle periodic operations.
Definition: modbus_server_misc.c:51
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
ModbusServerWriteRegCallback writeRegCallback
Set register value callback function.
Definition: modbus_server.h:268
error_t modbusServerStart(ModbusServerContext *context)
Start Modbus/TCP server.
Definition: modbus_server.c:167
void tlsFreeTicketContext(TlsTicketContext *ticketContext)
Properly dispose ticket encryption context.
Definition: tls_ticket.c:448
error_t socketSetTimeout(Socket *socket, systime_t timeout)
Set timeout value for blocking operations.
Definition: socket.c:148
Debugging facilities.
error_t socketListen(Socket *socket, uint_t backlog)
Place a socket in the listening state.
Definition: socket.c:1413