Hi all,
I'am working on a esp32 project that uses Bluetooth. Now I'am looking into the Bluetooth classic example using SPP (the "bt_spp_acceptor" as a starting point).
This is exactly what I need, so I can use the Bluetooth connection as a serial port.
Now the real question: I can connect with any device to my ESP32 client. How do I limit this? I only want devices to connect to my ESP that are 'mine'.
Now everybody with a notebook can connect to my ESP32 using bluetooth via the "JustWorks" method, and they can read/write on my serial port.
What I actually want is something of a password/whitelist so I can block access to unrestricted users.
Any idea on how to do this?
I now the BLE example has features like 'whitelisting' but I can't seem to find those on the "Bluetooth Classing API".
Bluetooth Classic pairing on/off
Re: Bluetooth Classic pairing on/off
Thanks!
So I may assure only Legacy pairing is an option now?
-
- Posts: 8
- Joined: Mon Aug 26, 2019 6:10 am
Re: Bluetooth Classic pairing on/off
"Passkey entry" pairing option can be used to enforce SSP (Secure Simple Pairing) instead of Legacy pairing.
Please check following API to reply the passkey value:
Thanks.
Please check following API to reply the passkey value:
Code: Select all
esp_err_t esp_bt_gap_ssp_passkey_reply(esp_bd_addr_t bd_addr, bool accept, uint32_t passkey)
Re: Bluetooth Classic pairing on/off
For anyone looking into this as well.
From IDF version 3.3 and up you can disable the "Simple Secure Pairing" via "make menuconfig".
I was on IDF 3.2 thus, the option was not available yet. When you keep SSP on, and your 'other' device does support SSP, the ESP will use SSP even though you have SSP 'commented out'.
But from IDF 3.3 and up, you can disable SSP as whole and then Legacy pairing is in effect. See examples in IDF 3.3.
Also a 16 bit pincode is an option, what I am using now.
Who is online
Users browsing this forum: No registered users and 320 guests