简体   繁体   English

防止BLE设备连接到GATT服务器

[英]Prevent connection of BLE device to GATT server

Third party BLE device has attempt to connect to my GATT server, the result is that device become inaccessible for his native app. 第三方BLE设备试图连接到我的GATT服务器,结果是该设备无法被其本机应用程序访问。 My wild guess is I should prevent connection of that device to my GATT server, but I don't know how to do that. 我的猜测是我应该阻止该设备连接到我的GATT服务器,但是我不知道该怎么做。 Any suggestion? 有什么建议吗? Thanx 感谢名单

You could configure your GATT server with a White List of devices that you wish to accept connections from. 您可以使用要接受其连接的设备白名单配置GATT服务器。 That way it will not accept connections from any 3rd party devices. 这样,它将不接受来自任何第三方设备的连接。

The decision was not so trivial: it is necessary to clear any links to previously discovered (scanned) BLE devices by onLeScan when app goes to background ( onPause received, but still not onDestroy ). 这个决定并不是那么简单:当应用程序进入后台(收到onPause ,但仍然不是onDestroy )时,有必要通过onLeScan清除到先前发现(扫描)的BLE设备的任何链接。 If you still keeping these links, you'll unable to connect to those devices from other app. 如果您仍然保留这些链接,则将无法从其他应用程序连接到这些设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM