Skip to content

BLE: Notification and indications are not handled when security is disabled #15182

Open
@boraozgen

Description

@boraozgen

Description of defect

The following preprocessor switch prevents handling of notifications and indications (pushing to the client) when the security feature is disabled. Removing the preprocessor switch fixes the issue. Any idea why this code snippet has anything to do with the security switch?

// This characteristic has a CCCD attribute. Handle notifications and
// indications for all active connections if the authentication is
// successful
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) {
if (DmConnInUse(conn_id) == true) {
if (is_update_authorized(conn_id, att_handle)) {
uint16_t cccd_config = AttsCccEnabled(conn_id, cccd_index);
if (cccd_config & ATT_CLIENT_CFG_NOTIFY) {
AttsHandleValueNtf(conn_id, att_handle, len, (uint8_t *) buffer);
updates_sent++;
}
if (cccd_config & ATT_CLIENT_CFG_INDICATE) {
AttsHandleValueInd(conn_id, att_handle, len, (uint8_t *) buffer);
updates_sent++;
}
}
}
}
#endif // BLE_FEATURE_SECURITY

Target(s) affected by this defect ?

BLE targets.

Toolchain(s) (name and version) displaying this defect ?

GCC ARM

What version of Mbed-os are you using (tag or sha) ?

mbed-os-6.15.0

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

Not related

How is this defect reproduced ?

Get the update GATT server example and disable security with: "ble.ble-feature-security": false. Observe no notifications being received by the client.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions