From d087d912eecff04531a05765cbca9325b32080be Mon Sep 17 00:00:00 2001 From: Matias N Date: Sun, 25 Oct 2020 12:02:55 -0300 Subject: [PATCH] bt_hcicore.c: Fix wrong order of bt_send() and setting last command sent --- wireless/bluetooth/bt_hcicore.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c index a828e46a4a0..7e2a42d405f 100644 --- a/wireless/bluetooth/bt_hcicore.c +++ b/wireless/bluetooth/bt_hcicore.c @@ -1002,11 +1002,6 @@ static int hci_tx_kthread(int argc, FAR char *argv[]) g_btdev.ncmd = 0; - wlinfo("Sending command %04x buf %p to driver\n", - buf->u.hci.opcode, buf); - - btdev->send(btdev, buf); - /* Clear out any existing sent command */ if (g_btdev.sent_cmd) @@ -1017,6 +1012,11 @@ static int hci_tx_kthread(int argc, FAR char *argv[]) } g_btdev.sent_cmd = buf; + + wlinfo("Sending command %04x buf %p to driver\n", + buf->u.hci.opcode, buf); + + btdev->send(btdev, buf); } return EXIT_SUCCESS; /* Can't get here */