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
Ethernet_sendUDP
-
- Posts: 9
- Joined: 17 Dec 2008 14:17
Re: Ethernet_sendUDP
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.
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
Hello,
can anyone share the code in which EThernet_SendUDP function will work?
can anyone share the code in which EThernet_SendUDP function will work?
-
- Posts: 158
- Joined: 24 May 2008 15:55
- Location: Germany
Re: Ethernet_sendUDP
Hi, perhaps you have no Ethernet_userTimerSec variable that your program has to increment every second? Look at help for the library under: "Important"