Typedefs | |
typedef eMBErrorCode(* | peMBPTCPClientConnectedCB )(xMBHandle xMBHdl, xMBPTCPClientHandle xTCPClientHdl) MB_CDECL_SUFFIX |
typedef eMBErrorCode(* | peMBPTCPClientNewDataCB )(xMBHandle xMBHdl, xMBPTCPClientHandle xTCPClientHdl) MB_CDECL_SUFFIX |
typedef eMBErrorCode(* | peMBPTCPClientDisconnectedCB )(xMBHandle xMBHdl, xMBPTCPClientHandle xTCPClientHdl) MB_CDECL_SUFFIX |
Functions | |
eMBErrorCode | eMBPTCPClientInit (xMBPTCPHandle *pxTCPHdl, xMBHandle xMBHdl, peMBPTCPClientNewDataCB eMBPTCPClientNewDATAFN, peMBPTCPClientDisconnectedCB eMBPTCPClientDisconnectedFN) |
eMBErrorCode | eMBPTCPClientClose (xMBPTCPHandle xTCPHdl) |
eMBErrorCode | eMBPTCPClientOpen (xMBPTCPHandle xTCPHdl, xMBPTCPClientHandle *pxTCPClientHdl, const CHAR *pcConnectAddress, USHORT usTCPPort) |
eMBErrorCode | eMBPTCPServerInit (xMBPTCPHandle *pxTCPHdl, CHAR *pcBindAddress, USHORT usTCPPort, xMBHandle xMBHdl, peMBPTCPClientNewDataCB eMBPTCPClientNewDataFN, peMBPTCPClientDisconnectedCB eMBPTCPClientDisconnectedFN, peMBPTCPClientConnectedCB eMBPTCPClientConnectedFN) |
eMBErrorCode | eMBTCPServerClose (xMBPTCPHandle xTCPHdl) |
eMBErrorCode | eMBPTCPConRead (xMBPTCPHandle xTCPHdl, xMBPTCPClientHandle xTCPClientHdl, UBYTE *pubBuffer, USHORT *pusBufferLen, USHORT usBufferMax) |
eMBErrorCode | eMBPTCPConWrite (xMBPTCPHandle xTCPHdl, xMBPTCPClientHandle xTCPClientHdl, const UBYTE *pubBuffer, USHORT usBufferLen) |
eMBErrorCode | eMBPTCPConClose (xMBPTCPHandle xTCPHdl, xMBPTCPClientHandle xTCPClientHdl) |
|
This function is called by the TCP porting layer when a new client connection is made. The stack will check if it can still handle more clients. This value is configured by the compile time configuration directive MBS_TCP_MAX_CLIENTS.
|
|
Called by the porting layer when a client has disconnected.
|
|
Called by the TCP porting layer when new data is available for a TCP client. This function shall be called by the porting layer when new data is available. It is important that the actual state, i.e. the availability of data is used for calling this function and not the event of receiving some data on a connection. On BSD socket like implementations using select with FD_READ is a proper way to do it. In case the TCP/IP stack uses event based semantics the data should be buffered by the porting layer and the function should be called.
|
|
Shutdown a TCP instance for handling client connections.
|
|
Create a new TCP instance for handling client connections.
|
|
Open a new client connection. The client connection can be used to read and write data. If the stack wants to transmit data it calls the function eMBPTCPWrite. If new data is available the porting layer executes the callback function eMBPTCPClientNewDataCB. The stack can then read the data by a call to the function eMBPTCPRead.
|
|
Close a TCP client connection. Called by the stack when a TCP client connection should be closed.
|
|
This function is called by the MODBUS stack when new data should be read from a client.
This function must not block and should read up to
|
|
This function is called by the MODBUS stack when new data should be sent over a client connection.
This function should not block and should transmit
|
|
Create a new listening server on address
The exact meaning of
|
|
Closes a server instance.
|