From 8c459ced618e8003343162b88ac307b266fd1f50 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 11 Apr 2022 11:52:30 +0200 Subject: [PATCH] btstack_defines: add GOEP_SUBEVENT_INCOMING_CONNECTION --- src/btstack_defines.h | 14 +++++++++++--- src/btstack_event.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/btstack_defines.h b/src/btstack_defines.h index a84f40644..0bb365171 100644 --- a/src/btstack_defines.h +++ b/src/btstack_defines.h @@ -3373,6 +3373,14 @@ typedef uint8_t sm_key_t[16]; #define AVRCP_SUBEVENT_BROWSING_SET_BROWSED_PLAYER 0x36u +/** + * @format 12BH + * @param subevent_code + * @param goep_cid + * @param address + * @param handle + */ +#define GOEP_SUBEVENT_INCOMING_CONNECTION 0x01u /** * @format 121BH1 @@ -3383,21 +3391,21 @@ typedef uint8_t sm_key_t[16]; * @param con_handle * @param incoming */ -#define GOEP_SUBEVENT_CONNECTION_OPENED 0x01u +#define GOEP_SUBEVENT_CONNECTION_OPENED 0x02u /** * @format 12 * @param subevent_code * @param goep_cid */ -#define GOEP_SUBEVENT_CONNECTION_CLOSED 0x02u +#define GOEP_SUBEVENT_CONNECTION_CLOSED 0x03u /** * @format 12 * @param subevent_code * @param goep_cid */ -#define GOEP_SUBEVENT_CAN_SEND_NOW 0x03u +#define GOEP_SUBEVENT_CAN_SEND_NOW 0x04u /** * @format 121BH1 diff --git a/src/btstack_event.h b/src/btstack_event.h index 4e34b4969..ccad10cce 100644 --- a/src/btstack_event.h +++ b/src/btstack_event.h @@ -10762,6 +10762,34 @@ static inline uint16_t avrcp_subevent_browsing_set_browsed_player_get_player_id( return little_endian_read_16(event, 5); } +/** + * @brief Get field goep_cid from event GOEP_SUBEVENT_INCOMING_CONNECTION + * @param event packet + * @return goep_cid + * @note: btstack_type 2 + */ +static inline uint16_t goep_subevent_incoming_connection_get_goep_cid(const uint8_t * event){ + return little_endian_read_16(event, 3); +} +/** + * @brief Get field address from event GOEP_SUBEVENT_INCOMING_CONNECTION + * @param event packet + * @param Pointer to storage for address + * @note: btstack_type B + */ +static inline void goep_subevent_incoming_connection_get_address(const uint8_t * event, bd_addr_t address){ + reverse_bytes(&event[5], address, 6); +} +/** + * @brief Get field handle from event GOEP_SUBEVENT_INCOMING_CONNECTION + * @param event packet + * @return handle + * @note: btstack_type H + */ +static inline hci_con_handle_t goep_subevent_incoming_connection_get_handle(const uint8_t * event){ + return little_endian_read_16(event, 11); +} + /** * @brief Get field goep_cid from event GOEP_SUBEVENT_CONNECTION_OPENED * @param event packet