Skip to content

Commit

Permalink
feat(ble): Make it possible to use BT_GATT_AUTO_SEC_REQ
Browse files Browse the repository at this point in the history
* Only upgrade security of new connections if BT_GATT_AUTO_SEC_REQ
  is not enabled.
  • Loading branch information
petejohanson committed Nov 30, 2023
1 parent 69f7bfb commit 7c79882
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,11 @@ static void connected(struct bt_conn *conn, uint8_t err) {

LOG_DBG("Connected %s", addr);

#if !IS_ENABLED(CONFIG_BT_GATT_AUTO_SEC_REQ)
if (bt_conn_set_security(conn, BT_SECURITY_L2)) {
LOG_ERR("Failed to set security");
}
#endif // !IS_ENABLED(CONFIG_BT_GATT_AUTO_SEC_REQ)

update_advertising();

Expand Down

0 comments on commit 7c79882

Please sign in to comment.