mirror of
https://github.com/RfidResearchGroup/ChameleonUltra.git
synced 2026-09-11 18:30:14 -07:00
Fixed some bugs caused by closing pairing.
This commit is contained in:
@@ -783,9 +783,5 @@ void ble_slave_init(void) {
|
||||
services_init(); // Initialization of service characteristics
|
||||
advertising_init(); // Broadcast parameter initialization
|
||||
conn_params_init(); // Connection parameter initialization
|
||||
|
||||
// Pairing enable?
|
||||
if (settings_get_ble_pairing_enable_first_load()) {
|
||||
peer_manager_init(); // Peer manager Initialization
|
||||
}
|
||||
peer_manager_init(); // Peer manager Initialization
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "ble_conn_state.h"
|
||||
#include "peer_manager_internal.h"
|
||||
#include "nrf_sdh_ble.h"
|
||||
#include "settings.h"
|
||||
|
||||
#define NRF_LOG_MODULE_NAME peer_manager
|
||||
#if PM_LOG_ENABLED
|
||||
@@ -348,9 +349,13 @@ static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
|
||||
return;
|
||||
}
|
||||
|
||||
im_ble_evt_handler(p_ble_evt);
|
||||
sm_ble_evt_handler(p_ble_evt);
|
||||
gcm_ble_evt_handler(p_ble_evt);
|
||||
if (settings_get_ble_pairing_enable_first_load()) {
|
||||
im_ble_evt_handler(p_ble_evt);
|
||||
sm_ble_evt_handler(p_ble_evt);
|
||||
gcm_ble_evt_handler(p_ble_evt);
|
||||
} else {
|
||||
NRF_LOG_INFO("Pairing is disable, ignore ble event for peer manager.");
|
||||
}
|
||||
}
|
||||
|
||||
NRF_SDH_BLE_OBSERVER(m_ble_evt_observer, PM_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
|
||||
|
||||
Reference in New Issue
Block a user