Parcourir la source

[bt] add the esp_hosted_bt_startup weak function to configure the bluetooth stack

Evlers il y a 10 mois
Parent
commit
7d7f94e3ec
2 fichiers modifiés avec 16 ajouts et 0 suppressions
  1. 8 0
      porting/bt/vhci_dev.c
  2. 8 0
      porting/bt/vhci_drv.c

+ 8 - 0
porting/bt/vhci_dev.c

@@ -131,10 +131,18 @@ void hci_drv_init(void)
     /* do nothing for VHCI: underlying transport should be ready */
 }
 
+rt_weak void esp_hosted_bt_startup (void)
+{
+    /* The callback indicates that the vhci interface is ready.
+     * The user rewrites this function to initialize or configure the Bluetooth protocol stack.
+     */
+}
+
 void hci_drv_show_configuration(void)
 {
 	ESP_LOGI(TAG, "Host BT Support: Enabled");
 	ESP_LOGI(TAG, "BT Transport Type: vhci devices");
+    esp_hosted_bt_startup();
 }
 
 int hci_rx_handler(interface_buffer_handle_t *buf_handle)

+ 8 - 0
porting/bt/vhci_drv.c

@@ -73,6 +73,13 @@ void hci_drv_init(void)
 #endif /* H_BT_HOST_ESP_NIMBLE */
 }
 
+rt_weak void esp_hosted_bt_startup (void)
+{
+    /* The callback indicates that the vhci interface is ready.
+     * The user rewrites this function to initialize or configure the Bluetooth protocol stack.
+     */
+}
+
 void hci_drv_show_configuration(void)
 {
 #if H_BT_HOST_ESP_NIMBLE
@@ -80,6 +87,7 @@ void hci_drv_show_configuration(void)
 	ESP_LOGI(TAG, "\tBT Transport Type: VHCI");
 	ESP_LOGI(TAG, "\tBT Stack Type: NimBLE");
 #endif /* H_BT_HOST_ESP_NIMBLE */
+	esp_hosted_bt_startup();
 }
 
 #if H_BT_HOST_ESP_NIMBLE