我记得做了一些类似于你所描述的事情并且能够很好地连接。但是,没有列出任何指示/通知的特征,因此除了真正的基本元数据(设备类型、设备名称等)外,我无法从设备获取任何数据。
我今天只是尝试做同样的事情,但我似乎根本无法建立连接,直到我告诉它使用随机类型的地址。
这是我之前让它工作时记录的结果:
# gatttool -b EB:47:1D:11:11:11 --addr-type=random --primary
attr handle = 0x0001, end grp handle = 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle = 0x0008, end grp handle = 0x0008 uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle = 0x0009, end grp handle = 0x000e uuid: adabfb00-6e7d-4601-bda2-bffaa68956ba
attr handle = 0x000f, end grp handle = 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb
# gatttool -b EB:47:1D:11:11:11 --addr-type=random --characteristics
handle = 0x0002, char properties = 0x02, char value handle = 0x0003, uuid = 00002a00-0000-1000-8000-00805f9b34fb
handle = 0x0004, char properties = 0x02, char value handle = 0x0005, uuid = 00002a01-0000-1000-8000-00805f9b34fb
handle = 0x0006, char properties = 0x02, char value handle = 0x0007, uuid = 00002a04-0000-1000-8000-00805f9b34fb
handle = 0x000a, char properties = 0x12, char value handle = 0x000b, uuid = adabfb01-6e7d-4601-bda2-bffaa68956ba
handle = 0x000d, char properties = 0x06, char value handle = 0x000e, uuid = adabfb02-6e7d-4601-bda2-bffaa68956ba
handle = 0x0010, char properties = 0x02, char value handle = 0x0011, uuid = 00002a29-0000-1000-8000-00805f9b34fb
handle = 0x0013, char properties = 0x02, char value handle = 0x0014, uuid = 0000fb00-0000-1000-8000-00805f9b34fb
您可能必须配对设备才能获得实际有用的数据……不知道该怎么做。