README.md
1| Supported Targets | ESP32 |
2| ----------------- | ----- |
3
4# ESP-IDF BT-SPP-INITATOR Example
5
6This example is to show how to use the APIs of **Serial Port Protocol** (**SPP**) to create an SPP initiator which performs as a client, 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_acceptor` or the example `bt_spp_vfs_acceptor` to create an SPP acceptor which performs as a server. 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, you should be connect to an SPP acceptor running on a smartphone, a computer or on another ESP32 development board.
13
14### Configure the project
151. Open the project configuration menu:
16```
17idf.py menuconfig
18```
19
202. Enable the SPP functionality by choosing the path as following:
21
22`Component config --> Bluetooth --> Bluedroid Options --> SPP`.
23
243. SSP is enabled as default in this example. If you prefer the legacy pairing, you can disable it in the following path.
25
26`Component config --> Bluetooth--> Bluedroid Options --> Secure Simple Pair`.
27
28
29### Build and Flash
30
31Build the project and flash it to the board, then run monitor tool to view serial output:
32
33```
34idf.py -p PORT flash monitor
35```
36
37(Replace PORT with the name of the serial port to use.)
38
39(To exit the serial monitor, type ``Ctrl-]``.)
40
41See 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.
42
43## Example Description
44
45After the program starts, the example will initiate a Bluetooth discovery procedure and filter out the peer device by the name in the EIR(Extended Inquiry Response). After discovering the SPP service, it will connect to the SPP acceptor and send data.
46
47## FAQ
48Please refer the FAQ part in the [README.md](../bt_spp_initiator/README.md)
49