diff --git a/src/ble/ble_service.c b/src/ble/ble_service.c index e4ecd9f..05a6625 100644 --- a/src/ble/ble_service.c +++ b/src/ble/ble_service.c @@ -578,7 +578,6 @@ static void connected(struct bt_conn *conn, uint8_t err) DBG_CORE("[BLE] Security requested level=%u\r\n", BLE_REQUIRED_SECURITY_LEVEL); #endif - led_set_state(LED_STATE_OFF); DBG_CORE("[BLE] Connected\r\n"); } @@ -660,6 +659,10 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ } DBG_CORE("[BLE] Security ready level=%u\r\n", level); + if (level >= BLE_REQUIRED_SECURITY_LEVEL) + { + led_set_state(LED_STATE_OFF); + } } #endif