From fb53ea7d226db1442b0bf20553e3b1caa8dac0d7 Mon Sep 17 00:00:00 2001 From: liqigan Date: Tue, 2 Mar 2021 15:42:11 +0800 Subject: [PATCH] add FAQ in SPP demo README --- components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c | 4 ++-- .../bt/host/bluedroid/stack/include/stack/hcidefs.h | 2 +- .../bluedroid/classic_bt/bt_spp_acceptor/README.md | 6 +++++- .../bluedroid/classic_bt/bt_spp_initiator/README.md | 10 ++++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c b/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c index 8a532a2faa..e6df9b0761 100644 --- a/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c +++ b/components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c @@ -110,8 +110,8 @@ static char *btm_ble_hci_status_to_str(tHCI_STATUS status) return "HCI_ERR_INVALID_LMP_PARAM"; case HCI_ERR_UNSPECIFIED: return "HCI_ERR_UNSPECIFIED"; - case HCI_ERR_UNSUPPORTED_LMP_FEATURE: - return "HCI_ERR_UNSUPPORTED_LMP_FEATURE"; + case HCI_ERR_UNSUPPORTED_LMP_PARAMETERS: + return "HCI_ERR_UNSUPPORTED_LMP_PARAMETERS"; case HCI_ERR_ROLE_CHANGE_NOT_ALLOWED: return "HCI_ERR_ROLE_CHANGE_NOT_ALLOWED"; case HCI_ERR_LMP_RESPONSE_TIMEOUT: diff --git a/components/bt/host/bluedroid/stack/include/stack/hcidefs.h b/components/bt/host/bluedroid/stack/include/stack/hcidefs.h index 064c0ca25a..bf3754f25b 100644 --- a/components/bt/host/bluedroid/stack/include/stack/hcidefs.h +++ b/components/bt/host/bluedroid/stack/include/stack/hcidefs.h @@ -844,7 +844,7 @@ #define HCI_ERR_SCO_AIR_MODE 0x1D #define HCI_ERR_INVALID_LMP_PARAM 0x1E #define HCI_ERR_UNSPECIFIED 0x1F -#define HCI_ERR_UNSUPPORTED_LMP_FEATURE 0x20 +#define HCI_ERR_UNSUPPORTED_LMP_PARAMETERS 0x20 #define HCI_ERR_ROLE_CHANGE_NOT_ALLOWED 0x21 #define HCI_ERR_LMP_RESPONSE_TIMEOUT 0x22 #define HCI_ERR_LMP_ERR_TRANS_COLLISION 0x23 diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_spp_acceptor/README.md b/examples/bluetooth/bluedroid/classic_bt/bt_spp_acceptor/README.md index abecbdedbe..aef56168b9 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_spp_acceptor/README.md +++ b/examples/bluetooth/bluedroid/classic_bt/bt_spp_acceptor/README.md @@ -43,4 +43,8 @@ After the program started, `bt_spp_initator` will connect it and send data. - To see the information of data, users shall set `SPP_SHOW_MODE` as `SPP_SHOW_DATA` or `SPP_SHOW_SPEED` in code(should be same with `bt_spp_initator`). -- We also show the Security Simple Pair in this SPP demo. Users can set the IO Capability and Security Mode for their device (security level is fixed level 4). The default security mode of this demo is `ESP_SPP_SEC_AUTHENTICATE` which support MITM (Man In The Middle) protection. For more information about Security Simple Pair on ESP32, please refer to [ESP32_SSP](./ESP32_SSP.md). \ No newline at end of file +- We also show the Security Simple Pair in this SPP demo. Users can set the IO Capability and Security Mode for their device (security level is fixed level 4). The default security mode of this demo is `ESP_SPP_SEC_AUTHENTICATE` which support MITM (Man In The Middle) protection. For more information about Security Simple Pair on ESP32, please refer to [ESP32_SSP](./ESP32_SSP.md). + +## FAQ +Q: How many SPP servers does ESP32 support? +A: For now, the maximum number of SPP servers is 6, which is limited by the maximum number of SDP records. When the SPP server is successfully started, the unique SCN (Server Channel Number) will be mapped to the SPP server. diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/README.md b/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/README.md index e6b0d30d88..1a3a509436 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/README.md +++ b/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/README.md @@ -119,3 +119,13 @@ To clearly show how the SSP aggregate with the SPP , we use the Commands and Eff - If you want to update the responses of HF Unit or want to update the log, please refer to `bt_app_spp.c`. - Task configuration part is in `example_spp_initiator_demo.c`. + +## FAQ +Q: How can we reach the maximum throughput when using SPP? +A: The default MTU size of classic Bluetooth SPP on ESP32 is 990 bytes, and higher throughput can be achieved in the case that data chunck size is close to the MTU size or multiple of MTU size. For example, sending 100 bytes data per second is much better than sending 10 bytes every 100 milliseconds. + +Q: What is the difference between the event `ESP_SPP_CONG_EVT` and the parameter `cong` of the event `ESP_SPP_WRITE_EVT`? +A: The event `ESP_SPP_CONG_EVT` shows the changing status from `congest` to `uncongest`, or form `uncongest` to `congest`. Congestion can have many causes, such as using out of the credit which is sent by peer, reaching the high watermark of the Tx buffer, the congestion at Bluetooth L2CAP layer and so on. The parameter `cong` of the event `ESP_SPP_WRITE_EVT` shows a snapshot of the state of the flow control manager after the write operation is completed. The user needs to carefully consider retransmitting or continuing to write according to these two events. The ESP32 offers an VFS mode of SPP which hides the details of retransmitting, but it will block the caller and is not more efficient than the callback mode. + +Q: How many SPP clients does ESP32 support? +A: The ESP32 supports maximum 8 SPP clients, which including virtual SPP connections. Virtual SPP connection means that SPP clients can connect to the different SPP servers running on the same peer device. However the number of SPP clients (excluding virtual connections) shall not exceed the number of Bluetooth ACL connections.