gatt_client: use hci_event_builder for GATT_EVENT_QUERY_COMPLETE

This commit is contained in:
Matthias Ringwald 2024-08-26 10:25:49 +02:00
parent 3e78e462d5
commit 6a88036e0a

View File

@ -937,11 +937,11 @@ static void emit_event_to_registered_listeners(hci_con_handle_t con_handle, uint
static void emit_gatt_complete_event(gatt_client_t * gatt_client, uint8_t att_status){
// @format H1
uint8_t packet[5];
packet[0] = GATT_EVENT_QUERY_COMPLETE;
packet[1] = 3;
little_endian_store_16(packet, 2, gatt_client->con_handle);
packet[4] = att_status;
emit_event_new(gatt_client->callback, packet, sizeof(packet));
hci_event_builder_context_t context;
hci_event_builder_init(&context, packet, sizeof(packet), GATT_EVENT_QUERY_COMPLETE, 0);
hci_event_builder_add_con_handle(&context, gatt_client->con_handle);
hci_event_builder_add_08(&context, att_status);
emit_event_new(gatt_client->callback, packet, hci_event_builder_get_length(&context));
}
static void emit_gatt_service_query_result_event(gatt_client_t * gatt_client, uint16_t start_group_handle, uint16_t end_group_handle, const uint8_t * uuid128){