Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title dev_read question
Ref. No. QNX.000009249
Category(ies) Development
Issue Suppose I do dev_read until buffer is drained and then a dev_read with proxy pid given. Then I go away and do other stuff.  Further, suppose I finish the other stuff before the proxy fires.  If I now do another dev_read with proxy arg of zero, will that cancel the prior proxy (and dev_read)? (Specifically concerned with Dev.ser for the moment but also would like the answer in general, if its different.)

My current thought is I should do:
  dev_arm(fd, proxy, _DEV_EVENT_INPUT);
before I go off to other stuff, then:
  dev_arm(fd, _DEV_DISARM, _DEV_EVENT_INPUT);
  dev_read(fd, yada, yada ...
when I get back.  Is this about right?
Solution Yes, that is correct.  Although, you might have a proxy pending when you do the disarm and it will still be there for you to Receive() even after you disarm.