I have an application where I am reading sensor data from i2c and sending it to a computer via UDP, using the EnternetInterface and UDPSocket. The code is very simple, I started with the ECHO server example on the website and just extended it to keep sending packets with the sensor data.
I discovered quite quickly that it is necessary to throttle the packet rate when using UDPSocket, otherwise the send fails and I can't find a way to recover.
I recently discovered that the same thing happens if I send data at a relatively slow rate (about 20 packets per second), but it takes about 2 days for the failure to occur.
So, my question is, if the UDPSocket::sendTo() function fails with -1, how do I recover from that?
Also, is it possible to get more detailed information about what the error actually is? The mbed lib documentation doesn't mention error handling, and I can't find a way to access the errno from the lwip.
I have an application where I am reading sensor data from i2c and sending it to a computer via UDP, using the EnternetInterface and UDPSocket. The code is very simple, I started with the ECHO server example on the website and just extended it to keep sending packets with the sensor data.
I discovered quite quickly that it is necessary to throttle the packet rate when using UDPSocket, otherwise the send fails and I can't find a way to recover.
I recently discovered that the same thing happens if I send data at a relatively slow rate (about 20 packets per second), but it takes about 2 days for the failure to occur.
So, my question is, if the UDPSocket::sendTo() function fails with -1, how do I recover from that?
Also, is it possible to get more detailed information about what the error actually is? The mbed lib documentation doesn't mention error handling, and I can't find a way to access the errno from the lwip.