NimBLE: Misc changes in NimBLE porting layer and menuconfig option (Backport 4.0)

- Minor fix to remove while loop & delay while transmitting data from
  host to controller.
- Add menuconfig option to enable predefined public-private keypair for
  debugging (Vol. 3, Part H, 2.3.5.6.1)
- Update NimBLE submodule: Fix for #4028, #4012
This commit is contained in:
Prasad Alatkar 2019-10-18 13:18:09 +08:00 committed by Mahavir Jain
parent 2cde888a6d
commit 6a60c4a046
4 changed files with 26 additions and 4 deletions

View file

@ -105,6 +105,15 @@ config BT_NIMBLE_DEBUG
help
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
string "BLE GAP default device name"
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))
];
const static char *TAG = "NimBLE";
void ble_hci_trans_cfg_hs(ble_hci_trans_rx_cmd_fn *cmd_cb,
void *cmd_arg,
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);
*cmd = BLE_HCI_UART_H4_CMD;
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);
@ -115,8 +119,9 @@ int ble_hci_trans_hs_acl_tx(struct os_mbuf *om)
data[0] = BLE_HCI_UART_H4_ACL;
len++;
while (!esp_vhci_host_check_send_available()) {
vTaskDelay(1000 / portTICK_PERIOD_MS);
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;
}
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
#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
#define MYNEWT_VAL_BLE_HS_AUTO_START (1)
#endif