Merge branch 'component_bt/add_spp_faq_v4.3' into 'release/v4.3'

Component_bt/Add FAQ in SPP Demo README[backport v4.3]

See merge request espressif/esp-idf!14793
This commit is contained in:
Wang Meng Yang 2021-09-08 02:47:28 +00:00
commit 57c4316855
4 changed files with 18 additions and 4 deletions

View File

@ -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:

View File

@ -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

View File

@ -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).
- 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.

View File

@ -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.