nordic
Fork of nRF51822 by
Diff: source/btle/btle_security.cpp
- Revision:
- 567:e425ad9e5d6e
- Parent:
- 566:cf03471a4ec4
- Child:
- 571:f162898cb6c4
--- a/source/btle/btle_security.cpp Mon Jan 11 10:19:18 2016 +0000 +++ b/source/btle/btle_security.cpp Mon Jan 11 10:19:18 2016 +0000 @@ -16,7 +16,8 @@ #include "btle.h" -#include "nRF5xn.h" +#include "nRF5xGap.h" +#include "nRF5xSecurityManager.h" extern "C" { #include "pstorage.h" @@ -203,20 +204,17 @@ ret_code_t dm_handler(dm_handle_t const *p_handle, dm_event_t const *p_event, ret_code_t event_result) { - nRF5xn &ble = nRF5xn::Instance(BLE::DEFAULT_INSTANCE); - nRF5xSecurityManager &securityManager = (nRF5xSecurityManager &) ble.getSecurityManager(); - switch (p_event->event_id) { case DM_EVT_SECURITY_SETUP: /* started */ { const ble_gap_sec_params_t *peerParams = &p_event->event_param.p_gap_param->params.sec_params_request.peer_params; - securityManager.processSecuritySetupInitiatedEvent(p_event->event_param.p_gap_param->conn_handle, + nRF5xSecurityManager::getInstance().processSecuritySetupInitiatedEvent(p_event->event_param.p_gap_param->conn_handle, peerParams->bond, peerParams->mitm, (SecurityManager::SecurityIOCapabilities_t)peerParams->io_caps); break; } case DM_EVT_SECURITY_SETUP_COMPLETE: - securityManager. + nRF5xSecurityManager::getInstance(). processSecuritySetupCompletedEvent(p_event->event_param.p_gap_param->conn_handle, (SecurityManager::SecurityCompletionStatus_t)(p_event->event_param.p_gap_param->params.auth_status.auth_status)); break; @@ -250,11 +248,11 @@ break; } - securityManager.processLinkSecuredEvent(p_event->event_param.p_gap_param->conn_handle, resolvedSecurityMode); + nRF5xSecurityManager::getInstance().processLinkSecuredEvent(p_event->event_param.p_gap_param->conn_handle, resolvedSecurityMode); break; } case DM_EVT_DEVICE_CONTEXT_STORED: - securityManager.processSecurityContextStoredEvent(p_event->event_param.p_gap_param->conn_handle); + nRF5xSecurityManager::getInstance().processSecurityContextStoredEvent(p_event->event_param.p_gap_param->conn_handle); break; default: break;