Defines | |
#define | MBP_UDPHDL_INVALID NULL |
#define | MBP_UDP_CLIENTADDR_COPY(source, dest) |
#define | MBP_UDP_CLIENTADDR_FREE(addr) |
Typedefs | |
typedef eMBErrorCode(* | peMBPUDPClientNewDataCB )(xMBHandle xMBHdl) MB_CDECL_SUFFIX |
typedef void * | xMBPUDPHandle |
Functions | |
eMBErrorCode | eMBPUDPClientInit (xMBPUDPHandle *pxUDPHdl, xMBHandle xMBHdl, const CHAR *pcUDPBindAddress, LONG uUDPListenPort, peMBPUDPClientNewDataCB eMBPUDPClientNewDATAFN) |
eMBErrorCode | eMBPUDPConWrite (xMBPUDPHandle xUDPHdl, const CHAR *pcUDPClientAddress, USHORT usUDPSlavePort, const UBYTE *pubBuffer, USHORT usBufferLen) |
eMBErrorCode | eMBPUDPConRead (xMBPUDPHandle xUDPHdl, UBYTE *pubBuffer, USHORT *pusBufferLen, USHORT usBufferMax) |
eMBErrorCode | eMBPUDPConReadExt (xMBPUDPHandle xUDPHdl, CHAR **pucClientAddress, USHORT *pusClientPort, UBYTE *pubBuffer, USHORT *pusBufferLen, USHORT usBufferMax) |
eMBErrorCode | eMBPUDPClientClose (xMBPUDPHandle xUDPHdl) |
|
Value: do { \ if( source != NULL ) \ { \ dest = strdup( source ); \ } \ else \ { \ dest = NULL; \ } \ } while( 0 ) You can either use strdup (default), an assigment or a custom function.
|
|
Value: do { \ free( addr ); \ addr = NULL; \ } while( 0 )
|
|
UDP porting layer invalid handle.
|
|
Called by the UDP porting layer when new data has been received.
|
|
UDP porting layer instance handle.
|
|
Shutdown a UDP instance for handling client connections. All resources for this instance should be freed. This includes closing all sockets and dropping any possibly remaining data.
|
|
Create a new UDP instance used by a MODBUS master.
This function should create two new sockets for sending and receiving data. If pcUDPBindAddress is not equal to
|
|
This function is called by the MODBUS after the porting layer has called the eMBPUDPClientNewDATAFN. This function shall return an entire UDP message in one call. This is a typical behaviour also for example for the Unix/OpenGroup recvfrom call for datagram sockets (http://pubs.opengroup.org/onlinepubs/009695399/functions/recvfrom.html)
|
|
This function is identical to eMBPUDPConRead with the exception that is stores the source address and the source port of the client from whom we have received the data.
|
|
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
|