-
Notifications
You must be signed in to change notification settings - Fork 7.6k
BluetoothSerial Status && API discussion for passkey/PIN #2320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Regarding your multiple connections question, actually, accepting multiple connections was actually the default behavior of the BluetoothSerial library before commit 0d564d7 which accepted the PR you mentioned and limited incoming connections to a maximum of 1. You can revert the changes of that commit and you will disable the limit, but keep in mind:
Also check #2055 to why the limit was placed. |
Yeah i was aware of these problems. My question was a bit unclear. |
Yes, generally speaking, of course it's possible. Looking at the current BluetoothSerial code (which I suggest that you do - I'm a very novice C coder but I could understand the mechanics easily), I understand that the correct way to implement support for multiple individual and independent clients would not be an easy task. (it would require handling of multiple RX, TX buffers and many other things) But if you need a dirty fix for just simultaneous broadcast to all connected clients, I think it could be implemented with not much effort. The library essentially transmits data in this line:
That _spp_client parameter of esp_spp_write contains the handle of the recipient connected client. The variable receives value when a client is connected here: arduino-esp32/libraries/BluetoothSerial/src/BluetoothSerial.cpp Lines 165 to 174 in 0d564d7
Now, as you can see, currently, the library only stores the handle of the most recently connected client. You could easily modify _spp_client to be a data structure as an array or a queue, and then modify this snippes so that this structure holds the handles of all connected devices and not just the most recent one. Then, you should modify the first part so that you loop between all values of your connected clients handles and use esp_spp_write not just once, but once for each connected client. Of course, you would need a couple more small changes here and there (i.e. handle the disconnect of a client and update your data structure) and it would still be a very dirty fix, but it should work. |
yes, it fixes a packet loss problem and is already merged
no, you can use master if you want
I planned to implement this, initially it would be a fixed PIN passing on begin, like
It's possible, but will they be independent clients? or all the received data will be mixed? how to handle it?
Yes, please, any contributions are welcome !!! |
Can the handle in ESP_SPP_DATA_IND_EVT be used to differentiate between differant clients sending data to the esp? I also get the same handle on ESP_SPP_SRV_OPEN_EVT and ESP_SPP_CLOSE_EVT |
@copercini Now we can turn SSP on/off so can you please try to implement it in BluetoothSerial |
@pacifickashyap this lead us to the 2nd problem: And seems not possible to change it in runtime, maybe @me-no-dev can help us with this =) |
The most significant change is this one: but if we disable |
@copercini can we disable it from sdkconfig.h. If yes how? |
@pacifickashyap arduino core use a aldeady compiled IDF version by @me-no-dev , so we can't change sdkconfig, unless he update it in the next version You can use arduino as an IDF component, then you will compile everything from zero, including the sdkconfig changes |
@Craftplorer |
Thanks, |
@pacifickashyap |
Tried it is working fine. Need to give pin only when new device is paired. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
Stale keep it pls ^_^ |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
Stale keep it pls ^_^ |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
@me-no-dev I see you work in v3.3 idf branch - does the BT pin protection would be enabled using this v3.3 idf version ? or will be in 4.0 only ? |
Thanks it works... |
I Tried to compile the ino file in zip after changing the file in lib, but the following error shows to me. Could somebody help with this |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hello I am new on ESP32, |
@HarpreetHeera using this library how can I set the PIN? (what function should I call?) Thanks |
It seems out-dated, It's meant for core version 1.01, Now we're on 1.04 |
Hello, a lot of people also me, we are trying to find an option to set static PIN on Bluetooth classic serial connection when pairing. A way to input custom PIN not the default 123456.An old way was created for 1.0.1 version adding a custom libbt.a file that was disabling ssp as far as i know .We want to be able to have this option on newer versions. I'll appreciate anyone who really want to help |
Hi,
When i run this example using idf command prompt,
Please help me! Thank you All!! Also, "btc_av_cb.sm_handle != NULL " failed so that i am suspecting
} ...btc_av_init(); is failed to initialize the handle btc_av_cb.sm_handle. |
Nearly 2 years and no official solution from expressif? |
Can you open a new issue referring to this? |
Hi,
i have a few question and topic for possible discussion.
My first question would be what the status on the Branch: bt-serial-overhaul is. Is it already merged? Should future commits/pull-request affecting the BluetoothSerial library be done on this branch?
On #1458 it was already ask for a way to use passkey/PIN with this library. How should a API look like for something like this in a arduino-ish style? Any suggestion?
Currently the BluetoothSerial library is limited to one device connected at a time. #2061
Is there any plan on allowing more devices to recieve serial data via bluetooth?
I would like to contribute by coding some part but need my questions answered before starting to spend time coding.
The text was updated successfully, but these errors were encountered: