Classic Bluetooth Connection Problem

leticia.araujo
Posts: 1
Joined: Mon May 24, 2021 5:46 pm

Classic Bluetooth Connection Problem

Postby leticia.araujo » Mon May 24, 2021 5:53 pm

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
Attachments
Sem título.png
Pin
Sem título.png (4.77 KiB) Viewed 1790 times

ns1668
Posts: 50
Joined: Tue Mar 16, 2021 2:00 pm

Re: Classic Bluetooth Connection Problem

Postby ns1668 » Tue May 25, 2021 7:44 am

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

Who is online

Users browsing this forum: Baidu [Spider] and 122 guests