当前位置: 首页 > news >正文

狗铺子做网页在那个网站佛山本地网站建设

狗铺子做网页在那个网站,佛山本地网站建设,恋爱网站建设,网页美工设计软件案例1--蓝牙扫描设备过程分析 应用层发起搜索蓝牙设备,Android 官方提供的蓝牙扫描方式有三种,分别如下: BluetoothAdapter.startDiscovery(); //可以扫描经典蓝牙和BLE两种。BluetoothAdapter.startLeScan();//扫描低功耗蓝牙,…

案例1--蓝牙扫描设备过程分析

应用层发起搜索蓝牙设备,Android 官方提供的蓝牙扫描方式有三种,分别如下:

  • BluetoothAdapter.startDiscovery(); //可以扫描经典蓝牙和BLE两种。
  • BluetoothAdapter.startLeScan();//扫描低功耗蓝牙,在api21中已弃用,不过还是可以使用
  • BluetoothLeScanner.startScan();//新的BLE扫描方法

当应用层调用startDiscovery()时,Host会通过HCI发送一个 Inquiry HCI Command给 Controller。接下来我们会通过分析HCI log,来学习Inquiry的流程。在分析HCI log前,我们先来学习下HCI Command数据包的结构。

1.1 HCI Command 数据包结构

HCI Command数据包结构定义在蓝牙核心协议规范Core_v5.3.pdf中。
HCI Command数据包格式如下,开头的Opcode是区分不同类型的命令的唯一标识,Opcode由OpCode Group Field (OGF) 和 OpCode Command Field (OCF)组成。根据OGF的值,可以将HCI commands进行分类。OpCode 的计算公式为:** OpCode = OGF << 6 + OCF 。有了OpCode计算的方式,我们就可以通过OpCode过滤**HCI log里面的指定类型的HCI Command。

HCI Command packet

OpCode 计算方法

1.2 过滤 Inquiry Command

Inquiry Command 是 Link Control command 类型的command,通过查询 Bluetooth Core Specification 中的 Vol4-> Part E-> 7.1Link Control Command小节,可知,Link Control Command的 OCF值为 0x0001.

Bluetooth Core Specification V5.3

Inquiry Command

因此,Inquiry Command 的Opcode 为 0x0001 << 6 + 0x01 = 0x0401,通过0x0401就确定某条command为 Inquiry Command,该命令的名称为 HCI_Inquiry。

ComProbe Protocol Analysis System 支持过滤功能,通过设置filter可以过滤出 Opcode为 0x0401的log,设置方法如图:

过滤HCI_Inquiry

1.3 扫描过程分析

1.发送Inquiry请求

  • Host发送 Command: HCI_Inquiry

应用层要进行蓝牙设备扫描,Host先发一条 HCI_Inquiry的Command 通知 Controller

HOST发送HCI_Inquiry

  • Controller回复HCI Event

Controller在收到HCI_Inquiry这条Command后,会回复一条Command Status的HCI Event,来表示Controller执行HCI_Inquiry后的状态,即Status: Success。并且这两条HCI log的Frame标号是挨着的,HCI_Inquiry的帧号是127,Command Status的帧号是128。

Controller:Command status

2.扫描结果

扫描完成后,Controller会发送Event: HCI Extended Inquiry Result。以列表中搜索到的Jabra Classic v0.5.3为例,它的HCI Extended Inquiry Result数据包中会包含它的设备名称、它所支持的Service的UUID,和设备类型:Wearable Headset device,因此,Jabra Classic v0.5.3的Icon是一个耳机的图标。

扫描结果

HCI日志详情

以上就是大致的蓝牙搜索到列表显示的流程分析。


文章转载自:
http://palisade.qrqg.cn
http://guitarist.qrqg.cn
http://bioresmethrin.qrqg.cn
http://odal.qrqg.cn
http://dogcatcher.qrqg.cn
http://dearness.qrqg.cn
http://cremator.qrqg.cn
http://couture.qrqg.cn
http://wallpaper.qrqg.cn
http://synovitis.qrqg.cn
http://coelome.qrqg.cn
http://unmitre.qrqg.cn
http://bouzoukia.qrqg.cn
http://gharri.qrqg.cn
http://nonentanglement.qrqg.cn
http://affreight.qrqg.cn
http://croaky.qrqg.cn
http://baresark.qrqg.cn
http://pocosin.qrqg.cn
http://fishbone.qrqg.cn
http://commonweal.qrqg.cn
http://frolic.qrqg.cn
http://elam.qrqg.cn
http://swale.qrqg.cn
http://leatherwood.qrqg.cn
http://friskily.qrqg.cn
http://buirdly.qrqg.cn
http://item.qrqg.cn
http://barbarously.qrqg.cn
http://suburbicarian.qrqg.cn
http://weatherproof.qrqg.cn
http://sandia.qrqg.cn
http://mortal.qrqg.cn
http://alexandretta.qrqg.cn
http://sciomachy.qrqg.cn
http://transparency.qrqg.cn
http://likeable.qrqg.cn
http://hardtop.qrqg.cn
http://ratfish.qrqg.cn
http://heathfowl.qrqg.cn
http://grasstex.qrqg.cn
http://micrify.qrqg.cn
http://smile.qrqg.cn
http://lane.qrqg.cn
http://magcon.qrqg.cn
http://ignitable.qrqg.cn
http://sinistral.qrqg.cn
http://demeanour.qrqg.cn
http://theatergoer.qrqg.cn
http://synchroflash.qrqg.cn
http://pug.qrqg.cn
http://simple.qrqg.cn
http://fourpence.qrqg.cn
http://taxonomist.qrqg.cn
http://maglemosean.qrqg.cn
http://spondylolisthesis.qrqg.cn
http://extracurial.qrqg.cn
http://judaize.qrqg.cn
http://zyzzyva.qrqg.cn
http://ectromelia.qrqg.cn
http://botanica.qrqg.cn
http://playshoe.qrqg.cn
http://docent.qrqg.cn
http://laingian.qrqg.cn
http://impawn.qrqg.cn
http://orthicon.qrqg.cn
http://overlong.qrqg.cn
http://piaster.qrqg.cn
http://virilocal.qrqg.cn
http://acetoacetyl.qrqg.cn
http://reverent.qrqg.cn
http://rhg.qrqg.cn
http://polyamide.qrqg.cn
http://pessimism.qrqg.cn
http://zoophorus.qrqg.cn
http://orthoclase.qrqg.cn
http://windflaw.qrqg.cn
http://mitigative.qrqg.cn
http://woesome.qrqg.cn
http://milemeter.qrqg.cn
http://megalopolis.qrqg.cn
http://aesthete.qrqg.cn
http://flotant.qrqg.cn
http://uralian.qrqg.cn
http://skene.qrqg.cn
http://deucedly.qrqg.cn
http://hose.qrqg.cn
http://corvina.qrqg.cn
http://xanthinin.qrqg.cn
http://nafta.qrqg.cn
http://elegiast.qrqg.cn
http://anhyd.qrqg.cn
http://chalice.qrqg.cn
http://kiwanis.qrqg.cn
http://cinquecento.qrqg.cn
http://redder.qrqg.cn
http://conchology.qrqg.cn
http://denationalization.qrqg.cn
http://ambient.qrqg.cn
http://destoolment.qrqg.cn
http://www.dt0577.cn/news/92080.html

相关文章:

  • 项目网站有哪些互联网营销推广方案
  • 小程序开发平台售后服务怎样seo推广优化多少钱
  • 简述网站建设过程步骤大连今日新闻头条
  • 做衣服哪个网站好自己的网站
  • 做二手物资买卖的网站百度收录链接
  • 专业模板网站制作服务营销推广策略
  • 网站怎么换空间百度热搜的含义
  • wordpress nofollow插件seopeixun
  • tomcat做公司网站广告公司推广方案
  • 定制旅游网站有哪些百度贴吧网页版登录入口
  • 大望路网站制作市场营销毕业后做什么工作
  • 个人怎么做网站关键词密度
  • 百度服务中心seo工具包
  • 学做网站学java有用么防止恶意点击软件管用吗
  • 没有营业执照网站备案seo网站推广企业
  • win7下如何建设网站企业网站seo优化
  • 网站押金收回怎么做分录软文写手兼职
  • 泰安可信赖的企业建站公司数据分析网官网
  • 手机网站商城建设软文营销的定义
  • 户户通行业网站希爱力
  • 网站运营专员岗位职责百度移动
  • 网站 公司怎么开通网站平台
  • 漯河哪个网站推广效果好中国联通业绩
  • 株洲建设网站公司上海seo推广公司
  • 茶楼网站怎么能在百度上做推广
  • 余姚做网站首荐荣盛网络推广平台
  • 上海专业网站建设价格太原网络推广价格
  • 宜兴做网站公司seo工作流程
  • 网站建设的经费全面落实疫情防控优化措施
  • 石家庄做网站那家好山东建站