From 789cca88cec713851454000a3006410eb7c2e7cc Mon Sep 17 00:00:00 2001 From: Jacques Gagnon Date: Sun, 4 Feb 2024 20:02:16 -0500 Subject: [PATCH] [ADAPTER] Fix sign of 8 bits logical min & max in HID parser --- main/adapter/hid_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/adapter/hid_parser.c b/main/adapter/hid_parser.c index d7dcf062..ad4a4cca 100644 --- a/main/adapter/hid_parser.c +++ b/main/adapter/hid_parser.c @@ -299,7 +299,7 @@ void hid_parser(struct bt_data *bt_data, uint8_t *data, uint32_t len) { desc++; break; case HID_GI_LOGICAL_MIN(1): /* 0x15 */ - hid_stack[hid_stack_idx].logical_min = *desc++; + hid_stack[hid_stack_idx].logical_min = *(int8_t *)desc++; break; case HID_GI_LOGICAL_MIN(2): /* 0x16 */ hid_stack[hid_stack_idx].logical_min = *(int16_t *)desc; @@ -310,7 +310,7 @@ void hid_parser(struct bt_data *bt_data, uint8_t *data, uint32_t len) { desc += 4; break; case HID_GI_LOGICAL_MAX(1): /* 0x25 */ - hid_stack[hid_stack_idx].logical_max = *desc++; + hid_stack[hid_stack_idx].logical_max = *(int8_t *)desc++; break; case HID_GI_LOGICAL_MAX(2): /* 0x26 */ hid_stack[hid_stack_idx].logical_max = *(int16_t *)desc;