Bluetooth: host: Return error code if disconnect has invalid parameters

Return the error code from the disconnect command to the application
when an invalid disconnect reason has been provided.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-12-11 13:49:51 +01:00 committed by Carles Cufí
commit 9205fe0a3a

View file

@ -1539,7 +1539,7 @@ int bt_hci_disconnect(uint16_t handle, uint8_t reason)
disconn->handle = sys_cpu_to_le16(handle);
disconn->reason = reason;
return bt_hci_cmd_send(BT_HCI_OP_DISCONNECT, buf);
return bt_hci_cmd_send_sync(BT_HCI_OP_DISCONNECT, buf, NULL);
}
static void hci_disconn_complete_prio(struct net_buf *buf)