From 2211c3483563d5ce655393c94c362d79cc911e60 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Wed, 5 Jun 2024 12:47:12 +0200 Subject: [PATCH] Bluetooth: Controller: Use BT_HCI_ERR_UNSPECIFIED as needed A Host shall consider any error code that it does not explicitly understand equivalent to the error code Unspecified Error (0x1F). Signed-off-by: Vinayak Kariappa Chettimada (cherry picked from commit 78466c8f52c77d54c12641a83d61c4db1cb5dd8d) Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/hci/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 7711aff0019eaf..54f70278d22c88 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -8516,7 +8516,7 @@ static void encrypt_change(uint8_t err, uint16_t handle, hci_evt_create(buf, BT_HCI_EVT_ENCRYPT_CHANGE, sizeof(*ep)); ep = net_buf_add(buf, sizeof(*ep)); - ep->status = err; + ep->status = err ? err : (encryption_on ? err : BT_HCI_ERR_UNSPECIFIED); ep->handle = sys_cpu_to_le16(handle); ep->encrypt = encryption_on ? 1 : 0; }