mirror of https://github.com/ARMmbed/mbed-os.git
ifdef out security features
parent
9e710d4309
commit
30ad32a465
|
@ -461,7 +461,9 @@ void BLE::stack_setup()
|
||||||
#if BLE_FEATURE_GATT_SERVER
|
#if BLE_FEATURE_GATT_SERVER
|
||||||
AttsInit();
|
AttsInit();
|
||||||
AttsIndInit();
|
AttsIndInit();
|
||||||
|
#if BLE_FEATURE_SECURITY
|
||||||
AttsAuthorRegister(GattServer::atts_auth_cb);
|
AttsAuthorRegister(GattServer::atts_auth_cb);
|
||||||
|
#endif
|
||||||
#if BLE_FEATURE_SIGNING
|
#if BLE_FEATURE_SIGNING
|
||||||
AttsSignInit();
|
AttsSignInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -67,7 +67,9 @@ GattServer &GattServer::getInstance()
|
||||||
|
|
||||||
void GattServer::initialize()
|
void GattServer::initialize()
|
||||||
{
|
{
|
||||||
|
#if BLE_FEATURE_SECURITY
|
||||||
AttsAuthorRegister(atts_auth_cb);
|
AttsAuthorRegister(atts_auth_cb);
|
||||||
|
#endif
|
||||||
add_generic_access_service();
|
add_generic_access_service();
|
||||||
add_generic_attribute_service();
|
add_generic_attribute_service();
|
||||||
}
|
}
|
||||||
|
@ -623,6 +625,7 @@ ble_error_t GattServer::write_(
|
||||||
// successful
|
// successful
|
||||||
size_t updates_sent = 0;
|
size_t updates_sent = 0;
|
||||||
|
|
||||||
|
#if BLE_FEATURE_SECURITY
|
||||||
for (dmConnId_t conn_id = DM_CONN_MAX; conn_id > DM_CONN_ID_NONE; --conn_id) {
|
for (dmConnId_t conn_id = DM_CONN_MAX; conn_id > DM_CONN_ID_NONE; --conn_id) {
|
||||||
if (DmConnInUse(conn_id) == true) {
|
if (DmConnInUse(conn_id) == true) {
|
||||||
if (is_update_authorized(conn_id, att_handle)) {
|
if (is_update_authorized(conn_id, att_handle)) {
|
||||||
|
@ -638,6 +641,7 @@ ble_error_t GattServer::write_(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // BLE_FEATURE_SECURITY
|
||||||
|
|
||||||
if (updates_sent) {
|
if (updates_sent) {
|
||||||
handleDataSentEvent(updates_sent);
|
handleDataSentEvent(updates_sent);
|
||||||
|
@ -679,6 +683,7 @@ ble_error_t GattServer::write_(
|
||||||
// This characteristic has a CCCD attribute. Handle notifications and indications.
|
// This characteristic has a CCCD attribute. Handle notifications and indications.
|
||||||
size_t updates_sent = 0;
|
size_t updates_sent = 0;
|
||||||
|
|
||||||
|
#if BLE_FEATURE_SECURITY
|
||||||
if (is_update_authorized(connection, att_handle)) {
|
if (is_update_authorized(connection, att_handle)) {
|
||||||
uint16_t cccEnabled = AttsCccEnabled(connection, cccd_index);
|
uint16_t cccEnabled = AttsCccEnabled(connection, cccd_index);
|
||||||
if (cccEnabled & ATT_CLIENT_CFG_NOTIFY) {
|
if (cccEnabled & ATT_CLIENT_CFG_NOTIFY) {
|
||||||
|
@ -690,6 +695,7 @@ ble_error_t GattServer::write_(
|
||||||
updates_sent++;
|
updates_sent++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // BLE_FEATURE_SECURITY
|
||||||
|
|
||||||
if (updates_sent) {
|
if (updates_sent) {
|
||||||
handleDataSentEvent(updates_sent);
|
handleDataSentEvent(updates_sent);
|
||||||
|
|
Loading…
Reference in New Issue