From 48174cc50f94bbedbe1bb177f03cbe4c206960a0 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Tue, 9 Feb 2021 10:56:40 +0100 Subject: [PATCH] hid_host: extend HID_SUBEVENT_SET_PROTOCOL_RESPONSE event with protocol_mode field --- src/btstack_defines.h | 3 ++- src/btstack_event.h | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/btstack_defines.h b/src/btstack_defines.h index 28fd97b31..4fc7a25ea 100644 --- a/src/btstack_defines.h +++ b/src/btstack_defines.h @@ -2947,10 +2947,11 @@ typedef uint8_t sm_key_t[16]; #define HID_SUBEVENT_GET_PROTOCOL_RESPONSE 0x0A /** - * @format 121 + * @format 1211 * @param subevent_code * @param hid_cid * @param handshake_status + * @param protocol_mode */ #define HID_SUBEVENT_SET_PROTOCOL_RESPONSE 0x0B diff --git a/src/btstack_event.h b/src/btstack_event.h index c3d252cfb..f6c1c90c8 100644 --- a/src/btstack_event.h +++ b/src/btstack_event.h @@ -8817,6 +8817,15 @@ static inline uint16_t hid_subevent_set_protocol_response_get_hid_cid(const uint static inline uint8_t hid_subevent_set_protocol_response_get_handshake_status(const uint8_t * event){ return event[5]; } +/** + * @brief Get field protocol_mode from event HID_SUBEVENT_SET_PROTOCOL_RESPONSE + * @param event packet + * @return protocol_mode + * @note: btstack_type 1 + */ +static inline uint8_t hid_subevent_set_protocol_response_get_protocol_mode(const uint8_t * event){ + return event[6]; +} /** * @brief Get field hid_cid from event HID_SUBEVENT_REPORT