Exemple #1
0
/**
 * UDPClientOpen - Create a UDP client on specified port, try more time for arp request.
 * \param udpaddr IP address of server
 * \param udpport Remote Port of UDP server
 * \return The number of current socket or 0 if an error occured during the opening of the socket.
 */
BYTE UDPClientOpen (char *udpaddr, char udpport[])
{			

	static NODE_INFO Server;
 	StringToIPAddress((BYTE*) udpaddr, &Server.IPAddr);
	ARPResolveMAC((char*) &(Server.IPAddr));
	if(ARPIsResolved(&Server.IPAddr, &Server.MACAddr))
		return UDPGenericOpen(0, &Server, udpport);
	else 
		return 0;
}
Exemple #2
0
/**
 * UDPClientOpen - Create a UDP client on specified port, try more time for arp request.
 * \param udpaddr IP address of server
 * \param udpport Remote Port of UDP server
 * \return The number of current socket or 0 if an error occured during the opening of the socket.
 */
BYTE UDPClientOpen (char *udpaddr, char udpport[])
{
    #if defined (FLYPORT)
	if (WFStatus != TURNED_OFF)
    #endif
	{
		static NODE_INFO Server;
		StringToIPAddress((BYTE*) udpaddr, &Server.IPAddr);
		ARPResolveMAC((char*) &(Server.IPAddr));
		vTaskDelay(30);
		if(ARPIsResolved(&Server.IPAddr, &Server.MACAddr))
			return UDPGenericOpen(0, &Server, udpport);
		else 
			return 0;
	}
	return 0;
}