Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNX / Posix timer usage in serial comms application: (2 Items)
   
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

Re: QNX / Posix timer usage in serial comms application  
Sorted - not a QNX problem - it appears to be an issue with the fast timer when running QNX in a virtual machine