Concurrent GATT & L2CAP Connections between 2 Devices

245 views
Skip to first unread message

Alec Labadie

unread,
Dec 3, 2021, 4:38:32 PM12/3/21
to btstack-dev
Hello, 

I was wondering if anybody on here knows whether or not it is possible to have two active connections simultaneously between two devices.
 
Device A would be the central role in one connection and that same device would take on the role of peripheral in the other active connection. The other device, Device B, would then take on the peripheral and central roles, respectively. Device B would be an iOS phone and Device A would be a Raspberry Pi. One connection would use GATT/ATT and the other would be an L2CAP channel. 

If that isn't possible, would it be possible to have Device A advertise two separate services using btstack and then have Device B act as the central and connect/subscribe to both services at the same time? 

A post on Stack Overflow seems to conclude that it might be possible but not technically within the bluetooth spec.
https://stackoverflow.com/questions/54579999/can-a-single-ble-central-connect-with-multiple-ble-peripherals-via-bluetooth-low#54580331
Another post on this group ( https://groups.google.com/g/btstack-dev/c/FjEhludeL6U ) seems to ask a similar question but with SPP. 

Any feedback or references would be appreciated! Thank you.

Alec Labadie

unread,
Dec 3, 2021, 4:54:53 PM12/3/21
to btstack-dev
To clarify, in the second scenario Device A would have two btstack apps/processes advertising their own unique services. Device B would then connect to both services at the same time. 

And if none of these are possible, would it be possible to have two concurrent L2CAP channels open between the two devices?

Matthias Ringwald

unread,
Dec 4, 2021, 4:55:45 PM12/4/21
to btsta...@googlegroups.com
Hi Alec

Could you tell what you want to implement on a higher level?

If both devices support multiple LE Roles, it's possible to create two HCI connections between devices.
However, gnereally there is no need for this and there are also no benefits compared to the use of a single HCI connection.

You can have any kind of service over the HCI connection, e.g. you could have a GATT Client as well as a GATT Server on the same device. You can also be client or server for an L2CAP Channel in Credit-based Flow-Control Mode in addition.

Best
Matthias
> --
> 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/4ba890ce-9407-49ff-b630-852c15400ad5n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages