Android:获取蓝牙设备的uuid
我需要蓝牙设备的 UUID 才能连接到它,但我对 uuid 不太了解。它是否特定于每个设备以及如何知道设备的 uuid
是什么。可以用代码来完成吗?
I need UUID of a bluetooth device to connect to it, but i don't know much about uuid. Is it specific to each device and how to know what is device's uuid
. Can it be done using code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当你提出问题时,你应该更加明确。您想要连接到 BT 设备,还是已经连接并且想要使用特定服务?
如果您只想连接到设备,则需要 BT 地址(
如 MAC
)。UUID 与 BT 设备提供的服务相关: http:// www.bluecove.org/bluecove/apidocs/javax/bluetooth/UUID.html 这里有一个 UUID 列表。
You should be more explicit when you make your question. Do you want to connect to a BT device, or you are already connected and you want to use a particular service?
If you want to just connect to the device you need the BT address (
like a MAC
).The UUID are related to the services offered by the BT device: http://www.bluecove.org/bluecove/apidocs/javax/bluetooth/UUID.html Here you have a list of UUIDs.
使用 adb shell、sdptool browser 命令生成手机的
UUID
Generate
UUID
of your phone by using adb shell, sdptool browse command