esp-idf/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator
Djordje Nedic facab8c5a7 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2022-06-01 06:35:02 +00:00
..
main freertos: Remove legacy data types 2022-02-09 23:05:45 +08:00
CMakeLists.txt tools: Increase the minimal supported CMake version to 3.16 2022-06-01 06:35:02 +00:00
README.md optimize SPP documents 2021-12-29 16:18:16 +08:00
sdkconfig.defaults examples: fix sdkconfig warnings 2019-11-21 15:36:06 +01:00

README.md

Supported Targets ESP32

ESP-IDF BT-SPP-INITATOR demo

This 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 demo to show how to use SPP when creating your own APPs. We also provide the demo bt_spp_acceptor or the demo 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.

How to use example

Hardware Required

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

Configure the project

  1. Open the project configuration menu:
idf.py menuconfig
  1. Enable the SPP functionality by choosing the path as following:

Component config --> Bluetooth --> Bluedroid Options --> SPP.

  1. SSP is enabled as default in this example. If you prefer the legacy pairing, you can disable it in the following path.

Component config --> Bluetooth--> Bluedroid Options --> Secure Simple Pair.

Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

idf.py -p PORT flash monitor

(Replace PORT with the name of the serial port to use.)

(To exit the serial monitor, type Ctrl-].)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

Example Description

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

FAQ

Please refer the FAQ part in the README.md