Alan Braddy
|
QNX / Posix timer usage in serial comms application
|
Alan Braddy
08/01/2011 4:16 AM
post87723
|
QNX / Posix timer usage in serial comms application
Bit of a newbie question - I'm currently trying to port a comms task from another RTOS, the task requests data from a
remote device every 100mS, no problem with that - created a timer that sends an event to my (single) thread which then
write()s the request to the remote device. But...
I also need to provide a 4mS timeout between sending the last command byte and receiving the first data byte - i.e. if
the remote device doesn't respond within 4mS I need to cancel the read.
As I understand it I need to set up a timer that generates a signal which causes the read() to terminate, when I attempt
to do this (using a timer again, this time generating a USR1 signal) the 100mS timer also appears to complete.
Is there any way around this? Readcond() won't do the job as it only appears to allow 100mS timeout resolution, and
running a 4mS tick and calling the request routine every 25 ticks seems wasteful - any help would be appreciated
|
|
|