Skip to content
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

Add support for BLE SPP normal transmission mode #858

Open
JHedgesBartec opened this issue Jul 25, 2024 · 2 comments
Open

Add support for BLE SPP normal transmission mode #858

JHedgesBartec opened this issue Jul 25, 2024 · 2 comments

Comments

@JHedgesBartec
Copy link

JHedgesBartec commented Jul 25, 2024

Is your feature request related to a problem?

Both BT Classic and Wi-FI have support for normal transmission mode when using the respective send commands. When maintaining multiple connections having normal mode is beneficial.
Switching into passthrough mode for BLE SPP makes handling BT/Wi-Fi data difficult.

Describe the solution you'd like.

A method of sending data to a BLE SPP connection in normal mode, where once the data is transmitted to the ESP32 module, the module returns OK and returns to normal command mode.
For example adding length to the AT+BLESPP command or a new send command such as AT+BLESPPSEND=<length> which could work similar to AT+BTSPPSEND and AT+CIPSEND

Describe alternatives you've considered.

No other approach.

Additional context.

No response

@JavierReyes945
Copy link

JavierReyes945 commented Jul 30, 2024

@JHedgesBartec:

I recently worked this situation myself, and discovered that you can use the SPP without activating the passthrough mode.

What I do is to configure SPP as normal (based on the example code)

- AT+BLESPPCFG=1,1,7,1,5

But i do not activate the SPP Mode (I do not enter AT+BLESPP command).

When the connection is made, I will receive data from the remote device written to the RX channel (characteristic 304 registered for RX in SPP in the examples) as:

+WRITE:0,1,5,,<len>,<data>\r\n

And when we want to send, we use the characteristic registered for TX (it has to be property notify or indicate according to documentation, so in our case we use the 306, which has been subscribed in remote device):

AT+BLEGATTSIND=0,1,7,<len>\r\n

After this command, we receive 1 byte (the prompt symbol >), then we send the raw data (as many bytes as in announced, and we receive a confirmation message \r\OK\r\n.

It works for us on v4.0.0.0/release and in master branch of the ESP-AT firmware (our device is ESP32-C6-MINI-1). It is not documented to work like it, so it would be better if we get a clear answer from Espressif for this, but for now it works for us and might work for you.

@JHedgesBartec
Copy link
Author

@JavierReyes945
Thank you for taking the time to respond and sharing your solution, we will certainly look at using that approach.

As you say it would be good to get an answer from Espressif for this, I will leave the issue open until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants