Hans-Peter Reichert
|
AW: Monitoring for the presence or absence of a device
|
Hans-Peter Reichert
01/22/2010 10:45 AM
post45778
|
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
|
|
|
John Garvey
|
Re: Monitoring for the presence or absence of a device
|
John Garvey
01/22/2010 2:16 PM
post45802
|
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]
|
|
|