1
NXPTM LPC2XXX and LPC17XX / Receiving UDP packets at a rate of 10ms
« on: November 05, 2014, 02:26:01 PM »
Hi Mark,
I am facing a problem regarding the UDP reception.
So far I have been sending UDP data blocks periodically (from within the main loop) and have been receiving nonperiodic commands per UDP. That is all ok. Nothing to complain.
Now I created an additional socket to receive UDP data periodically from a sensor. The data is sent every 10ms, I could check that with WireShark. The problem is that the listener function is not called at the same interval. Instead it is called for instance 5 times every 100...200µs (1 data packet per call), but the next five data packets are delivered 50ms later. So 5 packets per 50ms is ok if one only looks at the amount of data. It seems that no data gets lost.
Obviously µTasker is optimizing how often the listener function is called.
This is how the socket is obtained:
scUdpMotionSocket = fnGetUDP_socket(TOS_MINIMISE_DELAY,
fnUdpMotionListener,
0
| UDP_OPT_CHECK_CS);
I thought that the parameter TOS_MINIMISE_DELAY might have something to do with the problem, but the function description says that this parameter is not used. (I am using µTasker V1.4.)
The problem is that I need actual data.
Is there a way to "persuade" µTasker to call that special listener function immediately when data is received, i.e. every 10ms?
Or even better, to call the listener on request. I only need the most recent data package. In that case it would not matter if 5 packets were sent as a group.
Kind regards,
Martin H.
I am facing a problem regarding the UDP reception.
So far I have been sending UDP data blocks periodically (from within the main loop) and have been receiving nonperiodic commands per UDP. That is all ok. Nothing to complain.
Now I created an additional socket to receive UDP data periodically from a sensor. The data is sent every 10ms, I could check that with WireShark. The problem is that the listener function is not called at the same interval. Instead it is called for instance 5 times every 100...200µs (1 data packet per call), but the next five data packets are delivered 50ms later. So 5 packets per 50ms is ok if one only looks at the amount of data. It seems that no data gets lost.
Obviously µTasker is optimizing how often the listener function is called.
This is how the socket is obtained:
scUdpMotionSocket = fnGetUDP_socket(TOS_MINIMISE_DELAY,
fnUdpMotionListener,
0
| UDP_OPT_CHECK_CS);
I thought that the parameter TOS_MINIMISE_DELAY might have something to do with the problem, but the function description says that this parameter is not used. (I am using µTasker V1.4.)
The problem is that I need actual data.
Is there a way to "persuade" µTasker to call that special listener function immediately when data is received, i.e. every 10ms?
Or even better, to call the listener on request. I only need the most recent data package. In that case it would not matter if 5 packets were sent as a group.
Kind regards,
Martin H.