Skip to content

Commit

Permalink
Bluetooth: host: Fix SC indication on encrypt change
Browse files Browse the repository at this point in the history
The SC indication can be sent only if the GATT Service Changed is
enabled in the configuration. Change fixes build issues related to
implicit sc_indicate declaration when Service Changed is disabled.

Fixes: zephyrproject-rtos#54813

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
  • Loading branch information
MarekPieta committed Feb 15, 2023
1 parent 44488f1 commit a005ed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/bluetooth/host/gatt.c
Expand Up @@ -5712,14 +5712,14 @@ void bt_gatt_encrypt_change(struct bt_conn *conn)

bt_gatt_foreach_attr(0x0001, 0xffff, update_ccc, &data);

#if defined(CONFIG_BT_SETTINGS)
#if defined(CONFIG_BT_SETTINGS) && defined(CONFIG_BT_GATT_SERVICE_CHANGED)
if (!bt_gatt_change_aware(conn, false)) {
/* Send a Service Changed indication if the current peer is
* marked as change-unaware.
*/
sc_indicate(0x0001, 0xffff);
}
#endif /* CONFIG_BT_SETTINGS */
#endif /* CONFIG_BT_SETTINGS && CONFIG_BT_GATT_SERVICE_CHANGED */
}

bool bt_gatt_change_aware(struct bt_conn *conn, bool req)
Expand Down

0 comments on commit a005ed6

Please sign in to comment.