test
Fork of nRF51822 by
Diff: source/btle/btle_security.cpp
- Revision:
- 571:bbf6410b6a89
- Parent:
- 570:f162898cb6c4
- Child:
- 575:7023a8204a1b
--- a/source/btle/btle_security.cpp Mon Jan 11 10:19:21 2016 +0000 +++ b/source/btle/btle_security.cpp Mon Jan 11 10:19:22 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;