BLE SPP mode sending unexpected AT events

espc6user
Posts: 5
Joined: Mon Oct 21, 2024 9:33 am

BLE SPP mode sending unexpected AT events

Postby espc6user » Fri Nov 01, 2024 11:29 am

Hi everyone,

I'm experiencing a strange behavior whilst in BLE SPP mode.
My use case is the following:
1. Setup ESP-C6 as BLE server
2. Pair with client
3. Trigger the SPP trasnmission (AT+BLESPP)
4. Send/recv data over BLE
5. Client (Linux python script using bluepy stack) stops streaming and triggers disconnect

What kind of response should I expect when the client is disconnecting from the BLE server?

I would expect the following flow to be sent from ESP as AT messages:
1. +QUITT - SPP data mode turned off
2. +BLEDISCONN

I receive the following information in a single message:
+WRITE: <data>
+BLEDISCONN

The next message that I receive the end SPP data mode event:
+QUITT


My questions are:
1. Should I receive AT events whilst in BLE SPP data mode? Are we suppose to parse each message to avoid such a behavior?
2. Shouldn't +QUITT be sent before +BLEDISCONN has been generated?

Thanks

aliarifat794
Posts: 198
Joined: Sun Jun 23, 2024 6:18 pm

Re: BLE SPP mode sending unexpected AT events

Postby aliarifat794 » Fri Nov 01, 2024 1:19 pm

On receiving +BLEDISCONN, check for +QUITT if it hasn’t already been received. This way, you can handle state cleanup in the correct sequence.

espc6user
Posts: 5
Joined: Mon Oct 21, 2024 9:33 am

Re: BLE SPP mode sending unexpected AT events

Postby espc6user » Mon Nov 11, 2024 2:47 pm

Unfortunately that notification hasn't been transmitted. I only got it if I performed the disconnection from the other endpoint.

Who is online

Users browsing this forum: uTasker and 25 guests