esp-idf/examples/bluetooth/bluedroid/classic_bt/bt_discovery
Rahul Tank 1aff02ea55 esp-idf: Corrected check of Class of Device for discovered devices
Current code stopped inquiry if major class is not Phone. Modified the
condition to consider for both Phone and Audio to cover majority of real
world devices.

Closes https://github.com/espressif/esp-idf/issues/6548
2021-04-01 10:31:36 +00:00
..
main esp-idf: Corrected check of Class of Device for discovered devices 2021-04-01 10:31:36 +00:00
CMakeLists.txt build_app: make multi target support readable 2020-04-09 16:40:57 +08:00
Makefile Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
README.md Update bt_discovery demo and README 2021-01-27 14:17:12 +08:00
sdkconfig.defaults examples: fix sdkconfig warnings 2019-11-21 15:36:06 +01:00

Supported Targets ESP32

ESP-IDF BT-INQUIRY demo

Demo of Classic Bluetooth Device and Service Discovery This is the demo for user to use ESP_APIs to perform inquiry to search for a target device and then performs service search via SDP.

How to use example

Hardware Required

This example is designed to run on commonly available ESP32 development board, e.g. ESP32-DevKitC.

Configure the project

idf.py menuconfig

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 started, the device will start inquiry to search for a device with Major device type "PHONE" in the Class of Device Field. Then it will cancel the inquiry and started to perform service discovering on this remote device.

Trouble shooting

  • Some old BT device doesn't place their device name in EIR, but new devices place their device name in EIR. Users can obtain the peer device name in bt_app_gap_cb ESP_BT_GAP_DISC_RES_EVT event handler or resolve it in EIR just like the function get_name_from_eir does.

  • ESP32 places its device name in EIR by default.