mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-29 21:32:38 +00:00
gatt_client: use hci_event_builder for GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
This commit is contained in:
parent
1cfd161321
commit
d8ef101d94
@ -959,16 +959,14 @@ 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];
|
||||
packet[0] = GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT;
|
||||
packet[1] = sizeof(packet) - 2u;
|
||||
little_endian_store_16(packet, 2, gatt_client->con_handle);
|
||||
///
|
||||
little_endian_store_16(packet, 4, include_handle);
|
||||
//
|
||||
little_endian_store_16(packet, 6, start_group_handle);
|
||||
little_endian_store_16(packet, 8, end_group_handle);
|
||||
reverse_128(uuid128, &packet[10]);
|
||||
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_INCLUDED_SERVICE_QUERY_RESULT, 0);
|
||||
hci_event_builder_add_con_handle(&context, gatt_client->con_handle);
|
||||
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);
|
||||
hci_event_builder_add_128(&context, uuid128);
|
||||
emit_event_new(gatt_client->callback, packet, hci_event_builder_get_length(&context));
|
||||
}
|
||||
|
||||
static void emit_gatt_characteristic_query_result_event(gatt_client_t * gatt_client, uint16_t start_handle, uint16_t value_handle, uint16_t end_handle,
|
||||
|
Loading…
x
Reference in New Issue
Block a user