diff options
Diffstat (limited to 'hw/usb/hid-logitech-dj.h')
-rw-r--r-- | hw/usb/hid-logitech-dj.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/hw/usb/hid-logitech-dj.h b/hw/usb/hid-logitech-dj.h index 0ba7a5f61b..fae86b8d19 100644 --- a/hw/usb/hid-logitech-dj.h +++ b/hw/usb/hid-logitech-dj.h @@ -49,16 +49,26 @@ typedef struct { uint8_t report_id; uint8_t device_index; uint8_t sub_id; - uint8_t address; - uint8_t value[3]; + union { + uint8_t params[4]; + struct { + uint8_t address; + uint8_t value[3]; + }; /* for register queries */ + }; } HidppMsgShort; typedef struct { uint8_t report_id; uint8_t device_index; uint8_t sub_id; - uint8_t address; - uint8_t value[16]; + union { + uint8_t params[17]; + struct { + uint8_t address; + uint8_t value[16]; + }; /* for register queries */ + }; } HidppMsgLong; typedef struct { @@ -127,10 +137,8 @@ typedef struct { struct firmware_version version; } info; /* static information */ -#define REPORTING_FLAG_DEV_WIRELESS_NOTIFS 1 -#define REPORTING_FLAG_DEV_SOFTWARE_PRESENT (1 << 3) -#define REPORTING_FLAG_DEV_MASK (REPORTING_FLAG_WIRELESS_NOTIFS | \ - REPORTING_FLAG_SOFTWARE_PRESENT) +#define REPORTING_FLAG_DEV_BATTERY_STATUS (1 << 4) +#define REPORTING_FLAG_DEV_MASK REPORTING_FLAG_DEV_BATTERY_STATUS int reporting_flags; uint8_t activity_counter[MAX_DEVICES]; /* TODO: pairing lock open or closed (+ timeout) */ @@ -172,8 +180,10 @@ typedef struct { } mode; bool powered_on; uint8_t report_interval; -#define REPORTING_FLAG_RECV_BATTERY_STATUS (1 << 4) -#define REPORTING_FLAG_RECV_MASK REPORTING_FLAG_RECV_BATTERY_STATUS +#define REPORTING_FLAG_RCV_WIRELESS_NOTIFS 1 +#define REPORTING_FLAG_RCV_SOFTWARE_PRESENT (1 << 3) +#define REPORTING_FLAG_RCV_MASK (REPORTING_FLAG_RCV_WIRELESS_NOTIFS | \ + REPORTING_FLAG_RCV_SOFTWARE_PRESENT) int reporting_flags; /* TODO: status (device seen or not, encrypted link) */ |