admin管理员组文章数量:1435846
I'm developing an Android application that uses Bluetooth Low Energy (BLE) for communication.
I want to know if it is possible for a single device to function as both a GATT Server and a GATT Client.
For example, if I install the app on two devices, Device A and Device B, can both devices continuously run BLE advertising, BLE scanning, and act as GATT servers?
When they detect each other, can one device connect to the other as a GATT Client?
Additionally, if this is possible, can both devices establish a mutual relationship where each acts as a client to the other's server?
I created a demo application, and while I was able to successfully detect both devices, when I execute device.connectGatt(), there is no response in the GattClientService. Instead, the following logs appear on the GattServerService side.
As you can see, once the device connects to the GATT server, it gets disconnected, and the onConnectionStateChange() callback is invoked.
本文标签:
版权声明:本文标题:kotlin - Is it possible for an Android device to act as both GATT Server and GATT Client simultaneously? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745644021a2668027.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论