可以知道,电池电量的UUID是0x2A19, 当前温度的notification UUID是0x2A1E
使用gatttool可以读出电量的信息,但是无法读出温度
因为温度属于notification,是需要打开一个开关,来使能接收的。
在网上找到了这个https://stackoverflow.com/questions/15657007/bluetooth-low-energy-listening-for-notifications-indications-in-linux
gatttool 输入char-read-uuid 2902,列出 CCC (Client Characteristic Configuration) 属性
网上说“You can try setting them all to 0100 to get notifications, 0200 for indications, 0300 for both, or 0000 for everything off”
所以,退出gatttool的交互命令,然后输入
gatttool -b 00:60:37:00:00:07 --char-write-req --handle=0x0018 --value=0100 --listen