当前位置:首页>Linux>Linux蓝牙之核外协议栈BlueZ架构分析

Linux蓝牙之核外协议栈BlueZ架构分析

  • 2026-07-02 16:48:29
Linux蓝牙之核外协议栈BlueZ架构分析

Linux蓝牙之核外协议栈BlueZ架构分析

工程名称: BlueZ — 官方 Linux Bluetooth 协议栈
代码仓库: git://git.kernel.org/pub/scm/bluetooth/bluez.git
协议: GPL-2.0-or-later (核心) / LGPL-2.1-or-later (lib)
代码规模: ~525,695 行 C 代码, 803 个 C 源文件
核心维护者: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz

本报告基于 BlueZ(v5.86) git commit 0fdf34b17


目录

  1. 1. 项目概述
  2. 2. 功能全景
  3. 3. 架构总览
  4. 4. 核心模块详解
  5. 5. D-Bus 接口体系
  6. 6. 核心流程分析
  7. 7. 关键子系统
  8. 8. 工具生态
  9. 9. 配置与存储
  10. 10. 体系结构图

1. 项目概述

BlueZ 是 Linux 内核官方 Bluetooth 子系统的用户态实现,提供完整的蓝牙协议栈支持,涵盖:

  • • 经典蓝牙 (BR/EDR): 传统蓝牙 2.0/2.1/3.0
  • • 低功耗蓝牙 (BLE): 蓝牙 4.0/4.1/4.2/5.0/5.1/5.2/5.3
  • • 双模 (Dual Mode): 同时支持 BR/EDR 和 LE

BlueZ 通过 D-Bus 系统总线向用户态应用提供标准化的蓝牙服务接口,是 Linux 桌面和嵌入式系统中蓝牙功能的事实标准实现。


2. 功能全景

2.1 核心蓝牙功能

功能域
支持技术
说明
设备发现
BR/EDR Inquiry + LE Scanning
支持主动/被动扫描
连接管理
BR/EDR SCO/eSCO + LE Connection
多设备并发连接
配对/绑定
SSP, LE Legacy, LE Secure Connections
Just Works, Passkey, OOB
广播
LE Advertising (Legacy + Extended)
支持 Periodic Advertising
GATT
GATT Client + Server
支持缓存、通知、MTU协商
SDP
BR/EDR 服务发现协议
兼容模式已标记废弃

2.2 音频/媒体支持 (A2DP/AVRCP/HFP)

Profile
角色
文件位置
A2DP
Source/Sink
profiles/audio/a2dp.c
AVRCP
Controller/Target
profiles/audio/avrcp.c
AVDTP
流媒体传输出层
profiles/audio/avdtp.c
HFP
HF/AG
profiles/audio/hfp-hf.c
 / hfp-ag.c
ASHA
助听器音频流
profiles/audio/asha.c
BAP
LE Audio (Basic Audio Profile)
profiles/audio/bap.c
VCP
Volume Control Profile
profiles/audio/vcp.c
MCP
Media Control Profile
profiles/audio/mcp.c
CCP
Coordinated Set Identification
profiles/audio/ccp.c
CSIP
Coordinated Set Identification Profile
profiles/audio/csip.c
TMAP
Telephony and Media Audio Profile
profiles/audio/tmap.c
GMAP
Generic Media Audio Profile
profiles/audio/gmap.c
MICp
Microphone Control Profile
profiles/audio/micp.c
RAP
Rendering Adjustment Profile
src/shared/rap.c

2.3 输入设备 (HID)

Profile
说明
文件
HID/HOG
键盘/鼠标/游戏手柄
profiles/input/hog.c
Sixaxis
Sony PS3/PS4 手柄支持
profiles/input/sixaxis.h
UHID
用户态 HID 驱动
src/shared/uhid.c

2.4 网络服务 (PAN)

Profile
说明
文件
PAN
个人局域网
profiles/network/server.c
BNEP
蓝牙网络封装协议
profiles/network/bnep.c
NAP
网络访问点
profiles/network/connection.c

2.5 LE Audio (下一代)

Profile
说明
文件
LC3 Codec
LE Audio 强制编解码器
src/shared/bap.c
Broadcast Audio
广播音频
profiles/audio/bap.c
BASS
广播音频扫描服务
profiles/audio/bass.c

2.6 OBEX/拨号/信息

功能
说明
文件
OBEX
对象交换服务器
obexd/src/
OPP
对象推送
obexd/plugins/opp.c
FTP
文件传输
obexd/plugins/ftp.c
PBAP
电话簿访问
obexd/plugins/pbap.c
MAP
信息访问
obexd/plugins/mas.c

2.7 Mesh 网络

组件
说明
文件
Mesh Node
蓝牙 Mesh 节点实现
mesh/mesh.c
Provisioning
配置协议 (PB-ADV)
mesh/prov-acceptor.c
prov-initiator.c
Configuration
配置模型服务器
mesh/cfgmod-server.c
Friendship
Friend/LCFN 节点
mesh/friend.c

3. 架构总览

3.1 分层架构

┌─────────────────────────────────────────────────────────────────┐
│                    用户态应用 (Applications)                      │
│   bluetoothctl         bluetooth-player      btgatt-client ...  │
└──────────────────────────┬──────────────────────────────────────┘
                           │ D-Bus System Bus (org.bluez)
┌──────────────────────────▼──────────────────────────────────────┐
│                        bluetoothd (守护进程)                      │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌───────────────────┐  │
│  │  Adapter  │ │  Device  │ │ Profile  │ │  GATT Manager     │  │
│  │  Manager  │ │  Manager │ │ Manager  │ │  Client/Server    │  │
│  └────┬─────┘ └────┬─────┘ └────┬─────┘ └────────┬──────────┘  │
│       │            │            │                 │             │
│  ┌────▼────────────▼────────────▼─────────────────▼──────────┐ │
│  │               Plugin 系统 (profiles/*)                      │ │
│  │  A2DP│AVRCP│HFP│HID│GATT Profiles│PAN│BAP│CSIP│TMAP...     │ │
│  └───────────────────────────┬────────────────────────────────┘ │
│                              │                                   │
│  ┌───────────────────────────▼────────────────────────────────┐ │
│  │           共享库 (src/shared/ + ell/)                        │ │
│  │  GATT DB │ MGMT │ HCI │ IO │ Crypto │ Queue │ BAP ...     │ │
│  └───────────────────────────┬────────────────────────────────┘ │
└──────────────────────────────┼──────────────────────────────────┘
                               │  mgmt socket / HCI sockets
┌──────────────────────────────▼──────────────────────────────────┐
│                   Linux Kernel Bluetooth 子系统                   │
│  ┌────────┐  ┌────────┐  ┌────────┐  ┌────────┐  ┌────────┐   │
│  │ HCI    │  │ L2CAP  │  │ SCO    │  │ RFCOMM │  │ BNEP   │   │
│  │ Core   │  │        │  │        │  │        │  │        │   │
│  └────────┘  └────────┘  └────────┘  └────────┘  └────────┘   │
├──────────────────────────────┬──────────────────────────────────┤
│                   Bluetooth 控制器 (USB/UART/PCI)                │
└─────────────────────────────────────────────────────────────────┘

3.2 关键架构特性

  1. 1. D-Bus 驱动架构: 所有核心功能通过 D-Bus 系统总线暴露,应用与 bluetoothd 解耦
  2. 2. Plugin 插件体系: 蓝牙 Profile 作为插件动态加载 (profiles/*/)
  3. 3. 双循环支持: 支持 GLib 主循环和 ELL 主循环两种事件模型
  4. 4. 共享组件: 公共基础库 src/shared/ 支持 GLib 和 ELL 两套后端
  5. 5. MGMT 协议: 通过 mgmt socket 与内核通信,取代直接操作 HCI

4. 核心模块详解

4.1 bluetoothd 守护进程 (src/)

BlueZ 核心守护进程,处理所有蓝牙操作。

入口src/main.c:1481 — main()` 函数

启动流程:

main()
├── init_defaults()          — 初始化全局配置默认值
├── parse_config(config)     — 解析 /etc/bluetooth/main.conf
├── connect_dbus()           — 连接到 system D-Bus
├── adapter_init()           — 初始化适配器管理
│   ├── 创建 mgmt socket
│   └── 枚举已连接的蓝牙适配器
├── btd_device_init()        — 设备管理器初始化
├── btd_agent_init()         — Agent 交互层初始化
├── btd_profile_init()       — Profile 管理器初始化
├── start_sdp_server()       — SDP 服务 (BR/EDR)
├── plugin_init()            — 加载所有内置及外部插件
├── rfkill_init()            — RFKILL 监控
├── mainloop_run_with_signal() — 进入 GLib 主循环
└── shutdown sequence        — 按相反顺序清理

核心源文件:

文件
职责
main.c
入口、配置解析、初始化编排
adapter.c
 (+ adapter.h)
蓝牙适配器管理、配对绑定、mgmt 命令
device.c
 (+ device.h)
远程设备生命周期管理、GATT 客户端
profile.c
 (+ profile.h)
Profile 注册/探测/连接
agent.c
Pairing Agent 交互
gatt-database.c
GATT Server 数据库 (D-Bus 暴露)
gatt-client.c
GATT Client (内核 GATT 接口)
advertising.c
LE Advertising Manager
adv_monitor.c
广播监控器管理
battery.c
电池信息服务
bearer.c
Bearer (BR/EDR 与 LE) 抽象层
set.c
Device Set (CSIP 协调集) 管理
settings.c
设置存储
storage.c
持久化存储
eir.c
Extended Inquiry Response 处理
sdpd.c
SDP 守护进程
sdp-client.c
SDP 客户端

4.2 适配器管理 (Adapter Manager)

src/adapter.c — 12,000+ 行,最大源文件之一。

核心职责:

  • • 枚举所有蓝牙适配器 (hci0hci1, ...)
  • • 通过 mgmt socket 与内核蓝牙子系统通信
  • • 管理配对、发现、扫描参数
  • • 控制电源、可发现性、可连接性
  • • 实验性功能注册 (Debug, BQR, RPA Resolution, LE Simultaneous Roles, ISO Socket, Codec Offload)

mgmt 命令接口:

// 与内核通信的核心机制 — mgmt socket
static
struct mgmt *mgmt_primary = NULL;

// 重要操作:

MGMT_OP_READ_INDEX_LIST        — 枚举适配器
MGMT_OP_READ_INFO              — 读取适配器信息
MGMT_OP_SET_POWERED            — 电源控制
MGMT_OP_SET_DISCOVERABLE       — 可发现模式
MGMT_OP_SET_CONNECTABLE        — 可连接模式
MGMT_OP_START_DISCOVERY        — 开始发现
MGMT_OP_STOP_DISCOVERY         — 停止发现
MGMT_OP_PAIR_DEVICE            — 配对
MGMT_OP_CANCEL_PAIR_DEVICE     — 取消配对
MGMT_OP_UNPAIR_DEVICE          — 解除绑定

4.3 设备管理 (Device Manager)

src/device.c — 约 5,800 行。

数据模型:

btd_device
├── bdaddr / bdaddr_type          — 地址
├── adapter                       — 所属适配器
├── name                          — 设备名称
├── class                         — 设备类
├── appearance                    — LE 外观
├── paired / bonded               — 配对状态
├── gatt_client / gatt_server     — GATT 通道
├── services / profiles           — 已发现的服务
├── keys (LTK/IRK/CSRK)          — 安全密钥
├── connection state              — 连接状态
└── uuids                         — 支持的 UUID 列表

5. D-Bus 接口体系

BlueZ 通过 D-Bus 系统总线 org.bluez 暴露所有功能。

5.1 Core Interfaces (在 bluetoothd 中实现)

接口
对象路径
用途
org.bluez.Adapter1/org/bluez/hciX
适配器控制
org.bluez.Device1/org/bluez/hciX/dev_XX_XX_XX_XX_XX_XX
远程设备管理
org.bluez.Agent1
由客户端提供
配对交互
org.bluez.AgentManager1/org/bluez
Agent 注册
org.bluez.ProfileManager1/org/bluez
Profile 注册
org.bluez.GattManager1/org/bluez/hciX
GATT Server 管理
org.bluez.GattService1/org/bluez/hciX/dev_XX/serviceX
GATT 服务
org.bluez.GattCharacteristic1/org/bluez/hciX/dev_XX/serviceX/charX
GATT 特征
org.bluez.GattDescriptor1/org/bluez/hciX/dev_XX/serviceX/charX/descX
GATT 描述符
org.bluez.LEAdvertisingManager1/org/bluez/hciX
广播管理
org.bluez.LEAdvertisement1
由客户端提供
广播数据
org.bluez.BatteryProviderManager1/org/bluez
电池信息
org.bluez.Battery1
由客户端或系统提供
电池状态
org.bluez.AdvertisementMonitorManager1/org/bluez
广播监控管理
org.bluez.DeviceSet1/org/bluez/set_X
协调设备集

5.2 Profile-Specific Interfaces (插件暴露)

接口
用途
org.bluez.Media1
A2DP 媒体控制
org.bluez.MediaEndpoint1
A2DP 编解码端点
org.bluez.MediaTransport1
A2DP 媒体传输通道
org.bluez.MediaControl1
AVRCP 媒体控制
org.bluez.MediaFolder1
AVRCP 媒体浏览
org.bluez.MediaPlayer1
AVRCP 播放器状态
org.bluez.MediaItem1
AVRCP 媒体条目
org.bluez.Input1
HID 设备
org.bluez.Network1
PAN 网络
org.bluez.HealthDevice1
HDP 健康设备
org.bluez.HeartRate1
心率监测
org.bluez.Thermometer1
温度计

6. 核心流程分析

6.1 设备发现流程

用户态应用                    bluetoothd                        内核
    │                           │                                │
    │  StartDiscovery()         │                                │
    │ ───────────────────────►  │  MGMT_OP_START_DISCOVERY      │
    │                           │ ──────────────────────────────►│
    │                           │                                │
    │                           │  ◄─── MGMT_EV_DEVICE_FOUND ───┤
    │                           │     (每个发现到的设备)          │
    │                           │                                │
    │  PropertiesChanged        │                                │
    │ ◄───────────────────────  │                                │
    │  (Device1 Found / RSSI)   │                                │
    │                           │                                │
    │  StopDiscovery()          │                                │
    │ ───────────────────────►  │  MGMT_OP_STOP_DISCOVERY       │
    │                           │ ──────────────────────────────►│
    │  Discovering = false      │                                │
    │ ◄───────────────────────  │                                │

6.2 配对绑定流程 (LE Secure Connections)

应用                    bluetoothd               Agent               内核
 │                         │                      │                  │
 │ PairDevice(addr)        │                      │                  │
 │────────────────────►    │                      │                  │
 │                         │ MGMT_OP_PAIR_DEVICE  │                  │
 │                         │─────────────────────►│                  │
 │                         │                      │                  │
 │                         │  ◄─ MGMT_EV_NEW_IRK ─┤                  │
 │                         │  ◄─ MGMT_EV_NEW_LTK ─┤                  │
 │                         │  ◄─ MGMT_EV_NEW_CSRK─┤                  │
 │                         │                      │                  │
 │                         │ RequestConfirmation  │                  │
 │                         │◄────────────────────│                  │
 │                         │    (Agent交互)        │                  │
 │                         │────────────────────►│                  │
 │                         │                      │                  │
 │ ◄─ Pairing Complete ────┤                      │                  │

6.3 GATT 服务发现流程

bluetoothd Device                  远端 GATT Server
    │                                      │
    │ Exchange MTU Request                  │
    │ ───────────────────────────────────►  │
    │ ◄─── Exchange MTU Response ────────── │
    │                                      │
    │ Discover All Primary Services         │
    │ ───────────────────────────────────►  │
    │ ◄─── Read by Group Type Response ──── │
    │                                      │
    │ Discover All Characteristics          │
    │ ───────────────────────────────────►  │
    │ ◄─── Read by Type Response ────────── │
    │                                      │
    │ Discover All Descriptors              │
    │ ───────────────────────────────────►  │
    │ ◄─── Find Information Response ───────│
    │                                      │
    │ Enable Notifications/Indications      │
    │ ───────────────────────────────────►  │
    │ ◄─── Write Response ──────────────── │

6.4 A2DP 音频流建立流程

应用                    bluetoothd                   远端 A2DP Sink
 │                         │                              │
 │ Connect("A2DP_Sink")    │                              │
 │────────────────────►    │                              │
 │                         │ AVDTP Discover              │
 │                         │ ───────────────────────────► │
 │                         │ ◄── AVDTP Discover Resp ──── │
 │                         │                              │
 │                         │ AVDTP Get Capabilities       │
 │                         │ ───────────────────────────► │
 │                         │ ◄── AVDTP Get Caps Resp ──── │
 │                         │                              │
 │                         │ AVDTP Set Configuration      │
 │                         │ ───────────────────────────► │
 │                         │ ◄── AVDTP Set Config Resp ───│
 │                         │                              │
 │                         │ AVDTP Open                   │
 │                         │ ───────────────────────────► │
 │                         │ ◄── AVDTP Open Resp ──────── │
 │                         │                              │
 │                         │ AVDTP Start                  │
 │                         │ ───────────────────────────► │
 │                         │ ◄── AVDTP Start Resp ────────│
 │                         │                              │
 │ TransportCreated        │                              │
 │◄────────────────────    │                              │
 │                         │         ◄ 音频流 ►           │

7. 关键子系统

7.1 Plugin 系统

插件是 BlueZ 的核心扩展机制,每个蓝牙 Profile 独立封装为插件。

注册机制:

// 每个插件使用 BLUETOOTH_PLUGIN_DEFINE 宏
BLUETOOTH_PLUGIN_DEFINE(a2dp, ...)

内置插件 (plugins/):

插件
功能
policy
连接策略管理 (自动连接、重连)
autopair
自动配对 (Simple Pairing)
neard
NFC 交互集成
hostname
主机名管理
admin
管理策略 (UUID 允许列表)
sixaxis
Sony PS 手柄支持

外部插件 (profiles/*/): 所有蓝牙 Profile 实现

7.2 共享库 (src/shared/)

双后端架构 — 同时支持 GLib 和 ELL (Embedded Linux Library):

组件
文件
功能
GATT DB
gatt-db.c
GATT 数据库/树管理
GATT Client
gatt-client.c
GATT 客户端实现
GATT Server
gatt-server.c
GATT 服务端实现
ATT
att.c
Attribute Protocol
HCI
hci.c
HCI 命令/事件
MGMT
mgmt.c
mgmt socket 通信
BAP
bap.c
Basic Audio Profile
BASS
bass.c
Broadcast Audio Scan Service
CSIP
csip.c
Coordinated Set Ident. Profile
Crypto
crypto.c
蓝牙加密/签名
ECC
ecc.c
椭圆曲线加密 (P-256)
IO
io-glib.c
 / io-ell.c
IO 抽象层
Queue
queue.c
队列数据结构
RingBuf
ringbuf.c
环形缓冲区
Shell
shell.c
交互式 Shell 框架
UHID
uhid.c
用户态 HID
UInput
uinput.c
用户态输入设备
Util
util.c
通用工具函数
IO (GLib)
mainloop-glib.c
GLib 事件循环
IO (ELL)
mainloop-ell.c
ELL 事件循环
Crypto+
hci-crypto.c
HCI 级加密
BTP
btp.c
BTP 测试协议
BTSnoop
btsnoop.c
蓝牙抓包格式
IO (BTP)
io-ell.c
 / io-glib.c
跨平台 IO
L2CAP test
l2cap-test.c
L2CAP 测试
Tester
tester.c
测试框架
AD
ad.c
广播数据解析
Att types
att-types.h
ATT 类型定义
Log
log.c
日志系统
IO redirect
mainloop-notify.c
IO 重定向
Gap
gap.c
Generic Access Profile
HFP
hfp.c
Hands-Free Profile
IO redirect
io-mainloop.c
IO 主循环

7.3 OBEX 守护进程 (obexd/)

独立的 OBEX 守护进程,处理文件传输和信息同步:

obexd/src/
├── main.c       — OBEX 守护进程入口
├── obex.c       — OBEX 协议核心
├── server.c     — OBEX 服务器
├── transport.c  — 传输层抽象 (蓝牙/UNIX)
├── plugin.c     — OBEX 插件系统
├── manager.c    — 会话管理
├── service.c    — 服务注册
└── mimetype.c   — MIME 类型处理

obexd/plugins/
├── bluetooth.c  — 蓝牙传输后端
├── filesystem.c — 文件系统后端
├── ftp.c        — 文件传输
├── opp.c        — 对象推送
├── pbap.c       — 电话簿访问
├── mas.c        — 消息访问
├── irmc.c       — IRMC 同步
├── pcsuite.c    — PC Suite 同步
└── vcard.c      — vCard 解析

7.4 Mesh 实现 (mesh/)

独立的蓝牙 Mesh 网络实现,支持:

  • • PB-ADV Provisioning
  • • 配置模型服务器
  • • 朋友节点 (Friend Node)
  • • 低功耗节点 (LCFN)
  • • 中继 (Relay)
  • • RPL (重放保护列表)
  • • 多个 AppKey/NetKey 管理
  • • Model 扩展框架

8. 工具生态

8.1 用户态工具

工具
文件位置
用途
bluetoothctlclient/main.c
主要交互式控制工具 (通过 D-Bus)
btmgmttools/btmgmt.c
直接 mgmt socket 操作 (低层)
hcitooltools/hcitool.c
HCI 级设备管理 (已废弃)
hciconfigtools/hciconfig.c
适配器配置 (已废弃)
btattachtools/btattach.c
通过 UART 连接蓝牙控制器
btproxytools/btproxy.c
蓝牙代理
btsnooptools/btsnoop.c
蓝牙抓包工具
btmonmonitor/
蓝牙协议监控器
btplayertools/bluetooth-player.c
蓝牙音频播放器
btgatt-clienttools/btgatt-client.c
GATT 客户端示例
btgatt-servertools/btgatt-server.c
GATT 服务端示例
meshctlmesh/
Mesh 网络控制工具
obexctl
OBEX 控制工具
btpclientclient/btpclient/
BTP 测试客户端
btinfotools/btinfo.c
蓝牙设备信息查看
bcmfwtools/bcmfw.c
Broadcom 固件升级
bluemoontools/bluemoon.c
Intel 蓝牙调试

8.2 测试工具

工具
用途
hci-tester
HCI 接口测试
gap-tester
GAP 测试
bnep-tester
BNEP 网络测试
6lowpan
6LoWPAN 测试
check-selftest
自测试检查
unit/
单元测试目录 (unit/test-*.c)

8.3 调试工具

工具
用途
monitor/btmon
实时 HCI 协议抓包/解码
monitor/analyzer
btmon 分析器
btsnoop
生成/读取 btsnoop 格式抓包文件
hcidump (通过 btmon)
传统 HCI 抓包兼容
logger
btmon 日志记录器

9. 配置与存储

9.1 配置文件

文件
用途
/etc/bluetooth/main.conf
主配置 (General, BR, LE, Policy, GATT, CSIS, AVDTP, AVRCP, AdvMon)
/etc/bluetooth/input.conf
输入设备配置
/etc/bluetooth/network.conf
网络配置
/etc/dbus-1/system.d/bluetooth.conf
D-Bus 安全策略

9.2 main.conf 配置

配置节
关键选项
[General]Name
ClassDiscoverableTimeoutAlwaysPairableControllerModePrivacyFastConnectable
[BR]PageScanType/Interval/Window
InquiryScanType/Interval/Window
[LE]ScanInterval*
MinConnectionIntervalMaxConnectionInterval
[Policy]ReconnectUUIDs
ReconnectAttemptsAutoEnable
[GATT]Cache
ExchangeMTUKeySizeClient
[CSIS]SIRK
EncryptionSizeRank
[AVDTP]SessionMode
StreamMode
[AVRCP]VolumeWithoutTarget
VolumeCategory
[AdvMon]RSSISamplingPeriod

9.3 持久化存储

Bluetooth 状态存储在 /var/lib/bluetooth/

/var/lib/bluetooth/
├── XX:XX:XX:XX:XX:XX/         # 每适配器一个目录
│   ├── settings               # 适配器设置
│   ├── cache/                 # GATT 缓存
│   └── YY:YY:YY:YY:YY:YY/    # 每个配对设备一个目录
│       ├── info               # 设备信息 (名称, 地址, 类等)
│       ├── primary            # GATT 主服务
│       └── attributes         # GATT 缓存属性

9.4 GATT 缓存策略

通过 main.conf 的 [GATT].Cache 选项控制:

  • • always: 始终使用缓存
  • • yes: 使用缓存 (服务变更检测启用时)
  • • no: 禁用缓存,始终完整发现

10. 体系结构图

10.1 内部组件依赖

                           bluetoothd
                              │
        ┌─────────────────────┼─────────────────────┐
        │                     │                     │
   src/adapter.c        src/device.c          src/profile.c
        │                     │                     │
        ├── mgmt socket ──────┤                     │
        │                     │                     │
   profiles/audio/a2dp.c      │          plugins/policy.c
        │                     │                     │
   profiles/input/hog.c  src/gatt-database.c        │
        │                     │                     │
   profiles/network/    src/gatt-client.c           │
        │                     │                     │
        └──────────────┬──────┘                     │
                       │                            │
               src/shared/ (lib)                    │
           ┌───────────┼───────────┐                │
           │           │           │                │
        gatt-db    mgmt/hci     io/queue           ell/

10.2 数据流 (以 A2DP 音频为例)

[手机/蓝牙音箱]                    [Linux 桌面]
      │                               │
      │  HCI 链路 (ACL+SCO)            │
      │ ──────────────────────────►    │
      │                          kernel/bluetooth
      │                               │
      │                          MGMT_EV_CONNECTED
      │                          AVDTP start stream
      │ ──────────────────────────►    │
      │                          bluetoothd
      │                               │
      │                          profiles/audio/a2dp.c
      │                               │
      │                          ├── a2dp-sep.c (Sink Endpoint)
      │                          ├── avdtp.c (信令)
      │                          └── transport.c (传输)
      │                               │
      │                          D-Bus: MediaTransport1
      │                               │
      │                     [PulseAudio/PipeWire]
      │                          │ 解码 PCM → ALSA
      │                          ▼
      │                     [扬声器输出]

附录 A: 代码统计

目录
说明
C 文件数
估计行数
src/
bluetoothd 核心
30+
~100,000
src/shared/
共享库
40+
~50,000
profiles/audio/
音频 Profile
15+
~60,000
profiles/input/
HID Profile
6
~10,000
profiles/network/
PAN Profile
4
~5,000
profiles/
 其他
其他 Profile
10+
~15,000
client/
bluetoothctl
10+
~15,000
tools/
工具
30+
~30,000
monitor/
btmon 监控器
10+
~20,000
obexd/
OBEX 守护进程
20+
~20,000
mesh/
Mesh 网络
30+
~30,000
lib/
libbluetooth
5+
~10,000
plugins/
内置插件
5+
~5,000
gdbus/
D-Bus 绑定
5+
~5,000
ell/
Embedded Linux Library
30+
~30,000
btio/
BtIO 库
5+
~3,000
总计~250+~525,000

附录 B: D-Bus 操作路径总览

/org/bluez                    ─ Manager, AgentManager1, ProfileManager1
  ├── hci0                    ─ Adapter1, GattManager1, LEAdvertisingManager1
  │   ├── dev_XX_XX_XX_XX_XX_XX  ─ Device1
  │   │   ├── serviceXXXX     ─ GattService1
  │   │   │   ├── charXXXX    ─ GattCharacteristic1
  │   │   │   │   └── descXXXX  ─ GattDescriptor1
  │   ├── set_XXXX            ─ DeviceSet1
  │   └── fd_XXXX             ─ Bearer1 (LE/BREDR)
  └── hci1                    ─ (同上)a

欢迎关注:

欢迎添加微信号入群交流:

如果有更多疑问或需要帮助,可点击下方卡片,让「东东的小站AI助手」为您实时答疑:支持24小时在线 ⬇️

更多请点击左下角 阅读原文!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 16:37:37 HTTP/2.0 GET : https://f.mffb.com.cn/a/494430.html
  2. 运行时间 : 0.221172s [ 吞吐率:4.52req/s ] 内存消耗:4,534.27kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=f302babd020426aebb402db840eeff79
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000404s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000543s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.001039s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000439s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000858s ]
  6. SELECT * FROM `set` [ RunTime:0.001207s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000807s ]
  8. SELECT * FROM `article` WHERE `id` = 494430 LIMIT 1 [ RunTime:0.015179s ]
  9. UPDATE `article` SET `lasttime` = 1783067857 WHERE `id` = 494430 [ RunTime:0.015534s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.008837s ]
  11. SELECT * FROM `article` WHERE `id` < 494430 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000550s ]
  12. SELECT * FROM `article` WHERE `id` > 494430 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.003849s ]
  13. SELECT * FROM `article` WHERE `id` < 494430 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.003157s ]
  14. SELECT * FROM `article` WHERE `id` < 494430 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.013015s ]
  15. SELECT * FROM `article` WHERE `id` < 494430 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.086679s ]
0.222809s