How to disconnect and prevent connection from btstack SPP server?

23 views
Skip to first unread message

Ho Tony

unread,
Oct 27, 2021, 4:14:19 AM10/27/21
to btstack-dev
Matthias,
Situation 1:
  I use the btstack setup a SPP server, and I want the SPP server disconnect the SPP connection and prevent connected by others in some status, I used the rfcomm_disconnect and gap_connectable_control(0), but others still can connect this SPP server, what's wrong?

Situation 2:
Also, some time after disconnection from SPP server, I want to enable the connection, so I call the gap_connectable_control(1), but others cann't scan the SPP server now. Any tips?

I use the CSR8510 and the RPI3 built-in Controller.

Matthias Ringwald

unread,
Oct 28, 2021, 9:45:58 AM10/28/21
to btsta...@googlegroups.com
Hi

see below

> On 27 Oct 2021, at 10:14, Ho Tony <tonyho.p...@gmail.com> wrote:
>
> Matthias,
> Situation 1:
> I use the btstack setup a SPP server, and I want the SPP server disconnect the SPP connection and prevent connected by others in some status, I used the rfcomm_disconnect and gap_connectable_control(0), but others still can connect this SPP server, what's wrong?

If you call gap_connectable_control(0), BTstack will disable Page Scan and other devices cannot connect to it.
Please have a look at the HCI Trace and check that BTstack sends a HCI Write Scan Enable Command with the correct scan type.

>
> Situation 2:
> Also, some time after disconnection from SPP server, I want to enable the connection, so I call the gap_connectable_control(1), but others cann't scan the SPP server now. Any tips?

To find an unknown device, the inquiry process is used. To be found by another is the inquiry scan process. You can enable/disable inquiry scan with gap_discoverable_control(0/1)

Cheers
Matthias

>
> I use the CSR8510 and the RPI3 built-in Controller.
>
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/bd7032cf-0d1d-4c59-9c28-60f29b42624cn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages