I’m using mbed and UDP for the first time, and I’m running into quite a few issues (some to do with the example programs I’ve tried, others due to my own lack of knowledge on the subject).
First, the program UDPSocket_HelloWorld.cpp gives me warnings about the EthernetInterface and NetworkAPI libraries (I already added the mbed_rtos library to solve that specific error). It compiles and runs, but I get the same errors in the program “udp server example” from NegativeBlack’s Network API wiki, which leads me to think there’s something wrong with the libraries. The “udp server example” program also compiles and runs, but gets stuck at “int result = socket.receive(buffer);” and doesn’t run past that point. Any ideas?
I have also tried the EthernetTesterGood.cpp code from the website, but I get so many errors that it refuses to compile.
In terms of the UDP socket itself, I’m confused as to how to read and use the data that the mbed receives (or sends). For example, if I send a vector value to the mbed with UDP, how do I then read that vector and use it later on in the code? Or, I suppose, how do I extract the specific data that I need from the packet that the mbed receives?
Finally, is there a program floating around that I can use to check if the mbed is sending and receiving data properly? I have managed to use some other codes (UDPSocketExample.cpp from the SocketsAPI section of the Cookbook and the short code in the Ethernet section of the Handbook) successfully, but I’m not confident that they worked correctly. (the mbed reported an constant IP address and source value but a changing destination)
Thanks in advance for your help!
EDIT: Forgot to mention that I'm using two ethernet connections (one for the mbed and another for the computer) in a wireless router.
I’m using mbed and UDP for the first time, and I’m running into quite a few issues (some to do with the example programs I’ve tried, others due to my own lack of knowledge on the subject).
First, the program UDPSocket_HelloWorld.cpp gives me warnings about the EthernetInterface and NetworkAPI libraries (I already added the mbed_rtos library to solve that specific error). It compiles and runs, but I get the same errors in the program “udp server example” from NegativeBlack’s Network API wiki, which leads me to think there’s something wrong with the libraries. The “udp server example” program also compiles and runs, but gets stuck at “int result = socket.receive(buffer);” and doesn’t run past that point. Any ideas?
I have also tried the EthernetTesterGood.cpp code from the website, but I get so many errors that it refuses to compile.
In terms of the UDP socket itself, I’m confused as to how to read and use the data that the mbed receives (or sends). For example, if I send a vector value to the mbed with UDP, how do I then read that vector and use it later on in the code? Or, I suppose, how do I extract the specific data that I need from the packet that the mbed receives?
Finally, is there a program floating around that I can use to check if the mbed is sending and receiving data properly? I have managed to use some other codes (UDPSocketExample.cpp from the SocketsAPI section of the Cookbook and the short code in the Ethernet section of the Handbook) successfully, but I’m not confident that they worked correctly. (the mbed reported an constant IP address and source value but a changing destination)
Thanks in advance for your help!
EDIT: Forgot to mention that I'm using two ethernet connections (one for the mbed and another for the computer) in a wireless router.