diff --git a/README.md b/README.md index 2692572..e63f150 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,13 @@ Documentation for HID++ 1.0 mice, can be found on [my G500 repository](https://g Building -------- -The library has no dependency except for C++14 standard library and Linux hidraw API. +Building requires a C++14 compiler and cmake. -`hidpp-list-devices` depends on **libudev**. Profile tools use **TinyXML2** for parsing and writing profiles. +The library can be built with different HID backend (using the `HID_BACKEND` cmake variable, default is set according the current operating system). + - `linux` uses Linux hidraw and **libudev**. + - `windows` uses Microsoft Windows HID API. + +Profile tools use **TinyXML2** for parsing and writing profiles. Use cmake to build the library and tools. @@ -34,11 +38,11 @@ Library and tools can be installed with `make install`. Commands -------- -Most commands use a hidraw device node for interacting with the device. For some wireless devices, you need to add a *device index* with the `-d` or `--device` in order to access the device instead of the receiver. Use `hidpp-list-devices` to discover plugged devices and their respective hidraw node and device index. +Most commands use a device path for interacting with the device. For some devices (wireless or older HID++ 1.0 devices), you need to add a *device index* with the `-d` or `--device` in order to access the device instead of the receiver. Use `hidpp-list-devices` to discover plugged devices and their respective device path and index. ### Check HID++ protocol - hidpp-check-device /dev/hidrawX + hidpp-check-device *device_path* This command print the protocol version of the device if it supports HID++. Otherwise it return a non-zero code. @@ -52,18 +56,18 @@ List every HID++ devices that can be opened (run as root if the device is not vi ### Discover HID++ features or registers - hidpp-list-features /dev/hidrawX + hidpp-list-features *device_path* List every feature or register available on the device. For HID++ 1.0, register are discovered by trying to read or write them, this command does not try writing unless the `-w` or `--write` options are given. ### Dump and write HID++ 1.0 device memory - hidpp10-dump-page /dev/hidrawX page + hidpp10-dump-page *device_path* *page* Dump the content of page *page* in the HID++ 1.0 device memory in stdout. - hidpp10-write-page /dev/hidrawX page + hidpp10-write-page *device_path* *page* Write the content of stdin in page *page* of the HID++ 1.0 device. @@ -72,11 +76,11 @@ Write the content of stdin in page *page* of the HID++ 1.0 device. Profiles are stored in XML format, see *profile_format.md* for details. - hidpp-persistent-profiles /dev/hidrawX read [file] + hidpp-persistent-profiles *device_path* read [*file*] Read the persistent profiles from the device and write them in XML format in *file* or stdout. - hidpp-persistent-profiles /dev/hidrawX write [file] + hidpp-persistent-profiles *device_path* write [*file*] Write the persistent profiles from the XML in *file* or stdin to the device. @@ -89,23 +93,23 @@ Supported devices: ### HID++ 1.0 profile management - hidpp10-load-temp-profile /dev/hidrawX [file] + hidpp10-load-temp-profile *device_path* [*file*] Write the profile from the XML in *file* or stdin to the device temporary memory and load it. - hidpp10-active-profile /dev/hidrawX current + hidpp10-active-profile *device_path* current Get the index of the current profile (or `default` if the factory default is loaded). - hidpp10-active-profile /dev/hidrawX load index + hidpp10-active-profile *device_path* load *index* Load the profile *index* from persistent memory. - hidpp10-active-profile /dev/hidrawX load-default + hidpp10-active-profile *device_path* load-default Load the factory default profile. - hidpp10-active-profile /dev/hidrawX load-address page [offset] + hidpp10-active-profile *device_path* load-address *page* [*offset*] Load the profile at the given address (default value for *offset* is 0). @@ -116,15 +120,15 @@ Reload the current profile from persistent memory (useful to get back to the las ### Changing mouse resolution - hidpp-mouse-resolution /dev/hidrawX get + hidpp-mouse-resolution *device_path* get Get the current resolution from the mouse. - hidpp-mouse-resolution /dev/hidrawX set x_dpi [y_dpi] + hidpp-mouse-resolution *device_path* set *x_dpi* [*y_dpi*] Set the current resolution for the mouse. If only one resolution is given, both axes use *x_dpi*. Some mice do not support per-axis resolution. - hidpp-mouse-resolution /dev/hidrawX info + hidpp-mouse-resolution *device_path* info Print informations about supported resolutions. @@ -133,14 +137,14 @@ Supported devices: G5, G9, G9x, G500, G500x, G700, G700s, HID++2.0 or later devi ### Advanced HID++ 1.0 commands - hidpp10-raw-command /dev/hidrawX command read|write short|long [parameters...] + hidpp10-raw-command *device_path* *command* read|write short|long [*parameters*...] Used for raw interaction with HID++ 1.0 register *command*. Parameters are hexadecimal and default are zeroes. ### Advanced HID++ 2.0 or later commands - hidpp20-call-function /dev/hidrawX feature_index function [parameters...] + hidpp20-call-function *device_path* *feature_index* *function* [*parameters*...] Call the low-level function given by `feature_index` and `function`. Parameters are hexadecimal and default are zeroes. diff --git a/src/tools/hidpp-check-device.cpp b/src/tools/hidpp-check-device.cpp index 48b25b8..98e8011 100644 --- a/src/tools/hidpp-check-device.cpp +++ b/src/tools/hidpp-check-device.cpp @@ -29,7 +29,7 @@ int main (int argc, char *argv[]) { - static const char *args = "/dev/hidrawX"; + static const char *args = "device_path"; HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice; std::vector