蓝牙驱动及Bluez使用流程分析

本文详细分析了蓝牙驱动的各个组成部分,包括串口驱动介绍、初始化过程、Hciattach工作原理,以及数据在驱动的传递流程。还探讨了Bluez的使用,如A2DP和Handsfree的连接与数据流动,提供了深入的理解。
摘要由CSDN通过智能技术生成


<!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"/@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; line-height:12.0pt; mso-pagination:none; text-autospace:none; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; mso-fareast-language:EN-US;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->                     


                   蓝牙驱动及Bluez使用流程分析


<!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"/@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; line-height:12.0pt; mso-pagination:none; text-autospace:none; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; mso-fareast-language:EN-US;} p.MsoToc1, li.MsoToc1, div.MsoToc1 {mso-style-update:auto; mso-style-noshow:yes; mso-style-next:正文; margin-top:6.0pt; margin-right:0cm; margin-bottom:6.0pt; margin-left:0cm; line-height:12.0pt; mso-pagination:none; text-autospace:none; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; text-transform:uppercase; mso-fareast-language:EN-US; font-weight:bold;} p.MsoToc2, li.MsoToc2, div.MsoToc2 {mso-style-update:auto; mso-style-noshow:yes; mso-style-next:正文; margin-top:0cm; margin-right:0cm; margin-bottom:0cm; margin-left:10.0pt; margin-bottom:.0001pt; line-height:12.0pt; mso-pagination:none; text-autospace:none; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; font-variant:small-caps; mso-fareast-language:EN-US;} p.MsoToc3, li.MsoToc3, div.MsoToc3 {mso-style-update:auto; mso-style-noshow:yes; mso-style-next:正文; margin-top:0cm; margin-right:0cm; margin-bottom:0cm; margin-left:20.0pt; margin-bottom:.0001pt; line-height:12.0pt; mso-pagination:none; text-autospace:none; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; mso-fareast-language:EN-US; font-style:italic;} p.MsoTitle, li.MsoTitle, div.MsoTitle {mso-style-next:正文; margin:0cm; margin-bottom:.0001pt; text-align:center; mso-pagination:none; text-autospace:none; font-size:18.0pt; font-family:Arial; mso-fareast-font-family:宋体; mso-bidi-font-family:"Times New Roman"; mso-fareast-language:EN-US; font-weight:bold;} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

目录

1.    Abstract .. 4

2.     Introduction .. 4

3.     蓝牙驱动介绍 .... 4

3.1       串口驱动介绍 ... 5

3.2      初始化 ... 5

3.2.1        模块上电 ... 5

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
3. 蓝牙驱动介绍............................................................................................................................................... 4 3.1 串口驱动介绍........................................................................................................................................ 5 3.2 初始化.................................................................................................................................................... 5 3.2.1 模块上电........................................................................................................................................ 5 3.2.2 PSKEY的设置................................................................................................................................. 6 3.3 HCIATTACH的工作原理.......................................................................................................................... 7 3.3.1 Hci_uar和bcsp层的加入................................................................................................................. 9 3.3.2 hci层的加入.................................................................................................................................. 10 3.3.3 hci_attach的内核处理.................................................................................................................. 11 4. 数据在驱动的传递流程.............................................................................................................................. 13 4.1 UART层的数据接收.............................................................................................................................. 13 4.2 HCI_UART的数据接收.......................................................................................................................... 14 4.3 BCSP层的处理...................................................................................................................................... 15 4.4 HCI层及以上的处理............................................................................................................................. 15 4.5 数据流程的总结.................................................................................................................................. 17 5. 扫描过程的分析......................................................................................................................................... 18 5.1 用户使用例子...................................................................................................................................... 18 5.2 用HCITOOL扫描时的逻辑..................................................................................................................... 18 5.2.1 上层逻辑...................................................................................................................................... 18 5.2.2 内核层逻辑.................................................................................................................................. 19 5.3 通过DBUS触发的逻辑.......................................................................................................................... 21 5.3.1 上层逻辑之adapter dbus方法的建立........................................................................................... 21 5.3.2 上层扫描方法的调用................................................................................................................... 22 5.3.3 Dbus触发的扫描对应于内核层的处理........................................................................................ 25 5.3.4 上层的扫描数据收集................................................................................................................... 26 5.3.5 Hci_send_frame的讨论................................................................................................................. 28 6. A2DP的使用过程........................................................................................................................................ 28 6.1 如何使用.............................................................................................................................................. 28 6.2 服务的激活.......................................................................................................................................... 29 6.3 设备的创建.......................................................................................................................................... 30 6.3.1............................................................................................................................................................. 33 6.3.2............................................................................................................................................................. 33 6.3.3............................................................................................................................................................. 33 6.3.4............................................................................................................................................................. 33 6.4 设备的连接.......................................................................................................................................... 33
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值