用于Android中多个蓝牙连接的自定义UUID [英] Custom UUID for multiple Bluetooth connection in Android
问题描述
我有一个充当服务器的android设备,该设备连接到多个蓝牙android客户端.我了解UUID的概念及其独特性.
I have an android device acting as server which connects to multiple bluetooth android clients. I understand the concept of UUID and how it is unique.
我的问题是,我可以对连接到服务器的所有客户端使用相同的UUID吗?如果没有,我该如何以编程方式为客户生成一个UUID,并让我的服务器知道他们的UUID.
My question is, can I use the same UUID for all my clients connecting to my server? If not, how do I generate a UUID for my clients programmatically and let my server know about their UUIDs.
在Android 8.1之后,问题开始出现,您再也无法访问我最初用来为客户端android设备生成UUID的蓝牙MAC地址.
The problem started appearing after Android 8.1 where you no longer had access to bluetooth MAC address which I initially used to generate UUIDs for client android devices.
推荐答案
答案:
我终于发现,您可以通过生成器使用自定义UUID,并且它可以在多个设备上使用.UUID必须是唯一的,并且不得与常见的UUID冲突.民众.希望有人觉得它有用
I finally found out that you can use a custom UUID using a generator and it works with multiple devices. The UUID must be unique and should not collide with the ones that are common & public. Hopefully someone finds it useful
这篇关于用于Android中多个蓝牙连接的自定义UUID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!