You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/05/21 06:45:37 UTC

[GitHub] [incubator-nuttx] donghengqaz commented on a change in pull request #3754: wireless/bluetooth: decoupling bt_driver_s and bt_buf_s

donghengqaz commented on a change in pull request #3754:
URL: https://github.com/apache/incubator-nuttx/pull/3754#discussion_r636674946



##########
File path: arch/arm/src/nrf52/nrf52_sdc.c
##########
@@ -283,32 +265,8 @@ static void on_hci(void)
 
           len = sizeof(*hdr) + hdr->len;
 
-#ifdef CONFIG_DEBUG_WIRELESS_INFO
-          if (hdr->evt == BT_HCI_EVT_CMD_COMPLETE)
-            {
-              struct hci_evt_cmd_complete_s *cmd_complete =
-                  (struct hci_evt_cmd_complete_s *)
-                      (g_sdc_dev.msg_buffer + sizeof(*hdr));
-              uint8_t *status = (uint8_t *)cmd_complete + 1;
-
-              wlinfo("received CMD_COMPLETE from softdevice "
-                     "(opcode: %d, status: 0x%x)\n",
-                     cmd_complete->opcode, *status);
-            }
-          else
-            {
-              wlinfo("received HCI EVT from softdevice "
-                     "(evt: %d, len: %zu)\n", hdr->evt, len);
-            }
-#endif
-
-          outbuf = bt_buf_alloc(BT_EVT, NULL, BLUETOOTH_H4_HDRLEN);
-          bt_buf_extend(outbuf, len);
-
-          memcpy(outbuf->data, g_sdc_dev.msg_buffer, len);
-
-          bt_hci_receive(outbuf);
-
+          g_bt_driver->receive(&g_bt_driver, BT_EVT,

Review comment:
       Maybe we can add function like `bt_msg_reveive(&g_bt_driver, BT_EVT, g_sdc_dev.msg_buffer, len)` instead of directly calling callback function which is set by BT kernel driver.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org