gatt_client: don't forward lower layer events to own clients

This commit is contained in:
Matthias Ringwald 2016-02-04 17:06:35 +01:00
parent dc98f6d35d
commit f3abff6765
2 changed files with 5 additions and 3 deletions

View File

@ -104,6 +104,8 @@ static uint8_t ancs_attribute_id;
static uint16_t ancs_attribute_len; static uint16_t ancs_attribute_len;
static void (*client_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size); static void (*client_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size);
static btstack_packet_callback_registration_t hci_event_callback_registration;
void ancs_client_register_callback(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)){ void ancs_client_register_callback(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)){
client_handler = handler; client_handler = handler;
} }
@ -353,5 +355,8 @@ static void handle_gatt_client_event(uint8_t packet_type, uint8_t *packet, uint1
} }
void ancs_client_init(void){ void ancs_client_init(void){
hci_event_callback_registration.callback = &handle_gatt_client_event;
hci_add_event_handler(&hci_event_callback_registration);
gc_id = gatt_client_register_packet_handler(&handle_gatt_client_event); gc_id = gatt_client_register_packet_handler(&handle_gatt_client_event);
} }

View File

@ -1054,9 +1054,6 @@ static void gatt_client_hci_event_packet_handler(uint8_t packet_type, uint8_t *p
break; break;
} }
// forward all hci events
emit_event_to_all_subclients_new(packet, size);
gatt_client_run(); gatt_client_run();
} }