Problems with Android Bluetooth Gatt Server / Client Simultaneous Connection

I am working on creating an application that can work both client and server for gatt connections at the same time, but I get an unknown status and a disconnected state every time I start the server while it behaves like a client.

This is the process right now:

1) Run one phone as server (Phone1)

2) Run another phone as a client (Phone2)

3) Connect Phone2 to Phone1 and receive notifications about the current time.

4) Launch the server gatt server on Phone2, and it is there that I get an unknown status for my Bluetooth gatt call. First, it disconnects Phone2 from Phone1 (breaking the gatt connection), then Phone2 onConnectionStateChange for Bluetooth GattCallBack returns the disconnected state and status code.

I'm not quite sure what could be the reason for this, but both phones are identical to the Motorola XT1526 API level 22. Is it possible that this is a hardware problem when the phone cannot work both the gatt server and the client at the same time? I also tried using the same bluetooth adapter object for the same client and phone server, but also two separate bluetooth adapter objects. Any help would be greatly appreciated.

+4
1

Bluetooth ( Bluetooth Spec 4.2, 6, B 4.5: ):

" LE . , . , , .

, Android , .

0

Source: https://habr.com/ru/post/1629653/


All Articles