feat(ble): Make it possible to use BT_GATT_AUTO_SEC_REQ

* Only upgrade security of new connections if BT_GATT_AUTO_SEC_REQ
  is not enabled.
This commit is contained in:
Peter Johanson 2023-11-30 06:48:35 +00:00 committed by Pete Johanson
parent 744f70c80c
commit 329d6474ee

View file

@ -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();