Bluetooth: tester: Ignore error -EBUSY of bt_conn_set_security

The error code `-EBUSY` of `bt_conn_set_security` means the
pairing/encryption procedure is ongoing. Ignore the error code.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
This commit is contained in:
Lyle Zhu 2025-03-07 12:34:31 +08:00 committed by Benjamin Cabé
commit ba55e9d7c0

View file

@ -1567,7 +1567,11 @@ static uint8_t pair(const void *cmd, uint16_t cmd_len,
}
err = bt_conn_set_security(conn, BT_SECURITY_L2);
if (err < 0) {
/*
* If the error code is `-EBUSY`, it means the pairing/enryption is ongoing.
* Just ignore the error.
*/
if ((err < 0) && (err != -EBUSY)) {
LOG_ERR("Failed to set security: %d", err);
bt_conn_unref(conn);
return BTP_STATUS_FAILED;