Ver Fonte

NimBLE: Fix host flow control in NimBLE porting layer.

- Register `ble_hs_flow_acl_free` callback in NimBLE porting layer.
Prasad Alatkar há 5 anos atrás
pai
commit
842a55cda3

+ 3 - 1
components/bt/host/nimble/esp-hci/src/esp_nimble_hci.c

@@ -211,7 +211,9 @@ void ble_hci_trans_buf_free(uint8_t *buf)
  */
 int ble_hci_trans_set_acl_free_cb(os_mempool_put_fn *cb, void *arg)
 {
-    return BLE_ERR_UNSUPPORTED;
+    ble_hci_acl_pool.mpe_put_cb = cb;
+    ble_hci_acl_pool.mpe_put_arg = arg;
+    return 0;
 }
 
 int ble_hci_trans_reset(void)

+ 1 - 1
examples/bluetooth/nimble/bleprph/main/main.c

@@ -361,11 +361,11 @@ app_main(void)
     ble_hs_cfg.sm_sc = 1;
 #else
     ble_hs_cfg.sm_sc = 0;
+#endif
 #ifdef CONFIG_EXAMPLE_BONDING
     ble_hs_cfg.sm_our_key_dist = 1;
     ble_hs_cfg.sm_their_key_dist = 1;
 #endif
-#endif
 
 
     rc = gatt_svr_init();