Whenever the USB device is plugged, the CHub::AttachDevice() will be called and all descriptors will be received in this function through the series of calls to GetDescriptor() function in various cases. We have to play with some functions in cdevice.cpp file.
#Driver usb20 camera pid_6242 driver#
Since we are using high speed EHCI host, we have cloned the corresponding USB Host driver from the \WINCE600\PUBLIC\COMMON\OAK\DRIVERS\USB\HCD\USB20\USB2COM directory to our BSP. Now we need to know where to add the SendNotifyMessage in USB Host driver. Here the UserData is the user defined structure we are using to pass the VID /PID and required data to application from driver. SendNotifyMessage(HWND_BROADCAST,WM_DEVICECHANGE, DBT_DEVICEREMOVECOMPLETE,(LPARAM)&UserData) SendNotifyMessage(HWND_BROADCAST,WM_DEVICECHANGE, DBT_DEVICEARRIVAL,(LPARAM)&UserData) We tried various messages and finally we succeed with the following message. We used SendNotifyMessage() API to broadcast the device information from the driver to application so that this will be received in WinProc which could be easy to handle.
#Driver usb20 camera pid_6242 Pc#
Since Windows CE is a customizable OS, we can play around the USB Host driver to support this feature up to an extend (Our case we need VID/PID and interface protocol information of HID devices).We planned the same way to retrieve the VID/PID information like PC application through WinProc Messages to avoid complexity. At the maximum we can retrieve the driver prefixes for the plugged/unplugged devices through some APIs. When a USB device is plugged or unplugged, Windows CE doesn’t not support applications to retrieve the Vendor ID and Product ID of USB devices directly using through APIs or WinProc Messages like PC. So we need to take some decision on the application which requires some unique ID(VID/PID) to identify the connected accessory. Even with their accessories they are introducing special featured accessories and expecting the device (application) to act accordingly for each accessory dynamically. Device has to respond only to their USB accessories, for example, Customer has designed their own USB HID device accessories for their devices and expected to respond only for their accessories. Every windows embedded developer knows that Windows CE is used for customized devices and some requirements demanded from the customers to restrict certain USB devices based on the Vendor ID (VID) or Product ID(PID).