gatt_client.c (c90e270f6cf7dbd8ffeae9160682f1ce4b2f8413) gatt_client.c (b15d5cea352319fdf3b15b46b4ab21d01e83091d)
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

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

707#else
708 log_error("HCI_INCOMING_PRE_BUFFER_SIZE >= 2 required for long characteristic reads");
709 return NULL;
710#endif
711}
712
713// test if notification/indication should be delivered to application (BLESA)
714static bool gatt_client_accept_server_message(hci_con_handle_t con_handle){
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

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

707#else
708 log_error("HCI_INCOMING_PRE_BUFFER_SIZE >= 2 required for long characteristic reads");
709 return NULL;
710#endif
711}
712
713// test if notification/indication should be delivered to application (BLESA)
714static bool gatt_client_accept_server_message(hci_con_handle_t con_handle){
715#ifdef ENABLE_LE_CENTRAL_AUTO_ENCRYPTION
716 // only check as Central
717 if (gap_get_role(con_handle) == HCI_ROLE_SLAVE) return true;
718
719 // ignore messages until re-encryption as central is complete
715#ifdef ENABLE_LE_PROACTIVE_AUTHENTICATION
716 // ignore messages until re-encryption is complete
720 if (gap_reconnect_security_setup_active(con_handle)) return false;
721
722 // after that ignore if bonded but not encrypted
723 return !gap_bonded(con_handle) || (gap_encryption_key_size(con_handle) > 0);
724#else
725 return true;
726#endif
727}

--- 1452 unchanged lines hidden ---
717 if (gap_reconnect_security_setup_active(con_handle)) return false;
718
719 // after that ignore if bonded but not encrypted
720 return !gap_bonded(con_handle) || (gap_encryption_key_size(con_handle) > 0);
721#else
722 return true;
723#endif
724}

--- 1452 unchanged lines hidden ---