From d9645c0e4b9dd3198b83ae1941cd376163338a06 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Sun, 11 Oct 2015 10:28:37 -0400 Subject: [PATCH] hidpp20: document the names of the features in gaming mice This patch adds nothing but some debug outputs and prepares the code to support the recent gaming mice from Logitech. Signed-off-by: Benjamin Tissoires --- src/driver-hidpp20.c | 16 ++++++++++++++++ src/hidpp20.c | 10 +++++++--- src/hidpp20.h | 24 ++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 3c515354..e11d0c0a 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -399,6 +399,22 @@ hidpp20drv_init_feature(struct ratbag_device *device, uint16_t feature) device->num_buttons = drv_data->num_controls; break; } + case HIDPP_PAGE_ADJUSTABLE_REPORT_RATE: { + log_debug(ratbag, "device has adjustable report rate\n"); + break; + } + case HIDPP_PAGE_COLOR_LED_EFFECTS: { + log_debug(ratbag, "device has color effects\n"); + break; + } + case HIDPP_PAGE_ONBOARD_PROFILES: { + log_debug(ratbag, "device has onboard profiles\n"); + break; + } + case HIDPP_PAGE_MOUSE_BUTTON_SPY: { + log_debug(ratbag, "device has configurable mouse button spy\n"); + break; + } default: log_raw(device->ratbag, "unknown feature 0x%04x\n", feature); } diff --git a/src/hidpp20.c b/src/hidpp20.c index 8be8aae4..d5c555cb 100644 --- a/src/hidpp20.c +++ b/src/hidpp20.c @@ -53,11 +53,15 @@ hidpp20_feature_get_name(uint16_t feature) CASE_RETURN_STRING(HIDPP_PAGE_ROOT); CASE_RETURN_STRING(HIDPP_PAGE_FEATURE_SET); CASE_RETURN_STRING(HIDPP_PAGE_DEVICE_INFO); - CASE_RETURN_STRING(HIDPP_PAGE_MOUSE_POINTER_BASIC); - CASE_RETURN_STRING(HIDPP_PAGE_ADJUSTABLE_DPI); - CASE_RETURN_STRING(HIDPP_PAGE_SPECIAL_KEYS_BUTTONS); CASE_RETURN_STRING(HIDPP_PAGE_BATTERY_LEVEL_STATUS); CASE_RETURN_STRING(HIDPP_PAGE_KBD_REPROGRAMMABLE_KEYS); + CASE_RETURN_STRING(HIDPP_PAGE_SPECIAL_KEYS_BUTTONS); + CASE_RETURN_STRING(HIDPP_PAGE_MOUSE_POINTER_BASIC); + CASE_RETURN_STRING(HIDPP_PAGE_ADJUSTABLE_DPI); + CASE_RETURN_STRING(HIDPP_PAGE_ADJUSTABLE_REPORT_RATE); + CASE_RETURN_STRING(HIDPP_PAGE_COLOR_LED_EFFECTS); + CASE_RETURN_STRING(HIDPP_PAGE_ONBOARD_PROFILES); + CASE_RETURN_STRING(HIDPP_PAGE_MOUSE_BUTTON_SPY); default: sprintf(numeric, "%#4x", feature); str = numeric; diff --git a/src/hidpp20.h b/src/hidpp20.h index e9a4d2ba..c66c7977 100644 --- a/src/hidpp20.h +++ b/src/hidpp20.h @@ -237,4 +237,28 @@ int hidpp20_adjustable_dpi_get_sensors(struct ratbag_device *device, int hidpp20_adjustable_dpi_set_sensor_dpi(struct ratbag_device *device, struct hidpp20_sensor *sensor, uint16_t dpi); +/* -------------------------------------------------------------------------- */ +/* 0x8060 - Adjustable Report Rate */ +/* -------------------------------------------------------------------------- */ + +#define HIDPP_PAGE_ADJUSTABLE_REPORT_RATE 0x8060 + +/* -------------------------------------------------------------------------- */ +/* 0x8070v4 - Color LED effects */ +/* -------------------------------------------------------------------------- */ + +#define HIDPP_PAGE_COLOR_LED_EFFECTS 0x8070 + +/* -------------------------------------------------------------------------- */ +/* 0x8100 - Onboard Profiles */ +/* -------------------------------------------------------------------------- */ + +#define HIDPP_PAGE_ONBOARD_PROFILES 0x8100 + +/* -------------------------------------------------------------------------- */ +/* 0x8110 - Mouse Button Spy */ +/* -------------------------------------------------------------------------- */ + +#define HIDPP_PAGE_MOUSE_BUTTON_SPY 0x8110 + #endif /* HIDPP_20_H */