【发布时间】:2019-05-21 10:54:31
【问题描述】:
我已经使用 hcitool 在 bluez 中设置了广告,设备按预期播种。
设置如下:
#advertising
sudo hcitool -i hci0 cmd 0x08 0x0008 18 02 01 06 02 0a 00 11 07 9e ca dc 24 0e e5 a9 e0 93 f3 a3 b5 01 00 40 6e 00 00 00 00 00 00 00
#scan response
sudo hcitool -i hci0 cmd 0x08 0x0009 0d 0c 09 6f 6f
#setup advertising interval
sudo hcitool -i hci0 cmd 0x08 0x0006 80 02 c0 03 00 00 00 00 00 00 00 00 00 07 00
#turn advertising on
sudo hcitool -i hci0 cmd 0x08 0x000a 01
在设备连接后,广告就消失了。我如何继续做广告?
我做了一个解决方法,反复调用sudo hcitool -i hci0 cmd 0x08 0x000a 01。
另一个问题是如何使用 d-bus 接口设置上面的广告。
ps。 在Bluetooth specification 5.0 (Core_v5.0.pdf), 7.8.5 LE Set Advertising Parameters command p.1321找到了很多信息
【问题讨论】: