mirror of https://github.com/ARMmbed/mbed-os.git
feat(ble): Guard out the CordioBLE initialisation code
parent
72d28d920a
commit
8e36ed4b1e
|
@ -377,6 +377,8 @@ void BLE::stack_setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
WsfTimerInit();
|
WsfTimerInit();
|
||||||
|
|
||||||
|
#if BLE_ROLE_SECURITY
|
||||||
SecInit();
|
SecInit();
|
||||||
|
|
||||||
// Note: enable once security is supported
|
// Note: enable once security is supported
|
||||||
|
@ -384,22 +386,49 @@ void BLE::stack_setup()
|
||||||
SecAesInit();
|
SecAesInit();
|
||||||
SecCmacInit();
|
SecCmacInit();
|
||||||
SecEccInit();
|
SecEccInit();
|
||||||
|
#endif // BLE_ROLE_SECURITY
|
||||||
|
|
||||||
handlerId = WsfOsSetNextHandler(HciHandler);
|
handlerId = WsfOsSetNextHandler(HciHandler);
|
||||||
HciHandlerInit(handlerId);
|
HciHandlerInit(handlerId);
|
||||||
|
|
||||||
handlerId = WsfOsSetNextHandler(DmHandler);
|
handlerId = WsfOsSetNextHandler(DmHandler);
|
||||||
|
|
||||||
|
#if BLE_ROLE_BROADCASTER
|
||||||
DmAdvInit();
|
DmAdvInit();
|
||||||
|
#endif // BLE_ROLE_BROADCASTER
|
||||||
|
|
||||||
|
#if BLE_ROLE_OBSERVER
|
||||||
DmScanInit();
|
DmScanInit();
|
||||||
|
#endif // BLE_ROLE_OBSERVER
|
||||||
|
|
||||||
|
#if (BLE_ROLE_CENTRAL || BLE_ROLE_PERIPHERAL)
|
||||||
DmConnInit();
|
DmConnInit();
|
||||||
|
#endif // (BLE_ROLE_CENTRAL || BLE_ROLE_PERIPHERAL)
|
||||||
|
|
||||||
|
#if BLE_ROLE_CENTRAL
|
||||||
DmConnMasterInit();
|
DmConnMasterInit();
|
||||||
|
#endif // BLE_ROLE_CENTRAL
|
||||||
|
|
||||||
|
#if BLE_ROLE_PERIPHERAL
|
||||||
DmConnSlaveInit();
|
DmConnSlaveInit();
|
||||||
|
#endif // BLE_ROLE_PERIPHERAL
|
||||||
|
|
||||||
|
#if BLE_ROLE_SECURITY
|
||||||
DmSecInit();
|
DmSecInit();
|
||||||
|
#endif // BLE_ROLE_SECURITY
|
||||||
|
|
||||||
DmPhyInit();
|
DmPhyInit();
|
||||||
|
|
||||||
// Note: enable once security is supported
|
// Note: enable once security is supported
|
||||||
|
|
||||||
|
#if BLE_ROLE_SECURITY
|
||||||
DmSecLescInit();
|
DmSecLescInit();
|
||||||
|
#endif // BLE_ROLE_SECURITY
|
||||||
|
|
||||||
|
#if BLE_ROLE_PRIVACY
|
||||||
DmPrivInit();
|
DmPrivInit();
|
||||||
|
#endif // BLE_ROLE_PRIVACY
|
||||||
|
|
||||||
DmHandlerInit(handlerId);
|
DmHandlerInit(handlerId);
|
||||||
|
|
||||||
handlerId = WsfOsSetNextHandler(L2cSlaveHandler);
|
handlerId = WsfOsSetNextHandler(L2cSlaveHandler);
|
||||||
|
@ -408,16 +437,16 @@ void BLE::stack_setup()
|
||||||
L2cSlaveInit();
|
L2cSlaveInit();
|
||||||
L2cMasterInit();
|
L2cMasterInit();
|
||||||
|
|
||||||
|
#if BLE_ROLE_GATT_SERVER
|
||||||
handlerId = WsfOsSetNextHandler(AttHandler);
|
handlerId = WsfOsSetNextHandler(AttHandler);
|
||||||
AttHandlerInit(handlerId);
|
AttHandlerInit(handlerId);
|
||||||
AttsInit();
|
AttsInit();
|
||||||
AttsIndInit();
|
AttsIndInit();
|
||||||
AttsSignInit();
|
AttsSignInit();
|
||||||
#if BLE_ROLE_GATT_SERVER
|
|
||||||
AttsAuthorRegister(GattServer::atts_auth_cb);
|
AttsAuthorRegister(GattServer::atts_auth_cb);
|
||||||
#endif // BLE_ROLE_GATT_SERVER
|
|
||||||
AttcInit();
|
AttcInit();
|
||||||
AttcSignInit();
|
AttcSignInit();
|
||||||
|
#endif // BLE_ROLE_GATT_SERVER
|
||||||
|
|
||||||
handlerId = WsfOsSetNextHandler(SmpHandler);
|
handlerId = WsfOsSetNextHandler(SmpHandler);
|
||||||
SmpHandlerInit(handlerId);
|
SmpHandlerInit(handlerId);
|
||||||
|
|
Loading…
Reference in New Issue