Designer Reference Manual
USB08 Evaluation Board
148
Universal USB Device Driver (USBIO)
MOTOROLA
Universal USB Device Driver (USBIO)
E.4.4 Device State Change Notifications
The application is able to receive notifications when the state of an USB
device changes. The Win32 API provides the function
RegisterDeviceNotification
for this purpose. This way, an
application will be notified if an USB device is plugged in or removed.
Please refer to the Microsoft Platform SDK documentation for detailed
information on the functions
RegisterDeviceNotification
and
UnregisteredDeviceNotification
. In addition, the source code
of the USBIO demo application USBIOAPP provides an usage example.
The device notification mechanism is only available if the USBIO device
naming scheme is based on Device Interface IDs (GUIDs). See
for details. We strongly recommend to
use this new naming scheme.
NOTE:
The function
UnregisteredDeviceNotification
should not be
used on Windows 98. There is a bug in the implementation that causes
the system to become unstable. So it may crash at some later point in
time. The bug seems to be “well known”, it was discussed in some
Usenet groups.