116
CY4636 WirelessUSB™ LP Keyboard Mouse Reference Design Kit User Guide, Doc. # 001-70355 Rev. *A
A.7
Software Users Guide
A.7.1
Introduction
This section describes the software source code modules used in order to communicate with the
WirelessUSB LP bridge HID device to obtain the current radio parameters for the attached Wireles-
sUSB devices. It does not cover the details of the Microsoft Foundation Class (MFC) Library or the
HID Library that contains standard system-supplied routines that user-mode applications use to
communicate with USB devices that comply with the USB HID Standard. Refer to the Microsoft
Visual C++ documentation for more on MFC and HID Class concepts, in addition to the Device Class
Definition for Human Interface Devices (HID) defined by the USB Implementers Forum, Inc. (http://
www.usb.org/developers/hidpage).
A.7.2
Software Code Modules
There are three main modules contained in the WirelessUSB Software:
■
USB HID API module - generic class interface to HID Class compliant devices
■
System Tray module - generic class to create and control an icon on the system tray
■
WirelessUSB System Tray Application module - main system tray application module
The following sections describe the software module contents.
A.7.2.1
USB HID API module
The USB HID API module defines two classes, CHidDevice and CHidManager. The CHidDevice
class is the primary interface to a HID device, while the CHidManager class keeps track of the arrival
and removal of HID devices, along with notification to the application of such events. The building
blocks for the USB HID API module was derived from the HCLIENT sample code provided in the
Windows DDK. This module was designed to provide a generic interface to any HID Class compliant
device and is not expected to require any modification, however all source code is provided for refer-
ence.
Table A-10. CHidDeviceClass Methods
Method
Type
Description
OpenHidDevice()
Public
This method sets appropriate access rights, attempts to open a handle
to the HID device, obtains the top collection data, and makes a
call to setup input, output, and feature data buffers.
CloseHidDevice()
Public
This method closes the HID device handle, un-registers the HID device
notification, and frees pre-parsed data and data/report buffers.
RegisterHidDevice()
Public
This method registers the HID device handle for event notification
IsOpen()
Public
This method is used to report if a valid handle is open to the HID device.
IsOpenForRead()
Public
This method is used to report if the handle open to the HID device allows
for read access.
IsOpenForWrite()
Public
This method is used to report if the handle open to the HID device allows
for write access
IsOpenOverlapped()
Public
This method is used to report if the handle open to the HID device allows
for overlapped I/O.