Merge branch 'NimBLE/fix_esp_nimble_hci_delay' into 'master'

NimBLE: Misc changes in NimBLE porting layer and menuconfig option

See merge request espressif/esp-idf!6243
This commit is contained in:
Mahavir Jain 2019-10-10 17:20:15 +08:00
commit 6499d36441
4 changed files with 26 additions and 4 deletions

View file

@ -105,6 +105,15 @@ config BT_NIMBLE_DEBUG
help help
This enables extra runtime asserts and host debugging This enables extra runtime asserts and host debugging
config BT_NIMBLE_SM_SC_DEBUG_KEYS
bool "Use predefined public-private key pair"
default n
depends on BT_NIMBLE_SM_SC
help
If this option is enabled, SM uses predefined DH key pair as described
in Core Specification, Vol. 3, Part H, 2.3.5.6.1. This allows to
decrypt air traffic easily and thus should only be used for debugging.
config BT_NIMBLE_SVC_GAP_DEVICE_NAME config BT_NIMBLE_SVC_GAP_DEVICE_NAME
string "BLE GAP default device name" string "BLE GAP default device name"
depends on BT_NIMBLE_ENABLED depends on BT_NIMBLE_ENABLED

View file

@ -66,6 +66,8 @@ static os_membuf_t ble_hci_evt_lo_buf[
MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE)) MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE))
]; ];
const static char *TAG = "NimBLE";
void ble_hci_trans_cfg_hs(ble_hci_trans_rx_cmd_fn *cmd_cb, void ble_hci_trans_cfg_hs(ble_hci_trans_rx_cmd_fn *cmd_cb,
void *cmd_arg, void *cmd_arg,
ble_hci_trans_rx_acl_fn *acl_cb, ble_hci_trans_rx_acl_fn *acl_cb,
@ -85,7 +87,9 @@ int ble_hci_trans_hs_cmd_tx(uint8_t *cmd)
assert(cmd != NULL); assert(cmd != NULL);
*cmd = BLE_HCI_UART_H4_CMD; *cmd = BLE_HCI_UART_H4_CMD;
len = BLE_HCI_CMD_HDR_LEN + cmd[3] + 1; len = BLE_HCI_CMD_HDR_LEN + cmd[3] + 1;
while (!esp_vhci_host_check_send_available()) { if (!esp_vhci_host_check_send_available()) {
ESP_LOGE(TAG, "Controller not ready to receive packets from host at this time, try again after sometime");
return BLE_HS_EAGAIN;
} }
esp_vhci_host_send_packet(cmd, len); esp_vhci_host_send_packet(cmd, len);
@ -115,8 +119,9 @@ int ble_hci_trans_hs_acl_tx(struct os_mbuf *om)
data[0] = BLE_HCI_UART_H4_ACL; data[0] = BLE_HCI_UART_H4_ACL;
len++; len++;
while (!esp_vhci_host_check_send_available()) { if (!esp_vhci_host_check_send_available()) {
vTaskDelay(1000 / portTICK_PERIOD_MS); ESP_LOGE(TAG, "Controller not ready to receive packets from host at this time, try again after sometime");
return BLE_HS_EAGAIN;
} }
os_mbuf_copydata(om, 0, OS_MBUF_PKTLEN(om), &data[1]); os_mbuf_copydata(om, 0, OS_MBUF_PKTLEN(om), &data[1]);

@ -1 +1 @@
Subproject commit 6c91a9a153c421231b686d30c822e53fea7510c0 Subproject commit 5f6348d0ddd7f98841e458bbc808e8f7f5f23b23

View file

@ -423,6 +423,14 @@
#endif #endif
#endif #endif
#ifndef MYNEWT_VAL_BLE_SM_SC_DEBUG_KEYS
#ifdef CONFIG_BT_NIMBLE_SM_SC_DEBUG_KEYS
#define MYNEWT_VAL_BLE_SM_SC_DEBUG_KEYS (1)
#else
#define MYNEWT_VAL_BLE_SM_SC_DEBUG_KEYS (0)
#endif
#endif
#ifndef MYNEWT_VAL_BLE_HS_AUTO_START #ifndef MYNEWT_VAL_BLE_HS_AUTO_START
#define MYNEWT_VAL_BLE_HS_AUTO_START (1) #define MYNEWT_VAL_BLE_HS_AUTO_START (1)
#endif #endif