From 3e7db63e74a42b84edc4f9ae15e844dcbd61d951 Mon Sep 17 00:00:00 2001 From: vhaudiquet Date: Tue, 26 Sep 2023 22:15:14 +0200 Subject: [PATCH] driver: g-wolves image changes --- drivers/g-wolves/devices/hts_plus.h | 5 +++-- drivers/g-wolves/devices/htx.h | 1 + drivers/g-wolves/g-wolves.c | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/g-wolves/devices/hts_plus.h b/drivers/g-wolves/devices/hts_plus.h index a70cf05..09092ad 100644 --- a/drivers/g-wolves/devices/hts_plus.h +++ b/drivers/g-wolves/devices/hts_plus.h @@ -5,7 +5,8 @@ #define HTS_PLUS_4K_PRODUCT_ID_WIRELESS 0x5407 #define HTS_PLUS_4K_PRODUCT_NAME "HTS+ 4K" -#define HTS_DPI_MAX_VALUE 26000 -#define HTS_DPI_MAX_LEVEL_COUNT 5 +#define HTS_PLUS_IMAGE "gwolves-hts_plus.png" +#define HTS_PLUS_DPI_MAX_VALUE 26000 +#define HTS_PLUS_DPI_MAX_LEVEL_COUNT 5 #endif diff --git a/drivers/g-wolves/devices/htx.h b/drivers/g-wolves/devices/htx.h index de92a57..b7c8de6 100644 --- a/drivers/g-wolves/devices/htx.h +++ b/drivers/g-wolves/devices/htx.h @@ -5,6 +5,7 @@ #define HTX_4K_PRODUCT_ID_WIRELESS 0x5707 #define HTX_4K_PRODUCT_NAME "HTX 4K" +#define HTX_IMAGE "gwolves-htx.png" #define HTX_DPI_MAX_VALUE 26000 #define HTX_DPI_MAX_LEVEL_COUNT 5 diff --git a/drivers/g-wolves/g-wolves.c b/drivers/g-wolves/g-wolves.c index 372e3d2..ed9959c 100644 --- a/drivers/g-wolves/g-wolves.c +++ b/drivers/g-wolves/g-wolves.c @@ -97,5 +97,20 @@ char* driver_get_name(void* handle) char* driver_get_image(void* handle) { - return "drivers/assets/gwolves-htx.png"; + libusb_device* dev = handle; + + struct libusb_device_descriptor desc; + libusb_get_device_descriptor(dev, &desc); + + switch(desc.idProduct) + { + case HTX_4K_PRODUCT_ID_WIRED: + case HTX_4K_PRODUCT_ID_WIRELESS: + return HTX_IMAGE; + case HTS_PLUS_4K_PRODUCT_ID_WIRED: + case HTS_PLUS_4K_PRODUCT_ID_WIRELESS: + return HTS_PLUS_IMAGE; + default: + return ""; + } }