Skip to content

Commit

Permalink
Update README and help messages for commands
Browse files Browse the repository at this point in the history
Update text for the multiple HID backends.
  • Loading branch information
cvuchener committed Sep 20, 2017
1 parent 387ddf1 commit 64891cf
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 34 deletions.
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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).

Expand All @@ -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.

Expand All @@ -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.

2 changes: 1 addition & 1 deletion src/tools/hidpp-check-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp-list-features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void testRegister (HIDPP10::Device *dev, std::size_t register_size, uint8_t addr

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX";
static const char *args = "device_path";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;
bool do_write_tests = false;

Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp-mouse-resolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Operations20: public Operations

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX get|set dpi [y_dpi]";
static const char *args = "device_path get|set dpi [y_dpi]";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;
int sensor = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp-persistent-profiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using namespace tinyxml2;

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX read|write [file]";
static const char *args = "device_path read|write [file]";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

std::vector<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp10-active-profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern "C" {

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX current|load|load-default|load-address|reload";
static const char *args = "device_path current|load|load-default|load-address|reload";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

std::vector<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp10-dump-page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX page";
static const char *args = "device_path page";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

std::vector<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp10-load-temp-profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using HIDPP::Macro;

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX [file]";
static const char *args = "device_path [file]";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

std::vector<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp10-raw-command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX command read|write short|long [parameters...]";
static const char *args = "device_path command read|write short|long [parameters...]";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

std::vector<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp10-write-page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX";
static const char *args = "device_path page";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

std::vector<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp20-call-function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX feature_index function [parameters...]";
static const char *args = "device_path feature_index function [parameters...]";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

std::vector<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp20-dump-page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern "C" {

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX page";
static const char *args = "device_path page";
auto mem_type = HIDPP20::IOnboardProfiles::MemoryType::Writeable;
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp20-onboard-profiles-get-description.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp20-reprog-controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bool setFlag (Flag *flag, const char *optarg)

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX info|get|set [control_id] [remap_id]";
static const char *args = "device_path info|get|set [control_id] [remap_id]";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

Flag divert = NoChange, persist = NoChange, raw_xy = NoChange;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp20-write-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C" {

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX page offset";
static const char *args = "device_path page offset";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;

std::vector<Option> options = {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/hidpp20-write-page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C" {

int main (int argc, char *argv[])
{
static const char *args = "/dev/hidrawX page";
static const char *args = "device_path page";
HIDPP::DeviceIndex device_index = HIDPP::DefaultDevice;
bool add_crc = false;

Expand Down

0 comments on commit 64891cf

Please sign in to comment.