Attribute requires authentication before read/write

江枫思渺然 提交于 2019-12-01 06:40:53

问题


I am using a Linux computer with bluez version 4.101. I am communicating with a BLE device in slave mode. I am trying to read data from the BLE device. But when I do that the read fails with the following error: "Attribute requires authentication before read/write". I can read data from many other characteristics but I fail on this one. The commands I am using are

-gatttool -b 11:22:33:44:55:66 --char-read

What do I need to do to read this data?

Note: I can read this data from my iPhone. But I need to pair, so maybe it is a pairing issue.


回答1:


Try using --sec-level=medium or --sec-level=high with gatttool. I'm not sure how those work, but essentially you don't have the right level of security to read that attribute. Pairing ups your security level, and that's why it works on your iPhone.

You may also want to try -I for an interactive prompt with gatttool.



来源:https://stackoverflow.com/questions/24046351/attribute-requires-authentication-before-read-write

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!