diff --git a/src/hidpp10.c b/src/hidpp10.c index 0d572e14..c7e304b6 100644 --- a/src/hidpp10.c +++ b/src/hidpp10.c @@ -367,6 +367,22 @@ hidpp10_get_led_status(struct ratbag_device *device, struct hidpp10_device *dev) return 0; } +static int +hidpp10_get_optical_sensor_settings(struct ratbag_device *device, struct hidpp10_device *dev) +{ + unsigned idx = dev->index; + union hidpp10_message sensor = CMD_OPTICAL_SENSOR_SETTINGS(idx, GET_REGISTER_REQ); + int res; + + res = hidpp10_request_command(device, &sensor); + if (res) + return res; + + /* Don't know what the return value is here */ + + return 0; +} + static int hidpp10_get_device_info(struct ratbag_device *device, struct hidpp10_device *dev) { @@ -378,6 +394,7 @@ hidpp10_get_device_info(struct ratbag_device *device, struct hidpp10_device *dev hidpp10_get_current_resolution(device, dev); hidpp10_get_led_status(device, dev); + hidpp10_get_optical_sensor_settings(device, dev); return 0; } diff --git a/src/hidpp10.h b/src/hidpp10.h index e4545e61..afbfc21d 100644 --- a/src/hidpp10.h +++ b/src/hidpp10.h @@ -91,6 +91,8 @@ #define __CMD_CURRENT_RESOLUTION 0x63 +#define __CMD_OPTICAL_SENSOR_SETTINGS 0x61 + #define CMD_PAIRING_INFORMATION(idx, type) { \ .msg = { \ .report_id = REPORT_ID_SHORT, \ @@ -161,6 +163,16 @@ } \ } +#define CMD_OPTICAL_SENSOR_SETTINGS(idx, sub) { \ + .msg = { \ + .report_id = REPORT_ID_SHORT, \ + .device_idx = idx, \ + .sub_id = sub, \ + .address = __CMD_OPTICAL_SENSOR_SETTINGS, \ + .parameters = {0x00, 0x00, 0x00}, \ + } \ +} + #define ERR_SUCCESS 0x00 #define ERR_INVALID_SUBID 0x01 #define ERR_INVALID_ADDRESS 0x02