Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Record buffering when reading data from /dev/ser* issue: (1 Item)
   
Record buffering when reading data from /dev/ser* issue  
Perhaps someone can point out our error. Code snippets are attached.

In a forever loop we wait for messages/pulses. If a pulse that indicates serial data available is received, we call a 
receive routine that read()'s the data. We are using "ionotify (sio.serial_fd, _NOTIFY_ACTION_POLLARM, 
_NOTIFY_COND_INPUT, &sio.serial_event);" to determine if data are available, and arm the input.

Our issue is that frequently we get a pulse for which there is no data; more exactly, after the pulse, ionotify 
indicates data available but read() result is -1. Our program is a simple stand-alone test so we know of no "signal" 
involved.

ionotify also reports data available within a record though read() reports -1.

We are receiving 61 byte records at 115200KB,8,N,1 that have been sent  from an external device one every 250ms. We seem
 to not have data errors and have round trip times averaging about 250ms, but with max round trip of about 500 or 750ms 
after these errors.

The incident may not occur for hours, but when it does occur we get thousands of them (we suspect it no data is actually
 available but ionotify is hung until new data arrives).

We began this investigation because we have evidence that multiple serial messages are not delivered on a timely basis.

Attachment: Text serialExample.cc 4.94 KB