{"id":104216,"date":"2026-09-12T03:09:00","date_gmt":"2026-09-11T19:09:00","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/104216.html"},"modified":"2026-09-12T03:09:00","modified_gmt":"2026-09-11T19:09:00","slug":"%e5%b5%8c%e5%85%a5%e5%bc%8f-linux-%e8%93%9d%e7%89%99%e6%a1%86%e6%9e%b6%e5%ae%8c%e6%95%b4%e7%af%87%ef%bc%9a%e4%bb%8e-hci%e3%80%81l2cap-%e5%88%b0bluez-%e7%94%a8%e6%88%b7%e6%80%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/104216.html","title":{"rendered":"\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001"},"content":{"rendered":"<p>\u5d4c\u5165\u5f0f\u4ea7\u54c1\u91cc\u84dd\u7259\u5e38\u548c WiFi \u5171\u7528\u4e00\u9897 combo \u82af\u7247\u3002\u73b0\u8c61\u5374\u5f88\u788e&#xff1a;\u80fd\u626b\u5230\u624b\u673a\u3001\u8fde\u4e0d\u4e0a&#xff1b;A2DP \u6709\u58f0\u65e0\u63a7&#xff1b;BLE \u5e7f\u64ad\u6b63\u5e38\u4f46 GATT \u8bfb\u5931\u8d25\u3002\u6839\u56e0\u5f80\u5f80\u4e0d\u5728\u300c\u84dd\u7259\u534f\u8bae\u672c\u8eab\u300d&#xff0c;\u800c\u5728 Linux BlueZ \u5206\u5c42&#xff1a;\u786c\u4ef6\/\u56fa\u4ef6 \u2192 HCI \u9a71\u52a8 \u2192 \u5185\u6838\u534f\u8bae&#xff08;L2CAP\/RFCOMM\/SCO&#xff09;\u2192 \u7528\u6237\u6001 bluetoothd \/ D-Bus\u3002<\/p>\n<p>\u672c\u6587\u628a \u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6808\u4ece\u82af\u7247\u5230\u5e94\u7528\u4e32\u6e05\u695a&#xff0c;\u8986\u76d6\u7ecf\u5178\u84dd\u7259\u4e0e BLE\u3001HCI \u547d\u4ee4\u4e8b\u4ef6\u3001\u5957\u63a5\u5b57\u7c7b\u578b\u3001mgmt\u3001\u97f3\u9891\u4e0e\u6392\u969c&#xff0c;\u8bfb\u5b8c\u80fd\u5bf9\u7167 btmon \u4e0e\u5185\u6838\u8def\u5f84\u5b9a\u4f4d\u95ee\u9898\u843d\u5728\u54ea\u4e00\u5c42\u3002<\/p>\n<h3>\u6e90\u7801\u951a\u70b9<\/h3>\n<table>\n<tr>\u8def\u5f84\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>include\/net\/bluetooth\/hci_core.h<\/td>\n<td>struct hci_dev\u3001hci_alloc_dev\u3001hci_register_dev<\/td>\n<\/tr>\n<tr>\n<td>include\/net\/bluetooth\/hci.h<\/td>\n<td>HCI \u547d\u4ee4\/\u4e8b\u4ef6\u3001quirk<\/td>\n<\/tr>\n<tr>\n<td>include\/net\/bluetooth\/bluetooth.h<\/td>\n<td>bt_sock\u3001\u534f\u8bae\u6ce8\u518c<\/td>\n<\/tr>\n<tr>\n<td>include\/net\/bluetooth\/l2cap.h<\/td>\n<td>L2CAP \u4fe1\u9053<\/td>\n<\/tr>\n<tr>\n<td>include\/net\/bluetooth\/rfcomm.h<\/td>\n<td>\u4e32\u53e3\u4eff\u771f RFCOMM<\/td>\n<\/tr>\n<tr>\n<td>include\/net\/bluetooth\/sco.h<\/td>\n<td>\u540c\u6b65\u8bed\u97f3\u94fe\u8def<\/td>\n<\/tr>\n<tr>\n<td>include\/net\/bluetooth\/mgmt.h<\/td>\n<td>\u7528\u6237\u6001\u7ba1\u7406\u63a5\u53e3&#xff08;mgmt&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>net\/bluetooth\/<\/td>\n<td>BlueZ \u5185\u6838&#xff1a;hci_core\u3001l2cap\u3001smp \u7b49<\/td>\n<\/tr>\n<tr>\n<td>include\/linux\/rfkill.h<\/td>\n<td>\u5c04\u9891\u5f00\u5173&#xff08;\u4e0e WiFi \u5171\u7528&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u63a7\u5236\u5668\u6ce8\u518c&#xff08;\u6982\u5ff5&#xff09;&#xff1a;<\/p>\n<p><span class=\"token comment\">\/* include\/net\/bluetooth\/hci_core.h *\/<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">hci_dev<\/span> <span class=\"token operator\">*<\/span><span class=\"token function\">hci_alloc_dev<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">int<\/span> <span class=\"token function\">hci_register_dev<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">hci_dev<\/span> <span class=\"token operator\">*<\/span>hdev<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u9a71\u52a8\u5728 probe \u91cc\u5206\u914d hci_dev&#xff0c;\u586b open\/close\/send \u7b49\u603b\u7ebf\u56de\u8c03&#xff0c;\u8bbe\u5fc5\u8981 quirk&#xff08;hci.h&#xff09;&#xff0c;\u518d hci_register_dev\u3002\u4e4b\u540e\u5185\u6838\u51fa\u73b0 hci0\u3002<\/p>\n<h3>\u5206\u5c42\u603b\u89c8&#xff1a;\u522b\u628a HCI \u548c\u300c\u84dd\u7259\u5e94\u7528\u300d\u6df7\u4e3a\u4e00\u8c08<\/h3>\n<p>#mermaid-svg-2jahqZryaOf8u6II{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-2jahqZryaOf8u6II .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-2jahqZryaOf8u6II .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-2jahqZryaOf8u6II .error-icon{fill:#552222;}#mermaid-svg-2jahqZryaOf8u6II .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-2jahqZryaOf8u6II .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-2jahqZryaOf8u6II .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-2jahqZryaOf8u6II .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-2jahqZryaOf8u6II .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-2jahqZryaOf8u6II .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-2jahqZryaOf8u6II .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-2jahqZryaOf8u6II .marker{fill:#333333;stroke:#333333;}#mermaid-svg-2jahqZryaOf8u6II .marker.cross{stroke:#333333;}#mermaid-svg-2jahqZryaOf8u6II svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-2jahqZryaOf8u6II p{margin:0;}#mermaid-svg-2jahqZryaOf8u6II .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-2jahqZryaOf8u6II .cluster-label text{fill:#333;}#mermaid-svg-2jahqZryaOf8u6II .cluster-label span{color:#333;}#mermaid-svg-2jahqZryaOf8u6II .cluster-label span p{background-color:transparent;}#mermaid-svg-2jahqZryaOf8u6II .label text,#mermaid-svg-2jahqZryaOf8u6II span{fill:#333;color:#333;}#mermaid-svg-2jahqZryaOf8u6II .node rect,#mermaid-svg-2jahqZryaOf8u6II .node circle,#mermaid-svg-2jahqZryaOf8u6II .node ellipse,#mermaid-svg-2jahqZryaOf8u6II .node polygon,#mermaid-svg-2jahqZryaOf8u6II .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-2jahqZryaOf8u6II .rough-node .label text,#mermaid-svg-2jahqZryaOf8u6II .node .label text,#mermaid-svg-2jahqZryaOf8u6II .image-shape .label,#mermaid-svg-2jahqZryaOf8u6II .icon-shape .label{text-anchor:middle;}#mermaid-svg-2jahqZryaOf8u6II .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-2jahqZryaOf8u6II .rough-node .label,#mermaid-svg-2jahqZryaOf8u6II .node .label,#mermaid-svg-2jahqZryaOf8u6II .image-shape .label,#mermaid-svg-2jahqZryaOf8u6II .icon-shape .label{text-align:center;}#mermaid-svg-2jahqZryaOf8u6II .node.clickable{cursor:pointer;}#mermaid-svg-2jahqZryaOf8u6II .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-2jahqZryaOf8u6II .arrowheadPath{fill:#333333;}#mermaid-svg-2jahqZryaOf8u6II .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-2jahqZryaOf8u6II .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-2jahqZryaOf8u6II .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-2jahqZryaOf8u6II .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-2jahqZryaOf8u6II .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-2jahqZryaOf8u6II .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-2jahqZryaOf8u6II .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-2jahqZryaOf8u6II .cluster text{fill:#333;}#mermaid-svg-2jahqZryaOf8u6II .cluster span{color:#333;}#mermaid-svg-2jahqZryaOf8u6II div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-2jahqZryaOf8u6II .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-2jahqZryaOf8u6II rect.text{fill:none;stroke-width:0;}#mermaid-svg-2jahqZryaOf8u6II .icon-shape,#mermaid-svg-2jahqZryaOf8u6II .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-2jahqZryaOf8u6II .icon-shape p,#mermaid-svg-2jahqZryaOf8u6II .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-2jahqZryaOf8u6II .icon-shape .label rect,#mermaid-svg-2jahqZryaOf8u6II .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-2jahqZryaOf8u6II .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-2jahqZryaOf8u6II .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-2jahqZryaOf8u6II :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"nodeLabel\"><\/p>\n<p>\u786c\u4ef6\u4fa7<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5185\u6838 BlueZ<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u7528\u6237\u6001<\/p>\n<p><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"nodeLabel\"><\/p>\n<p>bluetoothd \/ BlueZ<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>btmgmt \/ bluetoothctl<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u5e94\u7528: GATT \/ A2DP \/ SPP<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>PulseAudio \/ PipeWire \u97f3\u9891<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>mgmt \/ HCI socket<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>HCI \u6838\u5fc3 hci_core<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>L2CAP \/ SMP<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>RFCOMM \/ SCO \/ BNEP<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>HCI \u9a71\u52a8 USB\/UART\/SDIO<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u56fa\u4ef6<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u84dd\u7259\u63a7\u5236\u5668\u82af\u7247<\/p>\n<p><\/span><\/p>\n<p>HCI&#xff08;Host Controller Interface&#xff09;&#xff1a;\u4e3b\u673a&#xff08;Linux&#xff09;\u4e0e\u63a7\u5236\u5668&#xff08;\u82af\u7247&#043;\u56fa\u4ef6&#xff09;\u4e4b\u95f4\u7684\u6807\u51c6\u547d\u4ee4\/\u4e8b\u4ef6\/ACL\/SCO \u6570\u636e\u901a\u9053\u3002<br \/>\nLinux \u4fa7\u300c\u84dd\u7259\u9a71\u52a8\u300d\u591a\u6570\u662f \u628a\u67d0\u603b\u7ebf\u6536\u53d1\u9002\u914d\u6210 HCI&#xff0c;\u771f\u6b63 802.15 \u98ce\u683c\u8df3\u9891\u5728\u63a7\u5236\u5668\u56fa\u4ef6\u91cc\u3002<\/p>\n<h3>\u8c03\u7528\u94fe<\/h3>\n<h4>\u63a7\u5236\u5668\u4e0a\u7ebf<\/h4>\n<p>#mermaid-svg-RCWaPIq6uIvgpTqi{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-RCWaPIq6uIvgpTqi .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-RCWaPIq6uIvgpTqi .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-RCWaPIq6uIvgpTqi .error-icon{fill:#552222;}#mermaid-svg-RCWaPIq6uIvgpTqi .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-RCWaPIq6uIvgpTqi .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-RCWaPIq6uIvgpTqi .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-RCWaPIq6uIvgpTqi .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-RCWaPIq6uIvgpTqi .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-RCWaPIq6uIvgpTqi .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-RCWaPIq6uIvgpTqi .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-RCWaPIq6uIvgpTqi .marker{fill:#333333;stroke:#333333;}#mermaid-svg-RCWaPIq6uIvgpTqi .marker.cross{stroke:#333333;}#mermaid-svg-RCWaPIq6uIvgpTqi svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-RCWaPIq6uIvgpTqi p{margin:0;}#mermaid-svg-RCWaPIq6uIvgpTqi .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-RCWaPIq6uIvgpTqi .cluster-label text{fill:#333;}#mermaid-svg-RCWaPIq6uIvgpTqi .cluster-label span{color:#333;}#mermaid-svg-RCWaPIq6uIvgpTqi .cluster-label span p{background-color:transparent;}#mermaid-svg-RCWaPIq6uIvgpTqi .label text,#mermaid-svg-RCWaPIq6uIvgpTqi span{fill:#333;color:#333;}#mermaid-svg-RCWaPIq6uIvgpTqi .node rect,#mermaid-svg-RCWaPIq6uIvgpTqi .node circle,#mermaid-svg-RCWaPIq6uIvgpTqi .node ellipse,#mermaid-svg-RCWaPIq6uIvgpTqi .node polygon,#mermaid-svg-RCWaPIq6uIvgpTqi .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-RCWaPIq6uIvgpTqi .rough-node .label text,#mermaid-svg-RCWaPIq6uIvgpTqi .node .label text,#mermaid-svg-RCWaPIq6uIvgpTqi .image-shape .label,#mermaid-svg-RCWaPIq6uIvgpTqi .icon-shape .label{text-anchor:middle;}#mermaid-svg-RCWaPIq6uIvgpTqi .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-RCWaPIq6uIvgpTqi .rough-node .label,#mermaid-svg-RCWaPIq6uIvgpTqi .node .label,#mermaid-svg-RCWaPIq6uIvgpTqi .image-shape .label,#mermaid-svg-RCWaPIq6uIvgpTqi .icon-shape .label{text-align:center;}#mermaid-svg-RCWaPIq6uIvgpTqi .node.clickable{cursor:pointer;}#mermaid-svg-RCWaPIq6uIvgpTqi .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-RCWaPIq6uIvgpTqi .arrowheadPath{fill:#333333;}#mermaid-svg-RCWaPIq6uIvgpTqi .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-RCWaPIq6uIvgpTqi .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-RCWaPIq6uIvgpTqi .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-RCWaPIq6uIvgpTqi .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-RCWaPIq6uIvgpTqi .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-RCWaPIq6uIvgpTqi .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-RCWaPIq6uIvgpTqi .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-RCWaPIq6uIvgpTqi .cluster text{fill:#333;}#mermaid-svg-RCWaPIq6uIvgpTqi .cluster span{color:#333;}#mermaid-svg-RCWaPIq6uIvgpTqi div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-RCWaPIq6uIvgpTqi .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-RCWaPIq6uIvgpTqi rect.text{fill:none;stroke-width:0;}#mermaid-svg-RCWaPIq6uIvgpTqi .icon-shape,#mermaid-svg-RCWaPIq6uIvgpTqi .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-RCWaPIq6uIvgpTqi .icon-shape p,#mermaid-svg-RCWaPIq6uIvgpTqi .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-RCWaPIq6uIvgpTqi .icon-shape .label rect,#mermaid-svg-RCWaPIq6uIvgpTqi .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-RCWaPIq6uIvgpTqi .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-RCWaPIq6uIvgpTqi .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-RCWaPIq6uIvgpTqi :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u603b\u7ebf probe: USB\/UART\/SDIO<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>hci_alloc_dev<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8bbe\u7f6e bus \u56de\u8c03 open\/close\/send<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8bbe\u7f6e quirk \u5982\u9700<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>hci_register_dev<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u521b\u5efa hciX \/ \u521d\u59cb\u5316\u547d\u4ee4<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>bluetoothd \u901a\u8fc7 mgmt \u7ba1\u7406<\/p>\n<p><\/span><\/p>\n<h4>\u7ecf\u5178\u8fde\u63a5&#xff08;\u793a\u610f&#xff1a;SPP \/ RFCOMM&#xff09;<\/h4>\n<p>\u5e94\u7528 connect RFCOMM<br \/>\n  \u2192 \u5185\u6838 RFCOMM \u2192 L2CAP \u2192 HCI ACL<br \/>\n      \u2192 \u9a71\u52a8 send \u2192 \u63a7\u5236\u5668<br \/>\n\u53cd\u5411&#xff1a;\u63a7\u5236\u5668\u4e8b\u4ef6\/ACL \u2192 hci_recv_frame \u2192 \u534f\u8bae\u6808 \u2192 socket<\/p>\n<h4>BLE GATT&#xff08;\u793a\u610f&#xff09;<\/h4>\n<p>\u7528\u6237\u6001\/bluetoothd<br \/>\n  \u2192 ATT over L2CAP (LE credit \/ fixed CID)<br \/>\n      \u2192 HCI LE ACL<br \/>\n          \u2192 \u63a7\u5236\u5668\u94fe\u8def\u5c42<br \/>\n\u5b89\u5168&#xff1a;SMP \u914d\u5bf9\u5bc6\u94a5&#xff1b;\u5185\u6838 smp \u4e0e\u7528\u6237\u6001\u7b56\u7565\u534f\u4f5c<\/p>\n<h3>\u91cd\u70b9\u77e5\u8bc6<\/h3>\n<h4>1. hci_dev&#xff1a;\u63a7\u5236\u5668\u5728\u5185\u6838\u7684\u5b9e\u4f53<\/h4>\n<p>struct hci_dev&#xff08;hci_core.h&#xff09;\u4fdd\u5b58&#xff1a;<\/p>\n<ul>\n<li>\u540d\u79f0\u3001\u603b\u7ebf\u7c7b\u578b\u3001\u5382\u5546\u7279\u5f81<\/li>\n<li>\u547d\u4ee4\u961f\u5217\u3001\u8fde\u63a5\u54c8\u5e0c\u3001\u7edf\u8ba1 hci_dev_stats<\/li>\n<li>\u56de\u8c03&#xff1a;\u5411\u63a7\u5236\u5668\u53d1\u5e27\u3001\u6253\u5f00\u5173\u95ed\u4f20\u8f93<\/li>\n<\/ul>\n<p>\u7528\u6237\u6001\u770b\u5230\u7684 hci0 \u5bf9\u5e94\u4e00\u4e2a\u5df2\u6ce8\u518c\u7684 hci_dev\u3002<br \/>\nhciconfig&#xff08;\u65e7&#xff09;\/ btmgmt info \/ bluetoothctl list \u90fd\u56f4\u7ed5\u5b83\u3002<\/p>\n<h4>2. HCI \u4e09\u79cd\u6d41\u91cf<\/h4>\n<table>\n<tr>\u7c7b\u578b\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>Command \/ Event<\/td>\n<td>\u4e3b\u673a\u4e0b\u547d\u4ee4\u3001\u63a7\u5236\u5668\u56de\u4e8b\u4ef6&#xff08;\u590d\u4f4d\u3001\u67e5\u7279\u6027\u3001\u5efa\u94fe&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ACL<\/td>\n<td>\u5f02\u6b65\u6570\u636e&#xff08;L2CAP \u627f\u8f7d&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>SCO \/ eSCO<\/td>\n<td>\u540c\u6b65\u8bed\u97f3&#xff08;\u901a\u8bdd\u3001\u90e8\u5206 headset&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8c03\u8bd5\u795e\u5668&#xff1a;btmon \u6293 HCI \u5c42&#xff0c;\u76f8\u5f53\u4e8e\u84dd\u7259\u7684 tcpdump\u3002\u5173\u8054\u5931\u8d25\u5148\u770b\u662f\u547d\u4ee4\u8d85\u65f6\u3001\u8ba4\u8bc1\u5931\u8d25\u8fd8\u662f ACL \u65ad\u5f00\u3002<\/p>\n<h4>3. \u4f20\u8f93\u9a71\u52a8&#xff08;\u5d4c\u5165\u5f0f\u6700\u5e38\u89c1&#xff09;<\/h4>\n<table>\n<tr>\u603b\u7ebf\u5178\u578b\u573a\u666f\u6ce8\u610f<\/tr>\n<tbody>\n<tr>\n<td>USB<\/td>\n<td>USB \u84dd\u7259 dongle\u3001\u90e8\u5206\u6a21\u7ec4<\/td>\n<td>\u7535\u6d41\u3001\u56fa\u4ef6\u3001reset<\/td>\n<\/tr>\n<tr>\n<td>UART \/ H4 \/ H5 \/ BCSP<\/td>\n<td>\u6a21\u7ec4\u63a5 SoC UART<\/td>\n<td>\u6ce2\u7279\u7387\u3001\u6d41\u63a7\u3001\u4e32\u53e3 DMA<\/td>\n<\/tr>\n<tr>\n<td>SDIO<\/td>\n<td>WiFi\/BT combo<\/td>\n<td>\u4e0e WiFi \u5171\u5b58\u3001\u5171\u4eab\u6676\u632f\/\u5929\u7ebf\u3001\u56fa\u4ef6\u7ec4\u5408<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>UART \u84dd\u7259\u7ecf\u5178\u5751&#xff1a;\u6ce2\u7279\u7387\u4e0e\u56fa\u4ef6\u7ea6\u5b9a\u4e0d\u4e00\u81f4 \u2192 hci_register \u540e\u521d\u59cb\u5316\u547d\u4ee4\u8d85\u65f6\u3002<br \/>\nCombo \u82af\u7247&#xff1a;WiFi \u9a71\u52a8\u4e0e BT \u9a71\u52a8\u52a0\u8f7d\u987a\u5e8f\u3001\u5171\u4eab\u7ba1\u811a\u3001rfkill \u8981\u4e00\u8d77\u770b\u3002<\/p>\n<h4>4. \u534f\u8bae\u6808&#xff1a;L2CAP \u4ee5\u4e0a<\/h4>\n<p>#mermaid-svg-GyQDHk6QBo6Xv1Mq{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .error-icon{fill:#552222;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .marker{fill:#333333;stroke:#333333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .marker.cross{stroke:#333333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-GyQDHk6QBo6Xv1Mq p{margin:0;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .cluster-label text{fill:#333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .cluster-label span{color:#333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .cluster-label span p{background-color:transparent;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .label text,#mermaid-svg-GyQDHk6QBo6Xv1Mq span{fill:#333;color:#333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .node rect,#mermaid-svg-GyQDHk6QBo6Xv1Mq .node circle,#mermaid-svg-GyQDHk6QBo6Xv1Mq .node ellipse,#mermaid-svg-GyQDHk6QBo6Xv1Mq .node polygon,#mermaid-svg-GyQDHk6QBo6Xv1Mq .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .rough-node .label text,#mermaid-svg-GyQDHk6QBo6Xv1Mq .node .label text,#mermaid-svg-GyQDHk6QBo6Xv1Mq .image-shape .label,#mermaid-svg-GyQDHk6QBo6Xv1Mq .icon-shape .label{text-anchor:middle;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .rough-node .label,#mermaid-svg-GyQDHk6QBo6Xv1Mq .node .label,#mermaid-svg-GyQDHk6QBo6Xv1Mq .image-shape .label,#mermaid-svg-GyQDHk6QBo6Xv1Mq .icon-shape .label{text-align:center;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .node.clickable{cursor:pointer;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .arrowheadPath{fill:#333333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-GyQDHk6QBo6Xv1Mq .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-GyQDHk6QBo6Xv1Mq .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-GyQDHk6QBo6Xv1Mq .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .cluster text{fill:#333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .cluster span{color:#333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-GyQDHk6QBo6Xv1Mq rect.text{fill:none;stroke-width:0;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .icon-shape,#mermaid-svg-GyQDHk6QBo6Xv1Mq .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .icon-shape p,#mermaid-svg-GyQDHk6QBo6Xv1Mq .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .icon-shape .label rect,#mermaid-svg-GyQDHk6QBo6Xv1Mq .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-GyQDHk6QBo6Xv1Mq .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-GyQDHk6QBo6Xv1Mq .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-GyQDHk6QBo6Xv1Mq :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"nodeLabel\"><\/p>\n<p>HCI<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>L2CAP<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>ATT\/GATT BLE<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>RFCOMM<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>BNEP \u4e2a\u4eba\u7f51<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>SMP \u914d\u5bf9<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u4e32\u53e3\u5e94\u7528<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>SCO<\/p>\n<p><\/span><span class=\"nodeLabel\"><\/p>\n<p>\u8bed\u97f3<\/p>\n<p><\/span><\/p>\n<ul>\n<li>L2CAP&#xff1a;\u4fe1\u9053\u590d\u7528\u3001\u5206\u7247\u91cd\u7ec4&#xff1b;BLE \u4e0a\u627f\u8f7d ATT\u3002<\/li>\n<li>RFCOMM&#xff1a;\u4eff\u4e32\u53e3&#xff0c;Android SPP\u3001\u5f88\u591a\u5de5\u63a7\u900f\u4f20\u3002<\/li>\n<li>BNEP&#xff1a;\u84dd\u7259\u4e2a\u4eba\u533a\u57df\u7f51&#xff08;\u8f83\u5c11\u7528\u4e8e\u73b0\u4ee3\u624b\u673a\u4e92\u8054&#xff09;\u3002<\/li>\n<li>SCO&#xff1a;\u8bed\u97f3&#xff1b;\u97f3\u9891\u97f3\u4e50\u66f4\u591a\u8d70 A2DP&#xff08;\u7528\u6237\u6001\u914d\u7f6e &#043; \u5185\u6838\u652f\u6301&#xff09;\u3002<\/li>\n<li>SMP&#xff1a;LE \u5b89\u5168\u914d\u5bf9\u3002<\/li>\n<\/ul>\n<p>\u5957\u63a5\u5b57&#xff1a;AF_BLUETOOTH &#043; BTPROTO_L2CAP \/ RFCOMM \/ HCI \/ SCO \u7b49&#xff08;\u89c1 bluetooth.h \u6ce8\u518c\u8def\u5f84&#xff09;\u3002<\/p>\n<h4>5. \u7528\u6237\u6001 BlueZ<\/h4>\n<p>\u73b0\u4ee3\u53d1\u884c\u7248&#xff1a;<\/p>\n<ul>\n<li>bluetoothd&#xff1a;\u5b88\u62a4\u8fdb\u7a0b&#xff0c;\u7ecf D-Bus \u66b4\u9732\u9002\u914d\u5668\/\u8bbe\u5907\/GATT API\u3002<\/li>\n<li>bluetoothctl&#xff1a;\u4ea4\u4e92\u5f0f\u63a7\u5236\u3002<\/li>\n<li>btmgmt&#xff1a;\u66f4\u8d34\u8fd1\u5185\u6838 mgmt \u547d\u4ee4\u3002<\/li>\n<\/ul>\n<p>\u5d4c\u5165\u5f0f\u88c1\u526a\u6839\u6587\u4ef6\u7cfb\u7edf\u65f6\u7f3a bluetoothd \u6216 D-Bus \u7b56\u7565&#xff0c;\u4f1a\u51fa\u73b0\u300c\u5185\u6838\u6709 hci0&#xff0c;\u7528\u6237\u6001\u626b\u4e0d\u5230\u300d\u3002<\/p>\n<h4>6. \u7ecf\u5178\u84dd\u7259 vs BLE<\/h4>\n<table>\n<tr>\u7ecf\u5178 BR\/EDRBLE<\/tr>\n<tbody>\n<tr>\n<td>\u529f\u8017<\/td>\n<td>\u8f83\u9ad8<\/td>\n<td>\u4f4e<\/td>\n<\/tr>\n<tr>\n<td>\u5178\u578b<\/td>\n<td>\u97f3\u9891\u3001SPP\u3001HID \u65e7\u8bbe\u5907<\/td>\n<td>\u4f20\u611f\u5668\u3001Beacon\u3001GATT<\/td>\n<\/tr>\n<tr>\n<td>\u4e3b\u673a\u5173\u6ce8<\/td>\n<td>RFCOMM\/A2DP\/SCO<\/td>\n<td>ATT\/GATT\u3001\u5e7f\u64ad\u3001\u8fde\u63a5\u95f4\u9694<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u540c\u4e00\u63a7\u5236\u5668\u53ef\u53cc\u6a21&#xff1b;\u80fd\u529b\u7531 HCI Read Local Supported Features \/ LE features \u4e8b\u4ef6\u62a5\u544a\u3002<\/p>\n<h4>7. \u914d\u5bf9\u3001\u7ed1\u5b9a\u4e0e\u6743\u9650<\/h4>\n<p>\u914d\u5bf9\u4ea7\u751f\u5bc6\u94a5&#xff0c;\u7ed1\u5b9a\u540e\u514d\u91cd\u590d\u8f93\u5165\u3002\u5931\u8d25\u5e38\u89c1&#xff1a;<\/p>\n<ul>\n<li>\u53cc\u65b9 IO \u80fd\u529b\u4e0d\u5339\u914d&#xff08;NoInputNoOutput vs DisplayYesNo&#xff09;<\/li>\n<li>Secure Connections \/ MITM \u7b56\u7565\u8fc7\u4e25<\/li>\n<li>\u65e7\u8bbe\u5907\u4e0d\u652f\u6301 LE Secure Connections<\/li>\n<\/ul>\n<p>\u5185\u6838 SMP &#043; \u7528\u6237\u6001 agent&#xff08;bluetoothctl agent&#xff09;\u5171\u540c\u5b8c\u6210\u3002\u4ea7\u7ebf\u5e38\u7528\u300c\u9884\u7ed1\u5b9a\u300d\u6216\u56fa\u5b9a PIN&#xff08;\u5b89\u5168\u6027\u5dee&#xff0c;\u4ec5\u5de5\u63a7&#xff09;\u3002<\/p>\n<h4>8. \u97f3\u9891\u8def\u5f84&#xff08;\u5d4c\u5165\u5f0f\u6613\u8e29\u5751&#xff09;<\/h4>\n<ul>\n<li>HFP\/HSP&#xff1a;\u901a\u8bdd&#xff0c;\u504f SCO\u3002<\/li>\n<li>A2DP&#xff1a;\u97f3\u4e50&#xff1b;\u7f16\u89e3\u7801 SBC\/AAC\/aptX \u53d6\u51b3\u4e8e\u7528\u6237\u6001\u4e0e\u5bf9\u7aef\u3002<\/li>\n<li>\u4e0e PulseAudio \/ PipeWire \/ ALSA \u96c6\u6210&#xff1b;\u5185\u6838\u53ea\u63d0\u4f9b\u94fe\u8def&#xff0c;\u7b56\u7565\u4e0e\u7f16\u89e3\u7801\u5728\u7528\u6237\u6001\u3002<\/li>\n<\/ul>\n<p>\u53ea\u6709 hci0 \u6ca1\u6709\u97f3\u9891\u6846\u67b6\u63d2\u4ef6 \u2192 \u300c\u80fd\u8fde\u8033\u673a\u65e0\u58f0\u97f3\u300d\u3002<\/p>\n<h4>9. rfkill \u4e0e\u5171\u5b58<\/h4>\n<p>rfkill list \u4e2d Bluetooth \u88ab soft\/hard block \u4f1a\u5bfc\u81f4\u9002\u914d\u5668 down\u3002<br \/>\nWiFi\/BT \u5171\u5b58&#xff1a;\u5929\u7ebf\u9694\u79bb\u3001\u56fa\u4ef6\u5171\u5b58\u7b97\u6cd5\u3001\u540c\u6a21\u7ec4 SDIO \u65f6\u5e8f&#xff1b;WiFi \u9ad8\u541e\u5410\u65f6 BT \u97f3\u9891\u5361\u987f\u4e0d\u4e00\u5b9a\u662f BlueZ bug\u3002<\/p>\n<h4>10. \u8c03\u8bd5\u4e0e\u89c2\u6d4b<\/h4>\n<p><span class=\"token function\">dmesg<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-iE<\/span> <span class=\"token string\">&#039;bluetooth|hci|firmware|tty.*bt&#039;<\/span><br \/>\nhciconfig <span class=\"token parameter variable\">-a<\/span> <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span>\/dev\/null<span class=\"token punctuation\">;<\/span> btmgmt info<br \/>\nrfkill list<br \/>\nbluetoothctl show<span class=\"token punctuation\">;<\/span> bluetoothctl devices<br \/>\n<span class=\"token comment\"># \u6293 HCI&#xff08;\u9700\u6743\u9650&#xff09;<\/span><br \/>\nbtmon<br \/>\n<span class=\"token comment\"># \u5185\u6838\u914d\u7f6e&#xff1a;CONFIG_BT\u3001CONFIG_BT_HCIUART\u3001CONFIG_BT_HCIBTUSB \u7b49<\/span><\/p>\n<table>\n<tr>\u73b0\u8c61\u65b9\u5411<\/tr>\n<tbody>\n<tr>\n<td>\u65e0 hci0<\/td>\n<td>\u603b\u7ebf probe\u3001\u56fa\u4ef6\u3001UART \u6ce2\u7279\u7387\u3001\u8bbe\u5907\u6811<\/td>\n<\/tr>\n<tr>\n<td>hci0 \u5728\u4f46 up \u5931\u8d25<\/td>\n<td>rfkill\u3001\u521d\u59cb\u5316\u547d\u4ee4\u8d85\u65f6\u3001quirk<\/td>\n<\/tr>\n<tr>\n<td>\u626b\u4e0d\u5230\u8bbe\u5907<\/td>\n<td>\u5929\u7ebf\u3001\u533a\u57df\u3001\u626b\u63cf\u53c2\u6570\u3001\u88ab block<\/td>\n<\/tr>\n<tr>\n<td>\u80fd\u914d\u5bf9\u4e0d\u80fd\u8fde\u914d\u7f6e\u6587\u4ef6<\/td>\n<td>SDP\/GATT \u7528\u6237\u6001\u3001\u6743\u9650\u3001UUID<\/td>\n<\/tr>\n<tr>\n<td>BLE \u8fde\u63a5\u79d2\u65ad<\/td>\n<td>\u8fde\u63a5\u95f4\u9694\u3001\u76d1\u7763\u8d85\u65f6\u3001\u4f9b\u7535\u3001\u5e72\u6270<\/td>\n<\/tr>\n<tr>\n<td>\u97f3\u9891\u65e0\u58f0<\/td>\n<td>Pulse\/PipeWire\u3001\u7f16\u89e3\u7801\u3001profile<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Checklist<\/h3>\n<ul>\n<li class=\"task-list-item\"> \u80fd\u533a\u5206&#xff1a;HCI \u9a71\u52a8\u3001\u5185\u6838\u534f\u8bae\u6808\u3001bluetoothd \u7528\u6237\u6001\u4e09\u5c42\u804c\u8d23<\/li>\n<li class=\"task-list-item\"> \u77e5\u9053 hci_alloc_dev \u2192 hci_register_dev \u540e\u624d\u6709 hci0<\/li>\n<li class=\"task-list-item\"> \u4f1a\u7528 btmon \u770b\u547d\u4ee4\u8d85\u65f6\u8fd8\u662f\u94fe\u8def\u65ad\u5f00<\/li>\n<li class=\"task-list-item\"> \u6e05\u695a RFCOMM\/L2CAP\/SCO \u5404\u81ea\u5178\u578b\u7528\u9014<\/li>\n<li class=\"task-list-item\"> UART \u84dd\u7259\u67e5\u8fc7\u6ce2\u7279\u7387\u4e0e\u56fa\u4ef6&#xff1b;combo \u67e5\u8fc7\u4e0e WiFi \u5171\u5b58\/rfkill<\/li>\n<li class=\"task-list-item\"> \u6839\u6587\u4ef6\u7cfb\u7edf\u786e\u8ba4 D-Bus &#043; bluetoothd&#xff08;\u82e5\u7528 BlueZ \u6807\u51c6\u6808&#xff09;<\/li>\n<li class=\"task-list-item\"> \u97f3\u9891\u95ee\u9898\u5148\u67e5\u7528\u6237\u6001 profile&#xff0c;\u518d\u67e5 SCO\/A2DP \u94fe\u8def<\/li>\n<\/ul>\n<hr \/>\n<p>\u6210\u7a3f&#xff1a;articles\/csdn-merged\/\u5d4c\u5165\u5f0fLinux-\u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7.md<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5d4c\u5165\u5f0f\u4ea7\u54c1\u91cc\u84dd\u7259\u5e38\u548c WiFi \u5171\u7528\u4e00\u9897 combo \u82af\u7247\u3002\u73b0\u8c61\u5374\u5f88\u788e&#xff1a;\u80fd\u626b\u5230\u624b\u673a\u3001\u8fde\u4e0d\u4e0a&#xff1b;A2DP \u6709\u58f0\u65e0\u63a7&#xff1b;BLE \u5e7f\u64ad\u6b63\u5e38\u4f46 GATT \u8bfb\u5931\u8d25\u3002\u6839\u56e0\u5f80\u5f80\u4e0d\u5728\u300c\u84dd\u7259\u534f\u8bae\u672c\u8eab\u300d&#xff0c;\u800c\u5728 Linux BlueZ \u5206\u5c42&#xff1a;\u786c\u4ef6\/\u56fa\u4ef6 \u2192 HCI \u9a71\u52a8 \u2192 \u5185\u6838\u534f\u8bae&#xff08;L2CAP\/RFCOMM\/SCO&#xff09;\u2192 \u7528\u6237\u6001 bluetoothd \/ D-Bus\u3002<br \/>\n\u672c\u6587\u628a \u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6808\u4ece<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,43,44],"topic":[],"class_list":["post-104216","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/104216.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5d4c\u5165\u5f0f\u4ea7\u54c1\u91cc\u84dd\u7259\u5e38\u548c WiFi \u5171\u7528\u4e00\u9897 combo \u82af\u7247\u3002\u73b0\u8c61\u5374\u5f88\u788e&#xff1a;\u80fd\u626b\u5230\u624b\u673a\u3001\u8fde\u4e0d\u4e0a&#xff1b;A2DP \u6709\u58f0\u65e0\u63a7&#xff1b;BLE \u5e7f\u64ad\u6b63\u5e38\u4f46 GATT \u8bfb\u5931\u8d25\u3002\u6839\u56e0\u5f80\u5f80\u4e0d\u5728\u300c\u84dd\u7259\u534f\u8bae\u672c\u8eab\u300d&#xff0c;\u800c\u5728 Linux BlueZ \u5206\u5c42&#xff1a;\u786c\u4ef6\/\u56fa\u4ef6 \u2192 HCI \u9a71\u52a8 \u2192 \u5185\u6838\u534f\u8bae&#xff08;L2CAP\/RFCOMM\/SCO&#xff09;\u2192 \u7528\u6237\u6001 bluetoothd \/ D-Bus\u3002 \u672c\u6587\u628a \u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6808\u4ece\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/104216.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-11T19:09:00+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104216.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/104216.html\",\"name\":\"\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-11T19:09:00+00:00\",\"dateModified\":\"2026-09-11T19:09:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/104216.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/104216.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/104216.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/104216.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5d4c\u5165\u5f0f\u4ea7\u54c1\u91cc\u84dd\u7259\u5e38\u548c WiFi \u5171\u7528\u4e00\u9897 combo \u82af\u7247\u3002\u73b0\u8c61\u5374\u5f88\u788e&#xff1a;\u80fd\u626b\u5230\u624b\u673a\u3001\u8fde\u4e0d\u4e0a&#xff1b;A2DP \u6709\u58f0\u65e0\u63a7&#xff1b;BLE \u5e7f\u64ad\u6b63\u5e38\u4f46 GATT \u8bfb\u5931\u8d25\u3002\u6839\u56e0\u5f80\u5f80\u4e0d\u5728\u300c\u84dd\u7259\u534f\u8bae\u672c\u8eab\u300d&#xff0c;\u800c\u5728 Linux BlueZ \u5206\u5c42&#xff1a;\u786c\u4ef6\/\u56fa\u4ef6 \u2192 HCI \u9a71\u52a8 \u2192 \u5185\u6838\u534f\u8bae&#xff08;L2CAP\/RFCOMM\/SCO&#xff09;\u2192 \u7528\u6237\u6001 bluetoothd \/ D-Bus\u3002 \u672c\u6587\u628a \u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6808\u4ece","og_url":"https:\/\/www.wsisp.com\/helps\/104216.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-11T19:09:00+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/104216.html","url":"https:\/\/www.wsisp.com\/helps\/104216.html","name":"\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-11T19:09:00+00:00","dateModified":"2026-09-11T19:09:00+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/104216.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/104216.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/104216.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5d4c\u5165\u5f0f Linux \u84dd\u7259\u6846\u67b6\u5b8c\u6574\u7bc7\uff1a\u4ece HCI\u3001L2CAP \u5230BlueZ \u7528\u6237\u6001"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=104216"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/104216\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=104216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=104216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=104216"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=104216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}