gatt_client.c (de5a18ca9aa7e79be8e7c9caadbe09117da9eb60) gatt_client.c (9da9850b83fde69f1dc00ad3fb029803b8844b54)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 693 unchanged lines hidden (view full) ---

702 if (gap_reconnect_security_setup_active(gatt_client->con_handle)) return false;
703
704 // after that ignore if bonded but not encrypted
705 return !gap_bonded(gatt_client->con_handle) || (gap_encryption_key_size(gatt_client->con_handle) > 0);
706}
707
708static void emit_event_new(btstack_packet_handler_t callback, uint8_t * packet, uint16_t size){
709 if (!callback) return;
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 693 unchanged lines hidden (view full) ---

702 if (gap_reconnect_security_setup_active(gatt_client->con_handle)) return false;
703
704 // after that ignore if bonded but not encrypted
705 return !gap_bonded(gatt_client->con_handle) || (gap_encryption_key_size(gatt_client->con_handle) > 0);
706}
707
708static void emit_event_new(btstack_packet_handler_t callback, uint8_t * packet, uint16_t size){
709 if (!callback) return;
710 hci_dump_packet(HCI_EVENT_PACKET, 1, packet, size);
710 hci_dump_btstack_event(packet, size);
711 (*callback)(HCI_EVENT_PACKET, 0, packet, size);
712}
713
714static void emit_event_to_registered_listeners(hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t * packet, uint16_t size){
715 btstack_linked_list_iterator_t it;
716 btstack_linked_list_iterator_init(&it, &gatt_client_value_listeners);
717 while (btstack_linked_list_iterator_has_next(&it)){
718 gatt_client_notification_t * notification = (gatt_client_notification_t*) btstack_linked_list_iterator_next(&it);

--- 2784 unchanged lines hidden ---
711 (*callback)(HCI_EVENT_PACKET, 0, packet, size);
712}
713
714static void emit_event_to_registered_listeners(hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t * packet, uint16_t size){
715 btstack_linked_list_iterator_t it;
716 btstack_linked_list_iterator_init(&it, &gatt_client_value_listeners);
717 while (btstack_linked_list_iterator_has_next(&it)){
718 gatt_client_notification_t * notification = (gatt_client_notification_t*) btstack_linked_list_iterator_next(&it);

--- 2784 unchanged lines hidden ---