README.md
1| Supported Targets | ESP32 |
2| ----------------- | ----- |
3
4## ESP-IDF BT-SPP-VFS-ACCEPTOR Example
5
6This example is to show how to use the APIs of **Serial Port Protocol** (**SPP**) to create an SPP acceptor which performs as a server, and it will register into the VFS. We aggregate **Secure Simple Pair** (**SSP**) into this example to show how to use SPP when creating your own APPs. We also provide the example `bt_spp_initiator` or the example `bt_spp_vfs_initiator` to create an SPP initiator which performs as a client. In fact, you can create SPP acceptors and SPP initiators on a single device at the same time.
7
8## How to use example
9
10### Hardware Required
11
12This example is designed to run on commonly available ESP32 development board, e.g. ESP32-DevKitC. To operate the example, it should be connected to an SPP Initiator running on a smartphone, a computer or on another ESP32 development board.
13
14### Configure the project
15
161. Open the project configuration menu:
17
18```
19idf.py menuconfig
20```
21
222. Enable the SPP functionality by choosing the path as following:
23
24`Component config --> Bluetooth --> Bluedroid Options --> SPP`
25
263. If you want to limit the number of connected devices, please make sure set the `BT/BLE MAX ACL CONNECTIONS` and `BR/EDR ACL Max Connections` with same value you want.
27
28`Component config --> Bluetooth --> Bluedroid Options --> BT/BLE MAX ACL CONNECTIONS(1~7)`
29and
30`Component config --> Bluetooth --> Bluetooth --> Bluetooth controller --> BR/EDR ACL Max Connections`
31
32
334. SSP is enabled as default in this example. If you prefer the legacy pairing, you can disable it in the following path.
34
35`Component config --> Bluetooth--> Bluedroid Options --> Secure Simple Pair`.
36
37### Build and Flash
38
39Build the project and flash it to the board, then run monitor tool to view serial output:
40
41```
42idf.py -p PORT flash monitor
43```
44
45(Replace PORT with the name of the serial port to use.)
46
47(To exit the serial monitor, type ``Ctrl-]``.)
48
49See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects.
50
51## Example Description
52
53After the program starts, the example will start an SPP acceptor. The example will print the received data after the SPP connection is established. You can connect to the server and send data with another ESP32 development board, Andriod phone or computer which performs as the SPP initiator.
54
55## FAQ
56Please refer the FAQ part in the [README.md](../bt_spp_acceptor/README.md)