CYKUSHXSDevice v1.0
This open source C++ class provides a simple RAII wrapper for programming to the
YEPKIT YKUSH XS
Switchable USB Hub using the HID API on Windows.
This device allows you to programmatically switch a USB device on or off remotely using
software.
Features
- Provides a simple C++ Header only wrapper for the YEPKIT YKUSH XS
Switchable USB Hub.
- Provides a RAII wrapper for the HANDLE returned from the CreateFile call when opening a
HID device.
- The class provides an Enumerate method which enumerates all YKUSH XS
devices on the local computer, a "PortDown" method to turn the downstream
port Off, a "PortUp" method to turn the downstream port On and a
"PortStatus" method to check if the port is currently On or Off.
Usage
- To use the HID class in your project simply #include
YKUSHWrappers.h in your application.
- You will also need to download the HIDWrappers code separately from
http://www.naughter.com/hidwrappers.html.
This codes encapsulates the Windows HID API functionality and the
CYKUSHXSDevice class derives from the HIDWrappers "HID::CDevice" class.
- The code is only supported on VC 2019 or later.
- Included in the download is a VC 2019 console based test application which
exercises all of the various functionality. If the sample app detects that
you have an YKUSH XS device attached to your computer, then it
will initialize the device and test out the PostStatus, PortUp and PortDown
methods of the wrapper class.
Copyright
- You are allowed to include the source code in any product (commercial, shareware,
freeware or otherwise) when your product is released in binary form.
- You are allowed to modify the source code in any way you want except you
cannot modify the copyright details at the top of each module.
- If you want to distribute source code with your application, then you are
only allowed to distribute versions released by the author. This is to maintain
a single distribution point for the source code.
History
v1.0 (30 December 2020)
Contacting the Author
PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
30
December 2020