Classic Bluetooth Connection Problem
Posted: Mon May 24, 2021 5:53 pm
by leticia.araujo
Hi, everyone!
I'm trying to connect my ESP32 devkit to Windows 10 using Classic Bluetooth.
Firstly, I connected the ESP32 to 2 different Laptop and it worked.
Them, I tried to connect to a PC using a bluetooth dongle, but I have a problem: windows requires me to confirm a pin on ESP32.
How can I solve that?
Thank u
Re: Classic Bluetooth Connection Problem
Posted: Tue May 25, 2021 7:44 am
by ns1668
There are three different modes available for pairing security (esp_gap_bt_api.h):
Code: Select all
#define ESP_BT_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */
#define ESP_BT_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */
#define ESP_BT_IO_CAP_IN 2 /*!< KeyboardOnly */ /* relate to BTM_IO_CAP_IN in stack/btm_api.h */
#define ESP_BT_IO_CAP_NONE 3 /*!< NoInputNoOutput */ /* relate to BTM_IO_CAP_NONE in stack/btm_api.h */
For BT classic, if you have secure simple pairing enabled in your sdkconfig then you can set the mode like this:
Code: Select all
#if defined(CONFIG_BT_SSP_ENABLED)
esp_bt_sp_param_t param_type = ESP_BT_IO_CAP_NONE; // CHANGE THIS TO SET THE SECURITY MODE
esp_bt_io_cap_t iocap = BT_PAIRING_SECURITY;
ESP_ERROR_CHECK(esp_bt_gap_set_security_param(param_type, &iocap, sizeof(uint8_t)));
#endif
Have a look at this link:
https://docs.espressif.com/projects/esp ... Pv7uint8_t