Page 1 of 1

Ethernet_sendUDP

Posted: 11 May 2009 10:37
by joswaldjones
It seems that I can respond to a UDP packet by returning the required packet length from Ethernet_UserUDP but I've not been able to send a UDP packet via Ethernet_sendUDP.

In the example it shows this;

dim
IpAddr as byte[4] ' remote IP address
...
IpAddr[0] = 192
IpAddr[0] = 168
IpAddr[0] = 1
IpAddr[0] = 1
...
Ethernet_sendUDP(IpAddr, 10001, 10001, "Hello", 5) ' send Hello message to the above IP address, from UDP port 10001 to UDP port 10001


The IpAddr[0] repeated four times is clearly an error and it should show [0],[1],[2].. but when I try to compile this example I get this;
160:48 E-27 Incompatible types ( to ?277) http_demo.pbas

As shown in the forum by BarryP I can get around the error by doing this;

destIP[0] = 192
destIP[1] = 168
destIP[2] = 1
destIP[3] = 104
udpData="Jerome is great"
sourcePort = 10001
destPort = 10001
pktLen = strlen(udpData)
Ethernet_sendUDP(destIP, sourcePort, destPort, pkt, pktLen)


But I then don't see any packets being sent?

Any ideas?
Thanks,
Jerome

Posted: 11 May 2009 14:09
by joswaldjones
oops, change 'Ethernet_sendUDP(destIP, sourcePort, destPort, pkt, pktLen)' to Ethernet_sendUDP(destIP, sourcePort, destPort, @udpData, pktLen)

Thanks

FIXED

Posted: 11 May 2009 15:49
by joswaldjones
Please disregard.

Problem solved.

Re: Ethernet_sendUDP

Posted: 03 Dec 2020 18:49
by aparna k
Hi,

When i am using Ethernet_sendUDP function, data is not sending to the corresponding IP address and at that time, ping is not coming.
Please anyone guide me to solve this issue?
I am using IP address as 10.0.0.50 (10 series) not 192.168.1.124 (192 series). And i am testing the data in Hercules.

Please help me to solve this issue.

Thanks in Advance.

Re: Ethernet_sendUDP

Posted: 16 Dec 2020 06:00
by aparna k
Hello,
can anyone share the code in which EThernet_SendUDP function will work?

Re: Ethernet_sendUDP

Posted: 16 Dec 2020 12:02
by Thomas.Pahl@t-online.de
Hi, perhaps you have no Ethernet_userTimerSec variable that your program has to increment every second? Look at help for the library under: "Important"