我是bluez的新用户,我正在尝试使用bluez API并使用NDK开发本机代码c,以使android 4.0.3支持BLE
我阅读了Bluez的代码源,但找不到与连接GATT一样的确切功能.
任何帮助将不胜感激.
谢谢!
解决方法:
我认为您在尝试通过阅读Bluez源代码来弄清所需内容时走了正确的路,但是您需要确切地了解要查找的内容.如果您只想实现BLE功能,请从here获取bluez包,并查看实现大多数BLE功能的两个特定源文件:
>工具/hcitool.c
> attrib / gatttool.c
通常,基本的blueZ shell命令为:
hcitool lescan #scanning for LE deviceshcitool lecc #connecting to LE deviceshcitool ledc #disconnecting from LE devicesgatttool -b <MAC Address> --primary #discover primary servicesgatttool -b <MAC Address> --characteristics #discover characteristicsgatttool -b <MAC Address> --char-read #read characteristic valuegatttool -b <MAC Address> --char-write #write to a characteristic value
然后,您可以通过在上述源文件中查找那些命令并查看其执行方式来进行一些反向工程.
我希望这至少可以为您指明正确的方向.
总结以上是内存溢出为你收集整理的使用bluez在Android下移植BLE全部内容,希望文章能够帮你解决使用bluez在Android下移植BLE所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)