Android在连接BLE设备的时候,遇到连接没多久就自动断开的情况。通过HCI来分析一下。

BLE设备发送连接参数更新请求

390915:53:01.224737TexasIns_f0:d3:41 (Hon-RFID3)HandHeld_e0:e5:4f (EDA)L2CAP21Rcvd Connection Parameter Update Request

回复BLE发送过来的请求

391015:53:01.225744HandHeld_e0:e5:4f (EDA)TexasIns_f0:d3:41 (Hon-RFID3)L2CAP15Sent Connection Parameter Update Response (Accepted)

发送连接更新请求,host通过hci发给controller

391115:53:01.227044hostcontrollerHCI_CMD18Sent LE Connection Update

更新参数操作执行成功。controller发给host。这条命令之后,协议栈会发送命令给出去,给对面的BLE设备。

396315:53:01.566723controllerhostHCI_EVT13Rcvd LE Meta (LE Connection Update Complete)

这边在等待BLE设备的回复,等待超时了。后面就断开。

541015:53:12.491452controllerhostHCI_EVT7Rcvd Disconnect Complete

最后一个帧的内容,显示连接超时。

Frame 5410: 7 bytes on wire (56 bits), 7 bytes captured (56 bits)

Encapsulation type: Bluetooth H4 with linux header (99)

Arrival Time: Apr 25, 2019 23:53:12.491452000 China Standard Time

[Time shift for this packet: 0.000000000 seconds]

Epoch Time: 1556207592.491452000 seconds

[Time delta from previous captured frame: 0.001655000 seconds]

[Time delta from previous displayed frame: 0.001655000 seconds]

[Time since reference or first frame: 86.503400000 seconds]

Frame Number: 5410

Frame Length: 7 bytes (56 bits)

Capture Length: 7 bytes (56 bits)

[Frame is marked: False]

[Frame is ignored: False]

Point-to-Point Direction: Received (1)

[Protocols in frame: bluetooth:hci_h4:bthci_evt]

Bluetooth

[Source: controller]

[Destination: host]

Bluetooth HCI H4

[Direction: Rcvd (0x01)]

HCI Packet Type: HCI Event (0x04)

Bluetooth HCI Event - Disconnect Complete

Event Code: Disconnect Complete (0x05)

Parameter Total Length: 4

Status: Success (0x00)

Connection Handle: 0x0002

Reason: Connection Timeout (0x08)

而另外一个台设备, 却不会断开,第一个帧显示对面LE设备所能支持结构,其中Connection Parameters Request Procedure: False,表示不支持更新参数请求。

第一个帧:

140815:57:13.490071controllerhostHCI_EVT15Rcvd LE Meta (LE Read Remote Used Features Complete)

第一个帧的内容:

Frame 1408: 15 bytes on wire (120 bits), 15 bytes captured (120 bits)

Encapsulation type: Bluetooth H4 with linux header (99)

Arrival Time: Apr 25, 2019 23:57:13.490071000 China Standard Time

[Time shift for this packet: 0.000000000 seconds]

Epoch Time: 1556207833.490071000 seconds

[Time delta from previous captured frame: 0.002823000 seconds]

[Time delta from previous displayed frame: 0.002823000 seconds]

[Time since reference or first frame: 39.218678000 seconds]

Frame Number: 1408

Frame Length: 15 bytes (120 bits)

Capture Length: 15 bytes (120 bits)

[Frame is marked: False]

[Frame is ignored: False]

Point-to-Point Direction: Received (1)

[Protocols in frame: bluetooth:hci_h4:bthci_evt]

Bluetooth

[Source: controller]

[Destination: host]

Bluetooth HCI H4

[Direction: Rcvd (0x01)]

HCI Packet Type: HCI Event (0x04)

Bluetooth HCI Event - LE Meta

Event Code: LE Meta (0x3e)

Parameter Total Length: 12

Sub Event: LE Read Remote Used Features Complete (0x04)

Status: Success (0x00)

Connection Handle: 0x0002

Supported LE Features: 0x0000000000000001, LE Encryption

.... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ...1 = LE Encryption: True

.... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ..0. = Connection Parameters Request Procedure: False

.... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .0.. = Extended Reject Indication: False

.... .... .... .... .... .... .... .... .... .... .... .... .... .... .... 0... = Slave-Initiated Features Exchange: False

.... .... .... .... .... .... .... .... .... .... .... .... .... .... ...0 .... = Ping: False

.... .... .... .... .... .... .... .... .... .... .... .... .... .... ..0. .... = Data Packet Length Extension: False

.... .... .... .... .... .... .... .... .... .... .... .... .... .... .0.. .... = LL Privacy: False

.... .... .... .... .... .... .... .... .... .... .... .... .... .... 0... .... = Extended Scanner Filter Policies: False

.... .... .... .... .... .... .... .... .... .... .... .... .... ...0 .... .... = LE 2M PHY: False

.... .... .... .... .... .... .... .... .... .... .... .... .... ..0. .... .... = Stable Modulation Index - Tx: False

.... .... .... .... .... .... .... .... .... .... .... .... .... .0.. .... .... = Stable Modulation Index - Rx: False

.... .... .... .... .... .... .... .... .... .... .... .... .... 0... .... .... = LE Coded PHY: False

.... .... .... .... .... .... .... .... .... .... .... .... ...0 .... .... .... = LE Extended Advertising: False

.... .... .... .... .... .... .... .... .... .... .... .... ..0. .... .... .... = LE Periodic Advertising: False

.... .... .... .... .... .... .... .... .... .... .... .... .0.. .... .... .... = Channel Selection Algorithm #2: False

.... .... .... .... .... .... .... .... .... .... .... .... 0... .... .... .... = Power Class 1: False

.... .... .... .... .... .... .... .... .... .... .... ...0 .... .... .... .... = Minimum Number of Used Channels Procedure: False

0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 000. .... .... .... .... = Reserved: 0x000000000000

[Command in frame: 1393]

[Pending in frame: 1398]

[Pending-Response Delta: 54.527ms]

[Command-Response Delta: 57.991ms]

虽然不支持更新参数请求,但是却发了更新参数请求过来,这个现象比较奇怪。

参数更新请求。

269815:57:19.440508TexasIns_f0:d3:41 (Hon-RFID3)localhost ()L2CAP21Rcvd Connection Parameter Update Request

请求回复。

270215:57:19.441762localhost ()TexasIns_f0:d3:41 (Hon-RFID3)L2CAP15Sent Connection Parameter Update Response (Accepted)

发送更新过去。

270515:57:19.442326hostcontrollerHCI_CMD18Sent LE Connection Update

这条命令没有处理,应为没有controller通过hci发给host的命令回复,所以没有处理。就不会存在后面的等待超时。

android hci设备,Android Bluetooth hci 命令分析相关推荐

  1. Android cec设备,Android和HDMI CEC

    是的,这是完全有可能做的,但它是非常可笑的. HDMI CEC像公共汽车一样工作.通常在两个方向. 你的问题: >是的.虽然我使用JNI访问实际工作的本机代码.您可能可以纯粹在Java中执行此操 ...

  2. android lunch 选择写入脚本,Android源码编译之 lunch命令分析及user和userdebug编译选项区别...

    不同厂商在编译Android系统时,会选择不同产品和编译版本.在Android编译过程中,通过source,lunch来选择. 1.souuce build/envsetup.sh:加载命令 2.lu ...

  3. Android cec设备,Android 9 CEC架构

    vendor\amlogic\common\frameworks\services\hdmicec hardware\amlogic\hdmi_cec vendor/amlogic/common/in ...

  4. Android cec设备,Android HDMI CEC控制服务

    HDMI-CEC标准允许多媒体消费产品之间沟通和交换信息,HDMI-CEC支持许多功能,比如遥控器直通,系统音频控制,一键播放等等.Android通过HdmiControlService这个系统服务来 ...

  5. Android Bluetooth hci 命令分析

    Android在连接BLE设备的时候,遇到连接没多久就自动断开的情况.通过HCI来分析一下. BLE设备发送连接参数更新请求 3909 15:53:01.224737 TexasIns_f0:d3:4 ...

  6. android 蓝牙扫描流程,Android 9.0 Bluetooth源码分析(二)蓝牙扫描流程

    1 UI 蓝牙开始扫描位于setting的 /packages/apps/Settings/src/com/android/settings/bluetooth/BluetoothPairingDet ...

  7. 【Android 逆向】Android 逆向通用工具开发 ( adb forward 网络端口重定向命令 | PC 端逆向程序主函数分析 )

    文章目录 前言 一.adb forward 网络端口重定向命令 二.PC 端逆向程序主函数分析 前言 本篇博客重点分析 PC 端 hacktool 模块 ; 一.adb forward 网络端口重定向 ...

  8. Android设备 D获取,如何获取Android设备名称(常用ADB命令介绍)

    如何获取Android设备名称 sdk安装和配置 1.Android SDK 工具的安装,下载地址:https://www.androiddevtools.cn 2.环境变量配置 2.1:增加选项AN ...

  9. Android ADB设备离线,无法发出命令

    本文翻译自:Android ADB device offline, can't issue commands I can't connect to my device anymore using AD ...

  10. Android实现蓝牙(BlueTooth)设备检测连接

    项目要求实现蓝牙设备搜索连接,Android为蓝牙技术提供了4个工具类,分别是蓝牙适配器BluetoothAdapter.蓝牙设备BluetoothDevice.蓝牙服务端套接字BluetoothSe ...

最新文章

  1. SCLS:巴斯德所崔杰组揭示海洋无脊椎动物RNA病毒的遗传多样
  2. C#操作SqlServer数据库的常用对象,及其方法
  3. php中mysql,PHP中的mysql
  4. 编写MyLayer,2 锚点,3 精灵的创建,4 zorder
  5. Apache Velocity官方指南-资源
  6. 使用扩展技术对SAP Fiori应用进行端到端的增强,一个实际案例介绍
  7. 第三十四期:一次非常有意思的sql优化经历
  8. [密码学基础][每个信息安全博士生应该知道的52件事][Bristol Cryptography][第25篇]使用特殊的素数定义GF(p)和GF(2^n)的方法
  9. 模型训练太慢?显存不够用?这个算法让你的GPU老树开新花
  10. html5怎么设置字体闪动,HTML最简单的文字闪烁代码
  11. mysql select in 不存在返回0_MySQL索引优化看这篇文章就够了!
  12. flutter持久化_【Flutter 实战】大量复杂数据持久化
  13. 解决iOS app集成共享QQ场地,微信的朋友,朋友等功能圈,不能采用苹果公司的审计问题...
  14. JOHNSON算法:流水作业最优调度问题
  15. 线性代数-n维向量知识点总结
  16. 3.8 main.js-常用配置【uni-app教程uniapp教程(黄菊华-跨平台开发系列教程)】
  17. 外置USB供电与内置锂电池供电自动切换电路,便携电子设备常用,经典电路必须掌握...
  18. css实现立体长方柱
  19. 1315: 小鱼比可爱
  20. 想成为我的同事,不会点Linux怎么行!

热门文章

  1. 【HTML】font标签font属性的使用方法
  2. 苹果手机html5定位,苹果手机常去地点可以记录多长时间?
  3. ps计算机二级自学教程,计算机二级考试《Photoshop图像处理与制作》
  4. nutch添加imdict-chinese-analyzer实现中文分词
  5. 证件照缩小为20k大小
  6. win10扬声器红叉_win10系统右下角小喇叭红叉显示扬声器耳机或者耳机已拔出的图文技巧...
  7. 互联网+机器人”碰撞出啥样火花? 华数机器人以大数据云平台为智能制造连接“大脑”...
  8. 新浪微博开放平台API访问频率限制解决方法
  9. 5G消息亮相2021国际数字科技展暨天翼智能生态博览会
  10. jmp指令流程图怎么写_NS流程图是什么?规范实用的流程图工具