Instructions
263 C-Control Pro IDE
© 2013 Conrad Electronic
Description
Opens a TCP / IP connection to a port. The 32-bit value of the IP address can be calculated with the
macro IP_ADDR () from the accustomed notation: For example, IP_ADDR (192,168,1,1).
When returning from ETH_ConnectTCP the connection is not established directly. You have to
monitor the status of the connection with ETH_GetStateTCP.
Parameter
ip IP-Address
port UDP Port
Return Parameter
sock_id (Socket Index), ff (Hex) in case of error
5.11.5 ETH_CheckReceiveBuf
Ethernet Functions
Syntax
dword ETH_CheckReceiveBuf(word info[]);
Sub ETH_CheckReceiveBuf(ByRef info As Word) As ULong
Description
Checks whether packets are available in the receive buffer. If the return parameter is zero, no Ether-
net packets have been received. Is a package there, additional parameters are stored into the info ar-
ray. The info array (16-bit) should have a size of 4 words. If a UDP packet is received, the socket in-
dex (info [0]) is equal to ff (Hex).
One should be careful not to confuse the socket index (sock_idx) with the socket handle. The
lists commands (ListenTCP, CloseListenTCP etc.) work with the socket handle, the other with the
socket index.
Parameter
info
Return Parameter
IP address of the sender
0, when there are no packets in the buffer
Info Array