我想从串口蓝牙设备接收数据到android手机。但我不知道该设备的UUID如何找到该设备的UUID?
答案 0 :(得分:22)
扩展pwc所说的UUID为0x1101,据我所知,这是UUID的16位版本。我无法弄清楚如何使用16位UUID实例化UUID。但正如this post所说,你可以通过以下方式实现:
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");
这对我来说可以连接到我从Deal Extreme购买的串行蓝牙模块
答案 1 :(得分:6)
答案 2 :(得分:5)
SPP串行端口服务的UUID由蓝牙SIG定义为0x1101。
答案 3 :(得分:0)
在Android蓝牙API文档中:
Create RFCOMM Socket to Service Record - UUID
答案 4 :(得分:0)
只需在adb shell类型sdptool中打开您的设备,然后浏览您的设备UUID
答案 5 :(得分:0)
从API级别15,您可以查询远程设备支持的功能(UUID),使用搜索中获得的BluetoothDevice对象上的方法:
public ParcelUuid[] getUuids ()
答案 6 :(得分:0)
您可以通过简单的呼叫
获取设备UIDperticulerDevice.getUuids()[0].toString()