Skip to content

Commit e0da61c

Browse files
committed
Merge branch 'fix/optimize_nimble_throughput_example' into 'master'
fix(nimble): Added support of Dynamic switching between different Phy modes. Closes BLERP-1837 See merge request espressif/esp-idf!37787
2 parents 190eca3 + 9934587 commit e0da61c

File tree

8 files changed

+422
-68
lines changed

8 files changed

+422
-68
lines changed

examples/bluetooth/nimble/throughput_app/blecent_throughput/README.md

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,34 @@ It performs read operation on peripheral's `THRPT_LONG_CHR_READ_WRITE` character
1414
### Procedure to use this demo example
1515

1616
* `idf.py menuconfig` and configure the parameters as needed (connection related parameters in example parameters).
17+
* To test throughput on 1M PHY, make sure to disable the Example Configuration -> Enable Extended Adv flag in menuconfig on both sides.
18+
* To test on 2M PHY or Coded PHY (S2/S8), you must enable the Example Configuration -> Enable Extended Adv flag on both sides.
1719
* `bleprph_throughput` example needs to be run along with this client side example.
1820
* After connection link is established between these two devices, user is given a window of `YES_NO_PARAM` (5 seconds) to customize connection parameters. If user has configured parameters from menuconfig, this step can be skipped by either waiting it out or entering `Insert no`.
1921
* User needs to enter `Insert yes` to customize connection parameters. Enter `MTU` and other connection parameters as directed on console instructions e.g. `MTU 512` for MTU and `conn 6 120 0 500 0 0` for connection parameters in sequence of `min conn_itvl`, `max conn_itvl`, `latency`, `supervision timeout`, `min conn_evt_len` and `max_conn_evt_len`.
2022
* User will be now presented with throughput test related console prints, this suggests application is now ready to be run throughput test for user defined time. The prints may appear like below
2123

2224
```
23-
==================================================================
24-
| Steps to test nimble throughput |
25-
| |
26-
| 1. Enter throughput [--Type] [--Test time] |
27-
| Type: read/write/notify. |
28-
| Test time: Enter value in seconds. |
29-
| |
30-
| e.g. throughput read 600 |
31-
| |
32-
| ** Enter 'throughput read 60' for reading char for 60 seconds |
33-
| OR 'throughput write 60' for writing to char for 60 seconds |
34-
| OR 'throughput notify 60' for notifications (for 60 seconds)**|
35-
| |
36-
=================================================================
25+
====================================================================================
26+
| Steps to test nimble throughput |
27+
| |
28+
| 1. Enter throughput [--Type] [--Test time] [--Phy] |
29+
| Type: read/write/notify. |
30+
| Test time: Enter value in seconds. |
31+
| Phy mode: Enter value in 0 for 1M, 1 for 2M ,2 for Coded S2, |
32+
| 3 for Coded S8. |
33+
| |
34+
| e.g. throughput read 600 3 |
35+
| |
36+
| ** Enter 'throughput read 60 0' for reading char for 60 seconds on 1M phy |
37+
| OR 'throughput write 60 1' for writing to char for 60 seconds on 2M phy |
38+
| OR 'throughput notify 60 2' for notifications (for 60 seconds on s=2 coded phy)**|
39+
| |
40+
=====================================================================================
41+
3742
3843
```
39-
* If user fail to enter any values for next 30 seconds, the app falls to default behavior of READ for 60 seconds mode.
44+
* If user fail to enter any values for next 30 seconds, the app falls to default behavior of READ for 60 seconds mode and 1M phy channel.
4045
* Read and write throughput numbers will be presented in `blecent_throughput` console output. For notification `bleprph_throughput` console shall be referred, as the peripheral is the one who is sending notifications. Below is the sample output of the app:
4146

4247
```
@@ -82,20 +87,23 @@ GATT procedure initiated: discover all descriptors; chr_val_handle=17 end_handle
8287
I (36933) blecent_throughput: Service discovery complete; status=0 conn_handle=0
8388
8489
I (36933) blecent_throughput: Format for throughput demo:: throughput read 100
85-
==================================================================
86-
| Steps to test nimble throughput |
87-
| |
88-
| 1. Enter throughput [--Type] [--Test time] |
89-
| Type: read/write/notify. |
90-
| Test time: Enter value in seconds. |
91-
| |
92-
| e.g. throughput read 600 |
93-
| |
94-
| ** Enter 'throughput read 60' for reading char for 60 seconds |
95-
| OR 'throughput write 60' for writing to char for 60 seconds |
96-
| OR 'throughput notify 60' for notifications (for 60 seconds)**|
97-
| |
98-
=================================================================
90+
====================================================================================
91+
| Steps to test nimble throughput |
92+
| |
93+
| 1. Enter throughput [--Type] [--Test time] [--Phy] |
94+
| Type: read/write/notify. |
95+
| Test time: Enter value in seconds. |
96+
| Phy mode: Enter value in 0 for 1M, 1 for 2M ,2 for Coded S2, |
97+
| 3 for Coded S8. |
98+
| |
99+
| e.g. throughput read 600 3 |
100+
| |
101+
| ** Enter 'throughput read 60 0' for reading char for 60 seconds on 1M phy |
102+
| OR 'throughput write 60 1' for writing to char for 60 seconds on 2M phy |
103+
| OR 'throughput notify 60 2' for notifications (for 60 seconds on s=2 coded phy)**|
104+
| |
105+
=====================================================================================
106+
99107
100108
Throughput demo >> throughput read 10
101109
I (55333) Throughput demo handler: throughput read 10

examples/bluetooth/nimble/throughput_app/blecent_throughput/main/Kconfig.projbuild

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ menu "Example Configuration"
88

99
config EXAMPLE_CONN_ITVL_MIN
1010
int "Minimum connection itvl"
11-
default 6
11+
default 104
1212
help
1313
Set the minimum connection interval in 1.25msec units.
1414

1515
config EXAMPLE_CONN_ITVL_MAX
1616
int "Maximum connection itvl"
17-
default 6
17+
default 104
1818
help
1919
Set the maximum connection interval in 1.25msec units.
2020

@@ -26,7 +26,7 @@ menu "Example Configuration"
2626

2727
config EXAMPLE_CONN_TIMEOUT
2828
int "Supervision timeout"
29-
default 500
29+
default 600
3030
help
3131
Set the supervision timeout in 10msec units.
3232

@@ -41,4 +41,16 @@ menu "Example Configuration"
4141
default 12
4242
help
4343
Set the maximum connection event length in 0.625msec units.
44+
45+
config EXAMPLE_EXTENDED_ADV
46+
bool
47+
depends on SOC_BLE_50_SUPPORTED && BT_NIMBLE_50_FEATURE_SUPPORT
48+
default y if SOC_ESP_NIMBLE_CONTROLLER
49+
select BT_NIMBLE_EXT_ADV
50+
prompt "Enable Extended Adv"
51+
help
52+
Use this option to enable extended advertising in the example.
53+
If this option is disabled, ensure config BT_NIMBLE_EXT_ADV is
54+
also disabled from Nimble stack menuconfig
55+
4456
endmenu

0 commit comments

Comments
 (0)