hcidump用法

 hcidump  reads raw HCI data coming from and going to a Bluetooth device

 (which can be specified with the option -i, default is the first avail-

 able  one)  and  prints to screen commands, events and data in a human-

readable form. Optionally, the dump can be written  to  a  file  rather

than parsed, and the dump file can be parsed in a subsequent moment.

1,

hcidump读取发送和接受蓝牙设备的原始hci数据(该设备可以通过-I 参数指定,默认当前第一个有效的连接设备),并按照人可以识别的命令、事件、数据格式打印到屏幕上。转储信息还可以保存到一个当地文件中,从而保证转储文件在后续进行解析。

 

这里主要介绍转储功能。

Adb shell

Hcidump –w /data/1.txt

 

开始使用这个命令时,发现dump信息不是很稳定,有时候能保存有时候不能保存。由于开始我得路径是放置到sdcard上的。怀疑是sdcard不稳定,然后路径放置到data上后,仍然有这种现象,应该是方法问题。

 

后来发现Hcidump执行一次后,并没有消失。Ps后还能够在进程中看到该活动。最后采用了后台运行的方式。在存储命令后加 & ,然后操作蓝牙,能够记录下1.cfa每次都在增加,应该是抓到了dump的数据。

最后将1.txt adb pull出来即可。

 

2,

另外,注意用到的-X参数。

For  every  packet,  not  only is the packet type displayed, but
also all data in hex and ASCII.
对于每个包,不仅仅显示包的类型,而且通过hex和ascii格式显示所有数据。

配合-t参数可以显示全部数据。

Hcidump –Xt

参考:

http://blog.csdn.net/zhaohc_nj/article/details/7990673

芯片公司有专门分析dump的工具,不知道第三方是否有专门工具,还没有找到?

你可能感兴趣的:(android)