【发布时间】:2014-05-08 14:31:12
【问题描述】:
我想检测是否使用 gatttool 在我的 SensorTag 上按下了按钮,但我无法做到。
在http://processors.wiki.ti.com/index.php/SensorTag_User_GuideTI 报告中,为了读取按下的按钮,您应该:
1) 通过将值 0x80 写入 AA62 (CONFIGURATION) 属性来启用测试模式。
我用命令做到了:
[CON][BC:6A:29:AE:CD:E5][LE]> char-write-req 0x67 80
[CON][BC:6A:29:AE:CD:E5][LE]> Characteristic value was written successfully
现在我应该处于测试模式,并且:
2) 启用简单按键通知
看着http://processors.wiki.ti.com/index.php/File:BLE_SensorTag_GATT_Server.pdf 在bluepy lib 看来我必须在 0x60 中写 0100 才能做到这一点。但是
[CON][BC:6A:29:AE:CD:E5][LE]> char-write-req 0x60 0100
[CON][BC:6A:29:AE:CD:E5][LE]> Characteristic Write Request failed: Attribute can't be written
我观察到 0x61 是可写的并接受值 0100,但我仍然无法 检测是否按下了某个键。
有什么建议吗?
【问题讨论】:
标签: bluetooth bluetooth-lowenergy sensors texas-instruments