Disconnect from Serial Port Protocol SPP over API

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
aglier
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Hi there,

 

I was reading the API documentation for EZSerial Commands in Document EZ-Serial WICED Firmware Platform User
Guide for CYW2070x-based Modules

Under capital 7.2.9.6. I found the command bt_disconnect (/BTDIS, ID=14/6

This is supposed to disconnect from an existing SPP connection.

However, when I try to send that command with and active SPP connection, the data will be forwarded directly over SPP instead of disconnecting.

How is this supposed to work? Is there a special escape sequence? Or can I only disconnect by using the pin that is described under capitel 3?

 

Best regards

Alex

0 Likes
1 Solution
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

Very sorry for the mistake in the document. The /BTDIS command is not supported now. You can use the GPIO to terminate the spp connection.

View solution in original post

4 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

Very sorry for the mistake in the document. The /BTDIS command is not supported now. You can use the GPIO to terminate the spp connection.

Hi Owen,

thank you for your quick response.

 

I tried to use the Pin today and it seemed to work as expected:

my SPP connection was closed right away.

But now it seems that afterwards I wasn't able to perform an GAP connect to a BLE device.

In the documentation there are some confusing parts regarding the disconnected pin and CYSPP.

Is it true that CYSPP will be activated after I pulled up the pin (to disconnect from SPP) and therefor blocks my GAP Connect attemps?

I would really appreciate if you could help me on this topic.

Out use case is to setup either a connection to BLE (GATT, no CYSPP) OR Bluetooth Classic (SPP).

But we also need to be able to disconnect in both cases and reconnect using one or the other type of connection.

 

Best regards

Alex

0 Likes
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

when you pull up the CYSPP pin:

1. If you are in the SPP connection, it will exit the SPP connection. You can connect it with a SPP or BLE device again. You may need to restart the BLE adv in case it is stopped.

If you are in the BLE CYSPP connection, it will only exit the CYSPP function. The BLE connection will still maintain. You need to send command to disconnect.

0 Likes

Hi Owen,

and thanks again.

 

I'm observing the follow:

  • Perform BT Inquiry until "inquiry complete event" is received
  • Connect to desired device by using the mac address -> success indicated by bt_connected event
  • everything fine so far, i can transmit data as expected
  • Pull up CYSPP pin -> SPP connection gets closed (as expected)
  • After pulling up the pin I let it floating afterwards (I use the CYBT 343026 EVAL 02 Board, maybe it is pulling it down)
  • Now I send a gap_start_scan command
  • I get the scan result events etc.
  • After gap_scan_state_changed event (scan timeout/finish) I try to to connect via gap_connect
  • I receive the response for that command but nothing happens. i never receive a gap_connected event (not as expected)

 

Now I tried a few things to get out of this state:

  • stopping advertising
  • setting cyspp parameters to disabled
  • reboot command

Nothing helped

The only thing that brings the expected behavior back is the factory reset command.

After placing that, I will be able to connect and discover services etc.

It feels like this has to do with the pull up pin and CYSPP. Can you please help me with this ?

 

Best regards

Alex

0 Likes