1.2.3.2.3 Library Interface

NameDescription
Macros
TCPIP_UDP_MAX_SOCKETSMaximum number of UDP sockets that can be opened simultaneously These sockets will be created when the module is initialized.
TCPIP_UDP_SOCKET_DEFAULT_RX_QUEUE_LIMITThe maximum number of RX packets that can be queued by an UDP socket at a certain time. Note that UDP sockets do not use their own RX buffers but instead use the network driver supplied packets and a timely processing is critical to avoid packet memory starvation for the whole stack. This symbol sets the maximum number of UDP buffers/packets that can be queued for a UDP socket at a certain time. Once this limit is reached further incoming packets are silently discarded. Adjust depending on the number of RX buffers that are available for the stack and the... more
TCPIP_UDP_SOCKET_DEFAULT_TX_QUEUE_LIMITThe maximum number of TX packets that can be queued by an UDP socket at a certain time. For sockets that need to transfer a lot of data (Iperf, for example), especially on slow connections this limit prevents running out of memory because the MAC/PHY transfer cannot keep up with the UDP packet allocation rate imposed by the application. Adjust depending on the TCPIP_UDP_SOCKET_DEFAULT_TX_SIZE, the connection speed and the amount of memory available to the stack.
TCPIP_UDP_SOCKET_DEFAULT_TX_SIZEDefault socket TX buffer size. Note that this setting affects all UDP sockets that are created and, together with TCPIP_UDP_MAX_SOCKETS, has a great impact on the heap size that's used by the stack (see TCPIP_STACK_DRAM_SIZE setting). When large TX bufferrs are needed, probably a dynamic, per socket approach, is a better choice (see TCPIP_UDP_OptionsSet function).
TCPIP_UDP_SOCKET_POOL_BUFFER_SIZESize of the buffers in the UDP pool. Any UDP socket that is enabled to use the pool and has the TX size <= than this size can use a buffer from the pool. Note that this setting, together with TCPIP_UDP_SOCKET_POOL_BUFFERS, has impact on the heap size that's used by the stack (see TCPIP_STACK_DRAM_SIZE setting).
TCPIP_UDP_SOCKET_POOL_BUFFERSNumber of buffers in the private UDP pool. These are preallocated buffers that are to be used by UDP sockets only. This improves the UDP socket throughput and is meant only for UDP sockets that have to sustain high TX traffic rate. However, this memory is not returned to the stack heap, it always belongs to UDP. A socket needs to have an option set in order to use the buffers pool (see the UDPSetOptions()). Use 0 to disable the feature.
TCPIP_UDP_USE_POOL_BUFFERSenable the build of the pre-allocated pool buffers option
TCPIP_UDP_USE_RX_CHECKSUMCheck incoming packets to have proper checksum.
TCPIP_UDP_USE_TX_CHECKSUMCalculate and transmit a checksum when sending data. Checksum is not mandatory for UDP packets but is highly recommended. This will affect the UDP TX performance.
TCPIP_UDP_COMMANDSTCPIP UDP info commands Enables/Disables the UDP command feature. This setting will add a UDP "info" command to the TCP/IP command menu allowing a run time inspection of the UDP sockets Set the value to 1 to enable, 0 to disable the feature.
TCPIP_UDP_EXTERN_PACKET_PROCESSThis setting enables/disables the processing of the RX packets by an external handler The user of the UDP can register an external function to process the incoming packets If true, the functionality is built in and could be used by the application If false, the functionality does not exist and the generated code is slightly smaller
Socket Management Functions
TCPIP_UDP_ServerOpenOpens a UDP socket as a server.
TCPIP_UDP_ClientOpenOpens a UDP socket as a client.
TCPIP_UDP_IsOpenedDetermines if a socket was opened.
TCPIP_UDP_IsConnectedDetermines if a socket has an established connection.
TCPIP_UDP_BindBind a socket to an address type, local port and address. This function is meant primarily for client sockets.
TCPIP_UDP_RemoteBindBind a socket to an address type, remote port and address. This function is meant primarily for server sockets.
TCPIP_UDP_CloseCloses a UDP socket and frees the handle.
TCPIP_UDP_OptionsGetAllows getting the options for a socket such as current RX/TX buffer size, etc.
TCPIP_UDP_OptionsSetAllows setting options to a socket like adjust RX/TX buffer size, etc
TCPIP_UDP_SocketInfoGetReturns information about a selected UDP socket.
TCPIP_UDP_SocketNetGetGets the network interface of an UDP socket
TCPIP_UDP_SocketNetSetSets the network interface for an UDP socket
TCPIP_UDP_TxOffsetSetMoves the pointer within the TX buffer.
TCPIP_UDP_SourceIPAddressSetSets the source IP address of a socket
TCPIP_UDP_BcastIPV4AddressSetSets the broadcast IP address of a socket Allows an UDP socket to send broadcasts.
TCPIP_UDP_DestinationIPAddressSetSets the destination IP address of a socket
TCPIP_UDP_DestinationPortSetSets the destination port of a socket
TCPIP_UDP_DisconnectDisconnects a UDP socket and re-initializes it.
TCPIP_UDP_SignalHandlerDeregisterDeregisters a previously registered UDP socket signal handler.
TCPIP_UDP_SignalHandlerRegisterRegisters a UDP socket signal handler.
TCPIP_UDP_TaskStandard TCP/IP stack module task function.
TCPIP_UDP_SocketsNumberGetReturns the number of existent UDP sockets.
TCPIP_UDP_PacketHandlerDeregisterDeregisters a previously registered packet handler.
TCPIP_UDP_PacketHandlerRegisterSets a new packet processing handler.
Transmit Data Transfer Functions
TCPIP_UDP_PutIsReadyDetermines how many bytes can be written to the UDP socket.
TCPIP_UDP_TxPutIsReadyDetermines how many bytes can be written to the UDP socket.
TCPIP_UDP_ArrayPutWrites an array of bytes to the UDP socket.
TCPIP_UDP_StringPutWrites a null-terminated string to the UDP socket.
TCPIP_UDP_PutWrites a byte to the UDP socket.
TCPIP_UDP_TxCountGetReturns the amount of bytes written into the UDP socket.
TCPIP_UDP_FlushTransmits all pending data in a UDP socket.
Receive Data Transfer Functions
TCPIP_UDP_GetIsReadyDetermines how many bytes can be read from the UDP socket.
TCPIP_UDP_ArrayGetReads an array of bytes from the UDP socket.
TCPIP_UDP_GetReads a byte from the UDP socket.
TCPIP_UDP_RxOffsetSetMoves the read pointer within the socket RX buffer.
TCPIP_UDP_DiscardDiscards any remaining RX data from a UDP socket.
Data Types and Constants
UDP_PORTDefines a type for a UDP port number
UDP_SOCKETProvides a handle to a UDP Socket
UDP_SOCKET_BCAST_TYPEUDP broadcast types.
UDP_SOCKET_INFOInformation about a UDP socket
UDP_SOCKET_OPTIONUDP socket options
INVALID_UDP_SOCKETIndicates a UDP socket that is not valid
TCPIP_UDP_MODULE_CONFIGUDP module run time configuration/initialization data.
TCPIP_UDP_SIGNAL_FUNCTIONUDP Signal Handler.
TCPIP_UDP_SIGNAL_HANDLEUDP socket handle.
TCPIP_UDP_SIGNAL_TYPEUDP run-time signal types.
UDP_MULTICAST_FLAGSUDP multicast options/flags.
UDP_OPTION_MULTICAST_DATAData structure used to set a socket multicast options.
TCPIP_UDP_PACKET_HANDLERPointer to a function(handler) that will get called to process an incoming UDP packet.
TCPIP_UDP_PROCESS_HANDLEDefines a UDP packet processing handle.