gatt_client: add service/connection id to GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT

This commit is contained in:
Matthias Ringwald 2024-08-26 10:56:33 +02:00
parent 5a6c9e2aa2
commit d578995f60
3 changed files with 27 additions and 5 deletions

View File

@ -961,11 +961,13 @@ static void emit_gatt_service_query_result_event(gatt_client_t * gatt_client, ui
}
static void emit_gatt_included_service_query_result_event(gatt_client_t * gatt_client, uint16_t include_handle, uint16_t start_group_handle, uint16_t end_group_handle, const uint8_t * uuid128){
// @format HX
uint8_t packet[26];
// @format H22X
uint8_t packet[30];
hci_event_builder_context_t context;
hci_event_builder_init(&context, packet, sizeof(packet), GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT, 0);
hci_event_builder_add_con_handle(&context, gatt_client->con_handle);
hci_event_builder_add_16(&context, gatt_client->service_id);
hci_event_builder_add_16(&context, gatt_client->connection_id);
hci_event_builder_add_16(&context, include_handle);
hci_event_builder_add_16(&context, start_group_handle);
hci_event_builder_add_16(&context, end_group_handle);

View File

@ -1450,8 +1450,10 @@ typedef uint8_t sm_key_t[16];
#define GATT_EVENT_CHARACTERISTIC_QUERY_RESULT 0xA2u
/**
* @format H2X
* @format H222X
* @param handle
* @param service_id
* @param connection_id
* @param include_handle
* @param service
*/

View File

@ -2786,6 +2786,24 @@ static inline void gatt_event_characteristic_query_result_get_characteristic(con
static inline hci_con_handle_t gatt_event_included_service_query_result_get_handle(const uint8_t * event){
return little_endian_read_16(event, 2);
}
/**
* @brief Get field service_id from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
* @param event packet
* @return service_id
* @note: btstack_type 2
*/
static inline uint16_t gatt_event_included_service_query_result_get_service_id(const uint8_t * event){
return little_endian_read_16(event, 4);
}
/**
* @brief Get field connection_id from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
* @param event packet
* @return connection_id
* @note: btstack_type 2
*/
static inline uint16_t gatt_event_included_service_query_result_get_connection_id(const uint8_t * event){
return little_endian_read_16(event, 6);
}
/**
* @brief Get field include_handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
* @param event packet
@ -2793,7 +2811,7 @@ static inline hci_con_handle_t gatt_event_included_service_query_result_get_hand
* @note: btstack_type 2
*/
static inline uint16_t gatt_event_included_service_query_result_get_include_handle(const uint8_t * event){
return little_endian_read_16(event, 4);
return little_endian_read_16(event, 8);
}
/**
* @brief Get field service from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
@ -2802,7 +2820,7 @@ static inline uint16_t gatt_event_included_service_query_result_get_include_hand
* @note: btstack_type X
*/
static inline void gatt_event_included_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){
gatt_client_deserialize_service(event, 6, service);
gatt_client_deserialize_service(event, 10, service);
}
#endif