Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Monitoring for the presence or absence of a device: (4 Items)
   
Monitoring for the presence or absence of a device  
I would like to be able to monitor the presence or absence of a device.

I would think that monitoring the dev name would be one method.

One can poll to see if the name exists or doesn't exist.

Is there a method, code pattern, or technique, that uses events instead of polling?

Does the HAM provide this capability?

Keith smith
AW: Monitoring for the presence or absence of a device  
you can register for changes in pathname space using
http://www.qnx.com/developers/docs/6.4.1/neutrino/lib_ref/p/procmgr_event_notify.html

but you won't get any information about the registered or unregistered name,
once you have received the change pulse  you still have to check for existance of the device,
and maybe loop back to receive the next pulse.

HTH
/hp

________________________________________
Von: Keith Smith [community-noreply@qnx.com]
Gesendet: Freitag, 22. Januar 2010 16:35
An: ostech-core_os
Betreff: Monitoring for the presence or absence of a device

I would like to be able to monitor the presence or absence of a device.

I would think that monitoring the dev name would be one method.

One can poll to see if the name exists or doesn't exist.

Is there a method, code pattern, or technique, that uses events instead of polling?

Does the HAM provide this capability?

Keith smith



_______________________________________________

OSTech
http://community.qnx.com/sf/go/post45776
Re: AW: Monitoring for the presence or absence of a device  
Thanks. Looks like it will do the trick.

Keith Smith
Re: Monitoring for the presence or absence of a device  
> I would like to be able to monitor the presence or absence of a device.

I'm not sure if it would be applicable to your situation, (eg how many devices you are monitoring, if they are the same 
or different types, what you want to do when a status change occurs, etc) but you could look into the 'mcd' server.  It 
monitors arbitrary pathnames via a number of builtin rules (including the PROCMGR_EVENT_PATHSPACE mentioned), can 
optionally run rules to test for certain content on the device (does it contain updates, graphics, audio, etc), and then
 arranges to notify client processes via standard QNX/POSIX mechanisms (including read, select, ionotify).  It should be
 documented.  So if you have some form of event-driven processing, it can make external device events available.  [One 
usage in 6.4.x is as part of the USB enumeration, detecting media insertion and then performing rule-based fsys mounts]