Change argument parsing to segregate options from the command
Add -dv -dp and -ds options to allow matching a vendor ID, device ID,
and/or device serial number.
Modify --list-keyboards to parse the DeviceInfo vector and output
information to stdout.
Signed-off-by: Kevin Pearson <pearson.kevin.m@gmail.com>
Allow filtration and matching of specified Device ID, Product ID, Serial
Number
Fix an issue in listKeyboards (hidapi) with an out of bounds search when
using serial number
Fix possible null reference problem in listKeyboards (hidapi) that
caused rare segfaults when traversing the device enumeration in
increments of two
Fix handling of output of listKeyboards (hidapi) where it was
incrementing the dev list pointer, then accessing the node to look for
device serial number (potential security risk)
Fix handling of serial number output of listKeyboards (hidapi) to handle
wchar_t instead of outputting the memory address
Fix issue in listKeyboards (libusb) failure to finish cleaning up USB
contexts, leading to a segfault if calling a separate function after
listing keyboards.
Fix issue in close (libusb) segfaulting if m_hidHandle was null, so
added a check.
Modify listKeyboards to provide a vector of DeviceInfo objects that can
be used by calling applications instead of outputting to stdout directly.
Implement a struct to hold information regarding device information and
ability for a library caller to query this information to make decisions
about the currently targeted device.
Signed-off-by: Kevin Pearson <pearson.kevin.m@gmail.com>
Currently supported:
- G213 by region {1..5}
- Standard FX calls
- Startup behavior
- Help and command-line app support
resolvesMatMoul/g810-led#69
Signed-off-by: Kevin Pearson <pearson.kevin.m@gmail.com>
Provide make targets and build configuration to create a shared object
for other systems/applications to use to control keyboard LEDs without
the need for instantiating the g810-led process.
Provide make targets for installing library and development files into
environments, such as the current system or package builders.
Currently preserves precious behavior of building g810-led binary as
statically linked. Provides an alternative build target of "bin-linked"
which will create a dynamically linked variant.
Signed-off-by: Kevin Pearson <pearson.kevin.m@gmail.com>