mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
use getters in HCI_EVENT_LE_META
This commit is contained in:
parent
3075c94867
commit
10cad10245
@ -230,7 +230,7 @@ static void hci_event_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa
|
|||||||
break;
|
break;
|
||||||
case HCI_EVENT_LE_META:
|
case HCI_EVENT_LE_META:
|
||||||
// wait for connection complete
|
// wait for connection complete
|
||||||
if (packet[2] != HCI_SUBEVENT_LE_CONNECTION_COMPLETE) break;
|
if (hci_event_le_meta_get_subevent_code(packet) != HCI_SUBEVENT_LE_CONNECTION_COMPLETE) break;
|
||||||
if (state != TC_W4_CONNECT) return;
|
if (state != TC_W4_CONNECT) return;
|
||||||
connection_handle = hci_subevent_le_connection_complete_get_connection_handle(packet);
|
connection_handle = hci_subevent_le_connection_complete_get_connection_handle(packet);
|
||||||
// initialize gatt client context with handle, and add it to the list of active clients
|
// initialize gatt client context with handle, and add it to the list of active clients
|
||||||
|
@ -191,7 +191,7 @@ static void handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
|
|||||||
break;
|
break;
|
||||||
case HCI_EVENT_LE_META:
|
case HCI_EVENT_LE_META:
|
||||||
// wait for connection complete
|
// wait for connection complete
|
||||||
if (packet[2] != HCI_SUBEVENT_LE_CONNECTION_COMPLETE) break;
|
if (hci_event_le_meta_get_subevent_code(packet) != HCI_SUBEVENT_LE_CONNECTION_COMPLETE) break;
|
||||||
connection_handler = hci_subevent_le_connection_complete_get_connection_handle(packet);
|
connection_handler = hci_subevent_le_connection_complete_get_connection_handle(packet);
|
||||||
// query primary services
|
// query primary services
|
||||||
gatt_client_discover_primary_services(handle_gatt_client_event, connection_handler);
|
gatt_client_discover_primary_services(handle_gatt_client_event, connection_handler);
|
||||||
|
@ -168,10 +168,10 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
|||||||
le_notification_enabled = 0;
|
le_notification_enabled = 0;
|
||||||
break;
|
break;
|
||||||
case HCI_EVENT_LE_META:
|
case HCI_EVENT_LE_META:
|
||||||
switch (packet[2]) {
|
switch (hci_event_le_meta_get_subevent_code(packet)) {
|
||||||
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
||||||
test_data_len = ATT_DEFAULT_MTU - 3;
|
test_data_len = ATT_DEFAULT_MTU - 3;
|
||||||
connection_handle = little_endian_read_16(packet, 4);
|
connection_handle = hci_subevent_le_connection_complete_get_connection_handle(packet);
|
||||||
// min con interval 20 ms
|
// min con interval 20 ms
|
||||||
// gap_request_connection_parameter_update(connection_handle, 0x10, 0x18, 0, 0x0048);
|
// gap_request_connection_parameter_update(connection_handle, 0x10, 0x18, 0, 0x0048);
|
||||||
// printf("Connected, requesting conn param update for handle 0x%04x\n", connection_handle);
|
// printf("Connected, requesting conn param update for handle 0x%04x\n", connection_handle);
|
||||||
|
@ -63,7 +63,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HCI_EVENT_LE_META:
|
case HCI_EVENT_LE_META:
|
||||||
switch (packet[2]) {
|
switch (hci_event_le_meta_get_subevent_code(packet)) {
|
||||||
case HCI_SUBEVENT_LE_ADVERTISING_REPORT:
|
case HCI_SUBEVENT_LE_ADVERTISING_REPORT:
|
||||||
printf("\n- ADV: ");
|
printf("\n- ADV: ");
|
||||||
printf_hexdump(packet, size);
|
printf_hexdump(packet, size);
|
||||||
|
@ -61,7 +61,7 @@ static void handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
|
|||||||
}
|
}
|
||||||
case HCI_EVENT_LE_META:
|
case HCI_EVENT_LE_META:
|
||||||
// wait for connection complete
|
// wait for connection complete
|
||||||
if (packet[2] != HCI_SUBEVENT_LE_CONNECTION_COMPLETE) break;
|
if (hci_event_le_meta_get_subevent_code(packet) != HCI_SUBEVENT_LE_CONNECTION_COMPLETE) break;
|
||||||
connected = 1;
|
connected = 1;
|
||||||
break;
|
break;
|
||||||
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
case HCI_EVENT_DISCONNECTION_COMPLETE:
|
||||||
|
@ -338,7 +338,7 @@ static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_LE_META:
|
case HCI_EVENT_LE_META:
|
||||||
switch (packet[2]) {
|
switch (hci_event_le_meta_get_subevent_code(packet)) {
|
||||||
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
||||||
handle = little_endian_read_16(packet, 4);
|
handle = little_endian_read_16(packet, 4);
|
||||||
printf("Connection complete, handle 0x%04x\n", handle);
|
printf("Connection complete, handle 0x%04x\n", handle);
|
||||||
|
@ -557,7 +557,7 @@ static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_LE_META:
|
case HCI_EVENT_LE_META:
|
||||||
switch (packet[2]) {
|
switch (hci_event_le_meta_get_subevent_code(packet)) {
|
||||||
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
||||||
advertisements_enabled = 0;
|
advertisements_enabled = 0;
|
||||||
handle = little_endian_read_16(packet, 4);
|
handle = little_endian_read_16(packet, 4);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user