use getters in HCI_EVENT_LE_META

This commit is contained in:
Milanka Ringwald 2016-04-01 16:28:01 +02:00
parent 3075c94867
commit 10cad10245
7 changed files with 8 additions and 8 deletions

View File

@ -230,7 +230,7 @@ static void hci_event_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa
break;
case HCI_EVENT_LE_META:
// 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;
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

View File

@ -191,7 +191,7 @@ static void handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
break;
case HCI_EVENT_LE_META:
// 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);
// query primary services
gatt_client_discover_primary_services(handle_gatt_client_event, connection_handler);

View File

@ -168,10 +168,10 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
le_notification_enabled = 0;
break;
case HCI_EVENT_LE_META:
switch (packet[2]) {
switch (hci_event_le_meta_get_subevent_code(packet)) {
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
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
// gap_request_connection_parameter_update(connection_handle, 0x10, 0x18, 0, 0x0048);
// printf("Connected, requesting conn param update for handle 0x%04x\n", connection_handle);

View File

@ -63,7 +63,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
}
break;
case HCI_EVENT_LE_META:
switch (packet[2]) {
switch (hci_event_le_meta_get_subevent_code(packet)) {
case HCI_SUBEVENT_LE_ADVERTISING_REPORT:
printf("\n- ADV: ");
printf_hexdump(packet, size);

View File

@ -61,7 +61,7 @@ static void handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *pac
}
case HCI_EVENT_LE_META:
// 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;
break;
case HCI_EVENT_DISCONNECTION_COMPLETE:

View File

@ -338,7 +338,7 @@ static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *
break;
case HCI_EVENT_LE_META:
switch (packet[2]) {
switch (hci_event_le_meta_get_subevent_code(packet)) {
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
handle = little_endian_read_16(packet, 4);
printf("Connection complete, handle 0x%04x\n", handle);

View File

@ -557,7 +557,7 @@ static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *
break;
case HCI_EVENT_LE_META:
switch (packet[2]) {
switch (hci_event_le_meta_get_subevent_code(packet)) {
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
advertisements_enabled = 0;
handle = little_endian_read_16(packet, 4);