mirror of https://github.com/ARMmbed/mbed-os.git
SM fixes to init and register the event handler correctly
parent
9e98a72198
commit
6b0ba64ee2
|
|
@ -44,7 +44,7 @@ static const uint16_t advertising_interval_max = 0x4000;
|
|||
static const uint16_t supervision_timeout_min = 0x000A;
|
||||
static const uint16_t supervision_timeout_max = 0x0C80;
|
||||
|
||||
static const ConnectionParams_t default_connection_params = {
|
||||
static const Gap::ConnectionParams_t default_connection_params = {
|
||||
/* min conn interval */ 50,
|
||||
/* max conn interval */ 100,
|
||||
/* slave latency */ 0,
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ ble_error_t GenericSecurityManager::init(
|
|||
}
|
||||
|
||||
_connection_monitor.set_connection_event_handler(this);
|
||||
_pal.set_event_handler(this);
|
||||
|
||||
_pal.generate_public_key();
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ SecurityManager& BLE::getSecurityManager()
|
|||
const SecurityManager& BLE::getSecurityManager() const
|
||||
{
|
||||
static pal::MemorySecurityDb m_db;
|
||||
static pal::vendor::cordio::CordioSecurityManager m_pal;
|
||||
pal::vendor::cordio::CordioSecurityManager &m_pal = pal::vendor::cordio::CordioSecurityManager::get_security_manager();
|
||||
static generic::GenericSecurityManager m_instance(
|
||||
m_pal,
|
||||
m_db,
|
||||
|
|
@ -347,10 +347,8 @@ void BLE::stack_setup()
|
|||
DmSecInit();
|
||||
|
||||
// Note: enable once security is supported
|
||||
#if 0
|
||||
DmSecLescInit();
|
||||
DmPrivInit();
|
||||
#endif
|
||||
DmHandlerInit(handlerId);
|
||||
|
||||
handlerId = WsfOsSetNextHandler(L2cSlaveHandler);
|
||||
|
|
@ -374,6 +372,8 @@ void BLE::stack_setup()
|
|||
|
||||
stack_handler_id = WsfOsSetNextHandler(&BLE::stack_handler);
|
||||
|
||||
HciSetMaxRxAclLen(100);
|
||||
|
||||
DmRegister(BLE::device_manager_cb);
|
||||
DmConnRegister(DM_CLIENT_ID_APP, BLE::device_manager_cb);
|
||||
AttConnRegister(BLE::connection_handler);
|
||||
|
|
|
|||
|
|
@ -43,17 +43,17 @@ CordioSecurityManager::~CordioSecurityManager()
|
|||
|
||||
ble_error_t CordioSecurityManager::initialize()
|
||||
{
|
||||
return BLE_ERROR_NOT_IMPLEMENTED;
|
||||
return BLE_ERROR_NONE;
|
||||
}
|
||||
|
||||
ble_error_t CordioSecurityManager::terminate()
|
||||
{
|
||||
return BLE_ERROR_NOT_IMPLEMENTED;
|
||||
return BLE_ERROR_NONE;
|
||||
}
|
||||
|
||||
ble_error_t CordioSecurityManager::reset()
|
||||
{
|
||||
return BLE_ERROR_NOT_IMPLEMENTED;
|
||||
return BLE_ERROR_NONE;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Reference in New Issue