【RV1106/RV1103】RV1103增加RTL8723BS

文章目录

  • Kernel 部分支持
    • 配置 menuconfig
      • WiFi 功能支持
      • Bluetooth 功能支持
  • 原SDK的Busybox配置
  • BT 部分
  • 文件系统部分
  • 蓝牙测试
    • dbus 安装测试遇到的问题
    • 让`hci0`出来
  • 使用hcitool来操作

Kernel 部分支持

配置 menuconfig

WiFi 功能支持

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Bluetooth 功能支持

在这里插入图片描述

正基和海华的模块都使用内核的默认 CONFIG_BT_HCIUART 驱动,而Realtek使用自己的hci uart驱动,源码目录为: external\rkwifibt\realtek\bluetooth_uart_driver , 且使用ko方式加载,所以使用Realtek时一定要把内核的CONFIG_BT_HCIUART配置去掉!如下图,不要选上!!!
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

原SDK的Busybox配置

在这里插入图片描述
增加rfkill的支持

BT 部分

需要一个文件夹:rkwifibt-1.0.0 (我从RV1126的SDK里面找到的)

# insmod hci_uart.ko
[  242.292615] Bluetooth: HCI UART driver ver 2.2.74e8f89.20210423-153941
[  242.292# 653] Bluetooth: HCI H4 protocol initialized
[  242.292662] Bluetooth: HCI Realtek H5 protocol initialized
[  242.292669] rtk_btcoex: rtk_btcoex_init: version: 1.2
[  242.292676] rtk_btcoex: create workqueue
[  242.292894] rtk_btcoex: alloc buffers 1408, 2240 for ev and l2
# ./rtk_hciattach -n -s 115200 /dev/ttyS5 rtk_h5
Realtek Bluetooth init uart with init speed:115200, final_speed:115200, type:HCI UART H5
Realtek Bluetooth :Realtek hciattach version 2.5Realtek Bluetooth :3-wire sync pattern resend : 1, len: 8Realtek Bluetooth :Get SYNC Resp PktRealtek Bluetooth :Get SYNC pkt-active modeRealtek Bluetooth :3-wire config pattern resend : 1 , len: 10
Realtek Bluetooth :Get CONFG pkt-active modeRealtek Bluetooth :Get CONFG resp pkt-active modeRealtek Bluetooth :H5 init finishedRealtek Bluetooth :config offset(f4),length(8)
Realtek Bluetooth :config baud rate to :4928002, hwflowcontrol:5f, 1
Realtek Bluetooth :config offset(27),length(1)
Realtek Bluetooth :config offset(fe),length(1)
Realtek Bluetooth :config offset(15b),length(4)
Realtek Bluetooth :config offset(1e3),length(1)
Realtek Bluetooth :Get config baud rate from config file:4928002
Realtek Bluetooth :Load FW OK
Realtek Bluetooth :RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_CommandRealtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :receive hci command complete event with command:1001Realtek Bluetooth :Read RTK LMP version with Status:0
Realtek Bluetooth :gLmpVersion = 0x8723
Realtek Bluetooth :RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_CommandRealtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :receive hci command complete event with command:fc6dRealtek Bluetooth :Read RTK rom version with Status:0
Realtek Bluetooth :rtk_hw_cfg.eversion = 1
Realtek Bluetooth :rtk_get_fw_project_id: opcode 0, len 1, data 1
Realtek Bluetooth :fw_ver 0x1e3ee40e, patch_num 2
Realtek Bluetooth :patch length is 0x5e90
Realtek Bluetooth :start offset is 0x4f00
Realtek Bluetooth :fw: exists, config file: exists
Realtek Bluetooth :baudrate in change speed command: 0x2 0x80 0x92 0x4
....Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 99Realtek Bluetooth :Send FW last command
Realtek Bluetooth :hci_download_patch tx_index:100 rx_index: 99Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 100Realtek Bluetooth :Init Process finished
[  267.653151] Bluetooth: h5_Realtek Bluetooth post process
Device setup complete
open
[  267.653191] Bluetooth: hci_uart_register_dev
[  267.660539] rtk_btcoex: Open BTCOEX
[  267.663640] rtk_btcoex: BTCOEX hci_rev 0x1e3e
[  267.663669] rtk_btcoex: BTCOEX lmp_subver 0xe40e
[  269.707229] Bluetooth: __hci_uart_flush: hdev 27dbab53 tty 71c11fc3
[  269.707306] Bluetooth: hci_uart_close: hdev 27dbab53
[  269.707332] Bluetooth: __hci_uart_flush: hdev 27dbab53 tty 71c11fc3
[  269.707354] rtk_btcoex: Close BTCOEX
[  269.707372] rtk_btcoex: -x
[  335.605060] RTL8723BS: rtw_set_802_11_connect(wlan0)  fw_state = 0x00000008

文件系统部分

需要借助buildroot来构建一些蓝牙相关的软件例如:bluez5
我尝试了手动交叉编译这些软件,卡在了bluez5这里已经花费我20h。而借用Buildroot只花费了2h。

xxxx_defconfig

BR2_arm=y
BR2_cortex_a7=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_PATH="/home/liefyuan/luckfox-pico-main/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf"
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-rockchip830-linux-uclibcgnueabihf"
BR2_TOOLCHAIN_EXTERNAL_GCC_8=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_10=y
BR2_TOOLCHAIN_EXTERNAL_WCHAR=y
BR2_TOOLCHAIN_EXTERNAL_HAS_SSP=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
# BR2_TARGET_ENABLE_ROOT_LOGIN is not set
BR2_SYSTEM_BIN_SH_NONE=y
BR2_SYSTEM_ENABLE_NLS=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_DBUS_CPP=y
BR2_PACKAGE_DBUS_TRIGGERD=y
BR2_PACKAGE_BLUEZ_TOOLS=y
BR2_PACKAGE_BLUEZ5_UTILS=y
BR2_PACKAGE_BLUEZ5_UTILS_CLIENT=y
BR2_PACKAGE_BLUEZ5_UTILS_TOOLS=y
BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED=y
BR2_PACKAGE_BLUEZ5_UTILS_EXPERIMENTAL=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_UTIL_LINUX=y

我的Buildroot版本是:Buildroot-2023.02.06
上面的配置出来的文件系统非常干净,看一下(make graph-depends)依赖图
在这里插入图片描述
大概只有12MB左右。

蓝牙测试

dbus 安装测试遇到的问题

使用dbus-daemon --system --print-pid --print-address命令来启动dbus后台程序为了和蓝牙通讯。

# dbus-daemon --system --print-pid --print-address
dbus-daemon[469]: Failed to start message bus: Failed to bind socket "/run/dbus/system_bus_socket": No such file or directory

需要创建目录/run/dbus

# mkdir -p /run/dbus
# dbus-daemon --system --print-pid --print-address
unix:path=/run/dbus/system_bus_socket,guid=6973ec2014fa0880afbdcae3000000b1
dbus-daemon[461]: Failed to start message bus: Could not get UID and GID for username "dbus"

需要创建一个用户名叫dbus,密码不需要,我文件系统里面没有adduser命令,所以只能在/etc/passwd文件里面最后添加:

dbus:0:0:0:::

然后就可以正常了。如下

# dbus-daemon --system --print-pid --print-address
unix:path=/run/dbus/system_bus_socket,guid=8e19ed4e6e585e498d7c956c0000046a
474

hci0出来

安装.ko:insmod hci_uart.ko

# insmod hci_uart.ko
[   32.387318] Bluetooth: HCI UART driver ver 2.2.74e8f89.20210423-153941
[   32.38734# 9] Bluetooth: HCI H4 protocol initialized
[   32.387356] Bluetooth: HCI Realtek H5 protocol initialized
[   32.387363] rtk_btcoex: rtk_btcoex_init: version: 1.2
[   32.387369] rtk_btcoex: create workqueue
[   32.387582] rtk_btcoex: alloc buffers 1408, 2240 for ev and l2

运行:./rtk_hciattach -n -s 115200 ttyS5 rtk_h5 &

# ./rtk_hciattach -n -s 115200 ttyS5 rtk_h5 &
# [   46.923577] of_dma_request_slave_channel: dma-names property of node Realtek Bluetooth init uart with i'/nit speed:115200,115200, type:HCI UART H5
seriRealtek Bluetooth :Realtek hciattach version 2.5al@ff4f0000' misRealtek Bluetooth :3-wire sync pattern resend : 1, len: 8Realtek Bluetooth :Get SYNC Resp PktRealtek Bluetooth :Get SYNC pkt-active modeRealtek Bluetooth :3-wire config pattern resend : 1 , len: 10
Realtek Bluetooth :Get CONFG pkt-active modeRealtek Bluetooth :Get CONFG resp pkt-active modesing Realtek Bluetooth :H5 init finishedor empty
[  Realtek Bluetooth :config offset(f4),length(8)
Realtek Bluetooth :config baud rate to :4928002, hwflowcontrol:5f, 1
Realtek Bluetooth :config offset(27),length(1)
Realtek Bluetooth :config offset(fe),length(1)
Realtek Bluetooth :config offset(15b),length(4)
Realtek Bluetooth :config offset(1e3),length(1)
Realtek Bluetooth :Get config baud rate from config file:492800246.923698] dw-apb-uart ff4f0000.serial: failed to request DMA, use Realtek Bluetooth :Load FW OK
Realtek Bluetooth :RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_CommandRealtek Bluetooth :Received reliaible seqno 0 from card
Realtek Bluetooth :receive hci command complete event with command:1001Realtek Bluetooth :Read RTK LMP version with Status:0
nterrupt mode
Realtek Bluetooth :gLmpVersion = 0x8723
Realtek Bluetooth :RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_CommandRealtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :receive hci command complete event with command:fc6dRealtek Bluetooth :Read RTK rom version with Status:0
Realtek Bluetooth :rtk_hw_cfg.eversion = 1
Realtek Bluetooth :rtk_get_fw_project_id: opcode 0, len 1, data 1
Realtek Bluetooth :fw_ver 0x1e3ee40e, patch_num 2
Realtek Bluetooth :patch length is 0x5e90
Realtek Bluetooth :start offset is 0x4f00
Realtek Bluetooth :fw: exists, config file: exists
Realtek Bluetooth :baudrate in change speed command: 0x2 0x80 0x92 0x4Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :receive hci command complete event with command:fc17Realtek Bluetooth :Change BD Rate with status:0
Realtek Bluetooth :final_speed 1500000Realtek Bluetooth :hw flow control enable
Realtek Bluetooth :iEndIndex:96  iLastPacketLen:71 iAdditionpkt:4Realtek Bluetooth :hci_download_patch tx_index:0 rx_index: -1Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 0Realtek Bluetooth :hci_download_patch tx_index:1 rx_index: 0Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 1Realtek Bluetooth :hci_download_patch tx_index:2 rx_index: 1Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 2Realtek Bluetooth :hci_download_patch tx_index:3 rx_index: 2Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 3Realtek Bluetooth :hci_download_patch tx_index:4 rx_index: 3Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 4Realtek Bluetooth :hci_download_patch tx_index:5 rx_index: 4Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 5Realtek Bluetooth :hci_download_patch tx_index:6 rx_index: 5Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 6Realtek Bluetooth :hci_download_patch tx_index:7 rx_index: 6Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 7Realtek Bluetooth :hci_download_patch tx_index:8 rx_index: 7Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 8Realtek Bluetooth :hci_download_patch tx_index:9 rx_index: 8Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 9Realtek Bluetooth :hci_download_patch tx_index:10 rx_index: 9Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 10Realtek Bluetooth :hci_download_patch tx_index:11 rx_index: 10Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 11Realtek Bluetooth :hci_download_patch tx_index:12 rx_index: 11Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 12Realtek Bluetooth :hci_download_patch tx_index:13 rx_index: 12Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 13Realtek Bluetooth :hci_download_patch tx_index:14 rx_index: 13Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 14Realtek Bluetooth :hci_download_patch tx_index:15 rx_index: 14Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 15Realtek Bluetooth :hci_download_patch tx_index:16 rx_index: 15Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 16Realtek Bluetooth :hci_download_patch tx_index:17 rx_index: 16Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 17Realtek Bluetooth :hci_download_patch tx_index:18 rx_index: 17Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 18Realtek Bluetooth :hci_download_patch tx_index:19 rx_index: 18Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 19Realtek Bluetooth :hci_download_patch tx_index:20 rx_index: 19Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 20Realtek Bluetooth :hci_download_patch tx_index:21 rx_index: 20Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 21Realtek Bluetooth :hci_download_patch tx_index:22 rx_index: 21Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 22Realtek Bluetooth :hci_download_patch tx_index:23 rx_index: 22Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 23Realtek Bluetooth :hci_download_patch tx_index:24 rx_index: 23Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 24Realtek Bluetooth :hci_download_patch tx_index:25 rx_index: 24Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 25Realtek Bluetooth :hci_download_patch tx_index:26 rx_index: 25Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 26Realtek Bluetooth :hci_download_patch tx_index:27 rx_index: 26Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 27Realtek Bluetooth :hci_download_patch tx_index:28 rx_index: 27Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 28Realtek Bluetooth :hci_download_patch tx_index:29 rx_index: 28Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 29Realtek Bluetooth :hci_download_patch tx_index:30 rx_index: 29Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 30Realtek Bluetooth :hci_download_patch tx_index:31 rx_index: 30Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 31Realtek Bluetooth :hci_download_patch tx_index:32 rx_index: 31Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 32Realtek Bluetooth :hci_download_patch tx_index:33 rx_index: 32Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 33Realtek Bluetooth :hci_download_patch tx_index:34 rx_index: 33Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 34Realtek Bluetooth :hci_download_patch tx_index:35 rx_index: 34Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 35Realtek Bluetooth :hci_download_patch tx_index:36 rx_index: 35Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 36Realtek Bluetooth :hci_download_patch tx_index:37 rx_index: 36Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 37Realtek Bluetooth :hci_download_patch tx_index:38 rx_index: 37Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 38Realtek Bluetooth :hci_download_patch tx_index:39 rx_index: 38Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 39Realtek Bluetooth :hci_download_patch tx_index:40 rx_index: 39Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 40Realtek Bluetooth :hci_download_patch tx_index:41 rx_index: 40Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 41Realtek Bluetooth :hci_download_patch tx_index:42 rx_index: 41Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 42Realtek Bluetooth :hci_download_patch tx_index:43 rx_index: 42Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 43Realtek Bluetooth :hci_download_patch tx_index:44 rx_index: 43Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 44Realtek Bluetooth :hci_download_patch tx_index:45 rx_index: 44Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 45Realtek Bluetooth :hci_download_patch tx_index:46 rx_index: 45Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 46Realtek Bluetooth :hci_download_patch tx_index:47 rx_index: 46Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 47Realtek Bluetooth :hci_download_patch tx_index:48 rx_index: 47Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 48Realtek Bluetooth :hci_download_patch tx_index:49 rx_index: 48Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 49Realtek Bluetooth :hci_download_patch tx_index:50 rx_index: 49Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 50Realtek Bluetooth :hci_download_patch tx_index:51 rx_index: 50Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 51Realtek Bluetooth :hci_download_patch tx_index:52 rx_index: 51Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 52Realtek Bluetooth :hci_download_patch tx_index:53 rx_index: 52Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 53Realtek Bluetooth :hci_download_patch tx_index:54 rx_index: 53Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 54Realtek Bluetooth :hci_download_patch tx_index:55 rx_index: 54Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 55Realtek Bluetooth :hci_download_patch tx_index:56 rx_index: 55Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 56Realtek Bluetooth :hci_download_patch tx_index:57 rx_index: 56Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 57Realtek Bluetooth :hci_download_patch tx_index:58 rx_index: 57Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 58Realtek Bluetooth :hci_download_patch tx_index:59 rx_index: 58Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 59Realtek Bluetooth :hci_download_patch tx_index:60 rx_index: 59Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 60Realtek Bluetooth :hci_download_patch tx_index:61 rx_index: 60Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 61Realtek Bluetooth :hci_download_patch tx_index:62 rx_index: 61Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 62Realtek Bluetooth :hci_download_patch tx_index:63 rx_index: 62Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 63Realtek Bluetooth :hci_download_patch tx_index:64 rx_index: 63Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 64Realtek Bluetooth :hci_download_patch tx_index:65 rx_index: 64Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 65Realtek Bluetooth :hci_download_patch tx_index:66 rx_index: 65Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 66Realtek Bluetooth :hci_download_patch tx_index:67 rx_index: 66Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 67Realtek Bluetooth :hci_download_patch tx_index:68 rx_index: 67Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 68Realtek Bluetooth :hci_download_patch tx_index:69 rx_index: 68Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 69Realtek Bluetooth :hci_download_patch tx_index:70 rx_index: 69Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 70Realtek Bluetooth :hci_download_patch tx_index:71 rx_index: 70Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 71Realtek Bluetooth :hci_download_patch tx_index:72 rx_index: 71Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 72Realtek Bluetooth :hci_download_patch tx_index:73 rx_index: 72Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 73Realtek Bluetooth :hci_download_patch tx_index:74 rx_index: 73Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 74Realtek Bluetooth :hci_download_patch tx_index:75 rx_index: 74Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 75Realtek Bluetooth :hci_download_patch tx_index:76 rx_index: 75Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 76Realtek Bluetooth :hci_download_patch tx_index:77 rx_index: 76Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 77Realtek Bluetooth :hci_download_patch tx_index:78 rx_index: 77Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 78Realtek Bluetooth :hci_download_patch tx_index:79 rx_index: 78Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 79Realtek Bluetooth :hci_download_patch tx_index:80 rx_index: 79Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 80Realtek Bluetooth :hci_download_patch tx_index:81 rx_index: 80Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 81Realtek Bluetooth :hci_download_patch tx_index:82 rx_index: 81Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 82Realtek Bluetooth :hci_download_patch tx_index:83 rx_index: 82Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 83Realtek Bluetooth :hci_download_patch tx_index:84 rx_index: 83Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 84Realtek Bluetooth :hci_download_patch tx_index:85 rx_index: 84Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 85Realtek Bluetooth :hci_download_patch tx_index:86 rx_index: 85Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 86Realtek Bluetooth :hci_download_patch tx_index:87 rx_index: 86Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 87Realtek Bluetooth :hci_download_patch tx_index:88 rx_index: 87Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 88Realtek Bluetooth :hci_download_patch tx_index:89 rx_index: 88Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 89Realtek Bluetooth :hci_download_patch tx_index:90 rx_index: 89Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 90Realtek Bluetooth :hci_download_patch tx_index:91 rx_index: 90Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 91Realtek Bluetooth :hci_download_patch tx_index:92 rx_index: 91Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 92Realtek Bluetooth :hci_download_patch tx_index:93 rx_index: 92Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 93Realtek Bluetooth :hci_download_patch tx_index:94 rx_index: 93Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 94Realtek Bluetooth :hci_download_patch tx_index:95 rx_index: 94Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 95Realtek Bluetooth :hci_download_patch tx_index:96 rx_index: 95Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 96Realtek Bluetooth :hci_download_patch tx_index:97 rx_index: 96Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 97Realtek Bluetooth :hci_download_patch tx_index:98 rx_index: 97Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 98Realtek Bluetooth :hci_download_patch tx_index:99 rx_index: 98Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 99Realtek Bluetooth :Send FW last command
Realtek Bluetooth :hci_download_patch tx_index:100 rx_index: 99Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 100Realtek Bluetooth :Init Process finished
[   48.864039] Bluetooth: h5_open
Realtek Bluetooth post process
Device setup com[   48.864091] Bluetopleteot
h: hci_uart_register_dev
[   48.871291] rtk_btcoex: Open BTCOEX
[   48.875794] rtk_btcoex: BTCOEX hci_rev 0x1e3e
[   48.875815] rtk_btcoex: BTCOEX lmp_subver 0xe40e
[   51.040637] Bluetooth: __hci_uart_flush: hdev 5ae14a4f tty 8bc69d32
[   51.040720] Bluetooth: hci_uart_close: hdev 5ae14a4f
[   51.040747] Bluetooth: __hci_uart_flush: hdev 5ae14a4f tty 8bc69d32
[   51.040767] rtk_btcoex: Close BTCOEX
[   51.040786] rtk_btcoex: -x

使用命令:hciconfig

# hciconfig
hci0:   Type: Primary  Bus: UARTBD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16DOWNRX bytes:1057 acl:0 sco:0 events:30 errors:0TX bytes:827 acl:0 sco:0 commands:30 errors:0

打开hci0使用命令:hciconfig hci0 up

# hciconfig -a
hci0:   Type: Primary  Bus: UARTBD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16DOWNRX bytes:1057 acl:0 sco:0 events:30 errors:0TX bytes:827 acl:0 sco:0 commands:30 errors:0Features: 0xff 0xff 0xff 0xfe 0xdb 0xff 0x7b 0x87Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3Link policy: RSWITCH HOLD SNIFF PARKLink mode: PERIPHERAL ACCEPT# hciconfig hci0 up
[  301.298323] rtk_btcoex: Open BTCOEX
[  301.573864] Bluetooth: hu 8958aa1c retransmitting 1 pkts
[  301.576198] rtk_btcoex: BTCOEX hci_rev 0x1e3e
[  301.576224] rtk_btcoex: BTCOEX lmp_subver 0xe40e
# hciconfig
hci0:   Type: Primary  Bus: UARTBD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16DOWNRX bytes:1057 acl:0 sco:0 events:30 errors:0TX bytes:859 acl:0 sco:0 commands:30 errors:0# hciconfig hci0 up
[  109.720402] rtk_btcoex: Open BTCOEX
[  109.973975] Bluetooth: hu 8e040b96 retransmitting 1 pkts
[  109.976315] rtk_btcoex: BTCOEX hci_rev 0x1e3e
[  109.976346] rtk_btcoex: BTCOEX lmp_subver 0xe40e
# hciconfig
hci0:   Type: Primary  Bus: UARTBD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16UP RUNNINGRX bytes:2113 acl:0 sco:0 events:60 errors:0TX bytes:1518 acl:0 sco:0 commands:61 errors:0# hciconfig -a
hci0:   Type: Primary  Bus: UARTBD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16UP RUNNINGRX bytes:2113 acl:0 sco:0 events:60 errors:0TX bytes:1518 acl:0 sco:0 commands:61 errors:0Features: 0xff 0xff 0xff 0xfe 0xdb 0xff 0x7b 0x87Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3Link policy: RSWITCH HOLD SNIFF PARKLink mode: PERIPHERAL ACCEPT
[  134.027303] Bluetooth: hu 8e040b96 retransmitting 1 pktsName: 'RTK_BT_4.0'Class: 0x000000Service Classes: UnspecifiedDevice Class: Miscellaneous,HCI Version: 4.0 (0x6)  Revision: 0x1e3eLMP Version: 4.0 (0x6)  Subversion: 0xe40eManufacturer: Realtek Semiconductor Corporation (93)# [  134.037521] rtk_btcoex: BTCOEX hci_rev 0x1e3e
[  134.037549] rtk_btcoex: BTCOEX lmp_subver 0xe40e

查看当前系统中全部的蓝牙设备信息:hciconfig -a
开启指定名称的蓝牙设备:hciconfig hci0 up
关闭指定名称的蓝牙设备:hciconfig hci0 down
重置指定名称的蓝牙设备:hciconfig hci0 reset

打开dbus

# mkdir -p /run/dbus
# dbus-daemon --system --print-pid --print-address
unix:path=/run/dbus/system_bus_socket,guid=efd8f0def3b1d532a9e4538f000001a4
465

进入目录/usr/libexec/bluetooth/bluetoothd运行命令:bluetoothd -n -d &

# cd /usr/libexec/bluetooth/
# ./bluetoothd -n -d &
# ./bluetoothd -n -d &
# bluetoothd[479]: Bluetooth daemon 5.65
bluetoothd[479]: src/adapter.c:adapter_init() sending read version command
bluetoothd[479]: Starting SDP server
bluetoothd[479]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:0541
bluetoothd[479]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[479]: src/plugin.c:add_plugin() Loading hostname plugin
bluetoothd[479]: src/plugin.c:add_plugin() Loading wiimote plugin
bluetoothd[479]: src/plugin.c:add_plugin() Loading autopair plugin
bluetoothd[479]: src/plugin.c:add_plugin() Loading policy plugin
bluetoothd[479]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[479]: src/plugin.c:add_plugin() Loading gap plugin
bluetoothd[479]: src/plugin.c:add_plugin() Loading scanparam plugin
bluetoothd[479]: src/plugin.c:add_plugin() Loading deviceinfo plugin
bluetoothd[479]: src/plugin.c:add_plugin() Loading battery plugin
bluetoothd[479]: src/plugin.c:plugin_init() Loading plugins /usr/lib/bluetooth/plugins
bluetoothd[479]: profiles/network/manager.c:read_config() Config options: Security=true
bluetoothd[479]: src/rfkill.c:rfkill_init() Failed to open RFKILL control device
bluetoothd[479]: src/main.c:main() Entering main loop
bluetoothd[479]: src/shared/mgmt.c:send_request() [0xffff] command 0x0001
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0xffff] command 0x0001 complete: 0x00
bluetoothd[479]: Bluetooth management interface 1.18 initialized
bluetoothd[479]: src/adapter.c:read_version_complete() sending read supported commands command
bluetoothd[479]: src/adapter.c:read_version_complete() sending read index list command
bluetoothd[479]: src/shared/mgmt.c:send_request() [0xffff] command 0x0002
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0xffff] command 0x0002 complete: 0x00
bluetoothd[479]: src/adapter.c:read_commands_complete() Number of commands: 79
bluetoothd[479]: src/adapter.c:read_commands_complete() Number of events: 40
bluetoothd[479]: src/adapter.c:read_commands_complete() enabling kernel-side connection control
bluetoothd[479]: src/adapter.c:read_commands_complete() kernel supports the set_blocked_keys op
bluetoothd[479]: src/adapter.c:read_commands_complete() kernel supports controller cap command
bluetoothd[479]: src/adapter.c:read_commands_complete() kernel supports exp features
bluetoothd[479]: src/adapter.c:read_commands_complete() kernel supports set system confic
bluetoothd[479]: src/adapter.c:read_commands_complete() kernel supports suspend/resume events
bluetoothd[479]: src/shared/mgmt.c:send_request() [0xffff] command 0x0003
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0xffff] command 0x0003 complete: 0x00
bluetoothd[479]: src/adapter.c:read_index_list_complete() Number of controllers: 1
bluetoothd[479]: src/adapter.c:read_index_list_complete() Found index 0
bluetoothd[479]: src/adapter.c:index_added() index 0
bluetoothd[479]: src/adapter.c:reset_adv_monitors() sending remove Adv Monitor command with handle 0
bluetoothd[479]: src/adapter.c:btd_adapter_new() System name: BlueZ 5.65
bluetoothd[479]: src/adapter.c:btd_adapter_new() Major class: 0
bluetoothd[479]: src/adapter.c:btd_adapter_new() Minor class: 0
bluetoothd[479]: src/adapter.c:btd_adapter_new() Modalias: usb:v1D6Bp0246d0541
bluetoothd[479]: src/adapter.c:btd_adapter_new() Discoverable timeout: 180 seconds
bluetoothd[479]: src/adapter.c:btd_adapter_new() Pairable timeout: 0 seconds
bluetoothd[479]: src/adapter.c:index_added() sending read info command for index 0
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0053
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0053 complete: 0x00
bluetoothd[479]: src/adapter.c:reset_adv_monitors_complete() Removed all Adv Monitors
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0049
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0049 complete: 0x00
bluetoothd[479]: src/adapter.c:read_exp_features_complete() index 0 status 0x00
bluetoothd[479]: src/adapter.c:read_exp_features_complete() 671b10b5-42c0-4696-9227-eb28d1b049d6 flags 0 action 0
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0004
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0004 complete: 0x00
bluetoothd[479]: src/adapter.c:read_info_complete() index 0 status 0x00
bluetoothd[479]: src/adapter.c:clear_uuids() sending clear uuids command for index 0
bluetoothd[479]: src/adapter.c:clear_devices() sending clear devices command for index 0
bluetoothd[479]: src/adapter.c:set_mode() sending set mode command for index 0
bluetoothd[479]: src/adapter.c:set_mode() sending set mode command for index 0
bluetoothd[479]: src/adapter.c:set_mode() sending set mode command for index 0
bluetoothd[479]: src/adapter.c:set_privacy() sending set privacy command for index 0
bluetoothd[479]: src/adapter.c:set_privacy() setting privacy mode 0x00 for index 0
bluetoothd[479]: src/gatt-database.c:btd_gatt_database_new() GATT Manager registered for adapter: /org/bluez/hci0
bluetoothd[479]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10001
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001800-0000-1000-8000-00805f9
bluetoothd[479]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[479]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[479]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10002
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001801-0000-1000-8000-00805f9
bluetoothd[479]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[479]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[479]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10003
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[479]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000180a-0000-1000-8000-00805f9
bluetoothd[479]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[479]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[479]: src/advertising.c:btd_adv_manager_new() LE Advertising Manager created for adapter: /org/bluez/hci0
bluetoothd[479]: plugins/policy.c:policy_adapter_probe()
bluetoothd[479]: plugins/hostname.c:hostname_probe()
bluetoothd[479]: profiles/network/manager.c:panu_server_probe() path /org/bluez/hci0
bluetoothd[479]: profiles/network/server.c:server_register() Registered interface org.bluez.NetworkServer1 on path /org/bluez/hci0
bluetoothd[479]: profiles/network/manager.c:gn_server_probe() path /org/bluez/hci0
bluetoothd[479]: profiles/network/manager.c:nap_server_probe() path /org/bluez/hci0
bluetoothd[479]: src/adapter.c:btd_adapter_unblock_address() hci0 00:00:00:00:00:00
bluetoothd[479]: src/adapter.c:load_link_keys() hci0 keys 0 debug_keys 0
bluetoothd[479]: src/adapter.c:load_ltks() hci0 keys 0
bluetoothd[479]: src/adapter.c:load_irks() hci0 irks 0
bluetoothd[479]: src/adapter.c:load_conn_params() hci0 conn params 0
bluetoothd[479]: src/adapter.c:load_connections() sending get connections command for index 0
bluetoothd[479]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[479]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[479]: src/adapter.c:set_did() hci0 source 2 vendor 1d6b product 246 version 541
bluetoothd[479]: src/adapter.c:adapter_register() Adapter /org/bluez/hci0 registered
bluetoothd[479]: src/adapter.c:set_dev_class() sending set device class command for index 0
bluetoothd[479]: src/adapter.c:set_name() sending set local name command for index 0
bluetoothd[479]: src/adapter.c:adapter_start() adapter /org/bluez/hci0 has been enabled
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0011
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0011 complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0034
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0034 complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x000b
[  918.880428] Bluetooth: hu 8958aa1c retransmitting 1 pkts
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x000b complete: 0x00
bluetoothd[479]: src/adapter.c:new_settings_callback() Settings: 0x000000c1
bluetoothd[479]: src/adapter.c:settings_changed() Changed settings: 0x00000040
bluetoothd[479]: src/adapter.c:settings_changed() Pending settings: 0x00000000
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x000d
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x000d complete: 0x00
bluetoothd[479]: src/adapter.c:new_settings_callback() Settings: 0x000002c1
bluetoothd[479]: src/adapter.c:settings_changed() Changed settings: 0x00000200
bluetoothd[479]: src/adapter.c:settings_changed() Pending settings: 0x00000000
bluetoothd[479]: src/adapter.c:trigger_passive_scanning()
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x002d
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x002d complete: 0x00
bluetoothd[479]: src/adapter.c:new_settings_callback() Settings: 0x00000ac1
bluetoothd[479]: src/adapter.c:settings_changed() Changed settings: 0x00000800
bluetoothd[479]: src/adapter.c:settings_changed() Pending settings: 0x00000000
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x002f
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x2f status: 0x0b
bluetoothd[479]: Failed to set privacy: Rejected (0x0b)
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0010
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0010 complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0010
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0010 complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0010
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0010 complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x003d
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x003d complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0027
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0027 complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0012
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0012 complete: 0x00
bluetoothd[479]: src/adapter.c:load_link_keys_complete() link keys loaded for hci0
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0013
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0013 complete: 0x00
bluetoothd[479]: src/adapter.c:load_ltks_complete() LTKs loaded for hci0
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0030
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0030 complete: 0x00
bluetoothd[479]: src/adapter.c:load_irks_complete() IRKs loaded for hci0
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0035
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0035 complete: 0x00
bluetoothd[479]: src/adapter.c:load_conn_params_complete() Connection Parameters loaded for hci0
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0015
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0015 complete: 0x00
bluetoothd[479]: src/adapter.c:get_connections_complete() Connection count: 0
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0010
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0010 complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0028
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0028 complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x000e
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x000e complete: 0x00
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x000f
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x000f complete: 0x00
bluetoothd[479]: src/adapter.c:local_name_changed_callback() Name: BlueZ 5.65
bluetoothd[479]: src/adapter.c:local_name_changed_callback() Short name:
bluetoothd[479]: src/adapter.c:local_name_changed_callback() Current alias: BlueZ 5.65
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0046
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0046 complete: 0x00
bluetoothd[479]: src/adapter.c:set_blocked_keys_complete() Successfully set blocked keys for index 0

运行bluetoothctl 进入交互模式

# bluetoothctl
[bluetooth]# bluetoothd[479]: src/agent.c:add_default_agent() Default agent set to :1.2 /org/bluez/agent
bluetoothd[479]: src/adapter.c:set_mode() sending set mode command for index 0
bluetoothd[479]: src/agent.c:agent_ref() 0x5236c8: ref=1
bluetoothd[479]: src/agent.c:register_agent() agent :1.2
Agent registered
[bluetooth]# bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0009
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0009 complete: 0x00
bluetoothd[479]: src/adapter.c:new_settings_callback() Settings: 0x00000ad1
bluetoothd[479]: src/adapter.c:settings_changed() Changed settings: 0x00000010
bluetoothd[479]: src/adapter.c:settings_changed() Pending settings: 0x00000000
bluetoothd[479]: src/shared/mgmt.c:send_request() [0x0000] command 0x0018
bluetoothd[479]: src/shared/mgmt.c:can_read_data() [0x0000] command 0x0018 complete: 0x00
[CHG] Controller 84:20:96:B1:4D:92 Pairable: yes
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# scan on
[bluetooth]#

这样看起来,进入蓝牙命令交互之后,是不正常的。

运行:power on相当于打开蓝牙
运行:agent on
查找设备:scan on或者devices查找可配对设备
配对:pair MACaddress(刚刚查找的配对设备的mac地址) 这一步需要在手机确认
连接:connect MACaddress(刚刚查找的配对设备的mac地址)
信任设备:trust MACaddress(刚刚查找的配对设备的mac地址)

  • bluetoothctl命令解析:Bluetoothctl全解析

使用hcitool来操作

上一节中在bluetoothctl没法操作。找到hcitool来操作:

命令:

# hcitool -help
hcitool - HCI Tool ver 5.65
Usage:hcitool [options] <command> [command parameters]
Options:--help  Display help-i dev  HCI device
Commands:dev     Display local devicesinq     Inquire remote devicesscan    Scan for remote devicesname    Get name from remote deviceinfo    Get information from remote devicespinq   Start periodic inquiryepinq   Exit periodic inquirycmd     Submit arbitrary HCI commandscon     Display active connectionscc      Create connection to remote devicedc      Disconnect from remote devicesr      Switch central/peripheral rolecpt     Change connection packet typerssi    Display connection RSSIlq      Display link qualitytpl     Display transmit power levelafh     Display AFH channel maplp      Set/display link policy settingslst     Set/display link supervision timeoutauth    Request authenticationenc     Set connection encryptionkey     Change connection link keyclkoff  Read clock offsetclock   Read local or remote clocklescan  Start LE scanleinfo  Get LE remote informationlealadd Add device to LE Accept Listlealrm  Remove device from LE Accept Listlealsz  Read size of LE Accept Listlealclr Clear LE Accept Listlewladd Deprecated. Use lealadd instead.lewlrm  Deprecated. Use lealrm instead.lewlsz  Deprecated. Use lealsz instead.lewlclr Deprecated. Use lealclr instead.lerladd Add device to LE Resolving Listlerlrm  Remove device from LE Resolving Listlerlclr Clear LE Resolving Listlerlsz  Read size of LE Resolving Listlerlon  Enable LE Address Resolutionlerloff Disable LE Address Resolutionlecc    Create a LE Connectionledc    Disconnect a LE Connectionlecup   LE Connection UpdateFor more information on the usage of each command use:hcitool <command> --help
dev    显示本地设备inq    查询远程设备scan  扫描远程设备name  从远程设备获取名称info    从远程设备获取信息spinq    开始定期查询epinq   退出定期查询cmd      提交任意HCI命令con    显示活动连接cc       创建到远程设备的连接dc      断开与远程设备的连接sr       切换 主/从 角色cpt     更改连接数据包类型rssi   显示连接RSSIlq     显示链接质量tpl    显示发射功率水平afh   显示AFH通道图lp    设置/显示链接策略设置lst    设置/显示链接时间超时auth  请求身份验证enc    设置连接加密key    更改连接链接密钥clkoff  读时钟偏移clock   读取本地或远程时钟lescan      开始LE扫描lewladd    将设备添加到LE白名单lewlrm   从LE白名单中删除设备lewlsz    阅读LE的尺寸白色清单lewlclr  清除LE白名单lecc    创建一个LE连接ledc   断开LE连接lecup  LE连接更新

BLE扫描:

# hcitool lescan
LE Scan ...
65:CB:01:01:36:A9 (unknown)
73:EA:18:45:5B:94 (unknown)
52:A3:99:59:87:56 (unknown)
45:62:42:A1:1E:B4 (unknown)
2D:98:31:2F:12:6C (unknown)
3F:5B:7D:70:B0:4B (unknown)
63:BC:FD:06:D9:D1 (unknown)
55:28:0A:62:B6:88 (unknown)
56:03:BC:EC:4F:23 (unknown)
54:FA:90:91:81:AC (unknown)
1A:58:FD:49:AD:7A (unknown)
D5:19:20:99:CE:D0 (unknown)
4A:96:02:E4:D4:83 (unknown)
6D:CB:2F:84:52:12 (unknown)

BT扫描:

# hcitool scan
Scanning ...
[  850.534585] rtk_btcoex: hci (periodic)inq start
[  860.777952] rtk_btcoex: inquiry completeA4:55:90:0F:90:E6       Redmi K40 Pro+

扫描出我的手机蓝牙。
本地设备信息:

# hcitool device
Devices:hci0    84:20:96:B1:4D:92

直到这里,我才知道我其实用手机已经扫出了这个蓝牙!因为不知道为啥设备名没有显示出来!在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/119874.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Hafnium安全分区管理器和示例参考软件栈

安全之安全(security)博客目录导读 目录 一、安全分区管理器 1、术语 2、对旧平台的支持 二、示例参考软件栈 一、安全分区管理器 安全分区管理器的三种实现在TF-A代码库并存&#xff1a; 1.基于FF-A规范的S-EL2 SPMC&#xff08;SPM Core&#xff09;&#xff0c;使能安全…

搜维尔科技:Geomagic Touch X力反馈设备【开箱图真机测试】

将力反馈性能提升到一个新的水平&#xff0c;可提供更精确的定位输入和高保真力反馈输出。对于3D建模和设计、手术培训、虚拟装配等要求精确度较高的多种操作&#xff0c;TouchX是一个易于使用、经济实惠的选择。 Touch X 的功能 屡获殊荣的 Touch X 力反馈设备提供了经济实惠…

【OpenCV实现平滑图像处理】

文章目录 概要2D 卷积&#xff08;图像过滤&#xff09;模糊图像&#xff08;平滑图像&#xff09;中值模糊双边过滤小结 概要 在图像处理中&#xff0c;低通滤波器是一种常用的技术&#xff0c;用于平滑、模糊或降低图像的噪音。这种滤波器通过去除图像中高频部分&#xff08…

Unity之ShaderGraph如何实现冰冻效果

前言 今天我们来实现一个冰冻的效果,非常的炫酷哦。 如下图所示: 主要节点 Voronoi:根据输入UV生成 Voronoi 或Worley噪声。Voronoi 噪声是通过计算像素和点阵之间的距离生成的。通过由输入角度偏移控制的伪随机数偏移这些点,可以生成细胞簇。这些单元的规模以及产生的…

垃圾回收系统小程序

在当今社会&#xff0c;废品回收不仅有利于环境保护&#xff0c;也有利于资源的再利用。随着互联网技术的发展&#xff0c;个人废品回收也可以通过小程序来实现。本文将介绍如何使用乔拓云网制作个人废品回收小程序。 1. 找一个合适的第三方制作平台/工具&#xff0c;比如乔拓云…

非侵入式负荷检测与分解:电力数据挖掘新视角

电力数据挖掘 概述案例背景分析目标分析过程数据准备数据探索缺失值处理 属性构造设备数据周波数据模型训练 性能度量推荐阅读 主页传送门&#xff1a;&#x1f4c0; 传送 概述 摘要&#xff1a;本案例将根据已收集到的电力数据&#xff0c;深度挖掘各电力设备的电流、电压和功…

非小米笔记本小米妙享中心安装最新教程 3.2.0.464 兼容所有Windows系统

小米妙享中心 3.2.0.464 版本帮助 : 支持音频流转、屏幕镜像、屏幕拓展、键鼠拓展、无线耳机、小米互传 目录 小米妙享中心 3.2.0.464 版本帮助 : 1.常规教程使用安装包方式安装失败 或者 1.1安装失败可使用大佬的加载补丁方法解决 补充卸载残留 1.2 截图存档 2. 本教程…

App在哪里可以免费内测分发?

当ios开发者开发完成ios App后&#xff0c;往往要进入内测或公测阶段&#xff0c;需要进行分发&#xff0c;测试用户才能下载应用。 App分发平台是许多app开发类企业经常使用的平台&#xff0c;将主要开发的app上传到app分发平台上进行内测下载。很多开发者服务平台其实是提供…

PHP与mysql数据库交互

PHP与mysql数据库交互 文章目录 PHP与mysql数据库交互方法速查建立与Mysql链接捕获连接错误SQL语句的执行SQL 错误SQL语句执行结果集对象方法速查 案例 方法速查 函数名 作用 mysqli_connect() 与MySQL 数据库建立连接。 mysqli_close() 关闭与MYSQL 数据库建…

nodejs+vue 电子书阅读系统

本文首先介绍了电子书阅读系统的发展背景与发展现状&#xff0c;然后遵循软件常规开发流程&#xff0c;首先针对系统选取适用的语言和开发平台&#xff0c;随着网络技术的不断发展&#xff0c;多媒体技术应用渐渐的出现在教育领域中&#xff0c;电子书阅读已经成为社会的一个热…

【AICFD案例操作】汽车外气动分析

AICFD是由天洑软件自主研发的通用智能热流体仿真软件&#xff0c;用于高效解决能源动力、船舶海洋、电子设备和车辆运载等领域复杂的流动和传热问题。软件涵盖了从建模、仿真到结果处理完整仿真分析流程&#xff0c;帮助工业企业建立设计、仿真和优化相结合的一体化流程&#x…

Ubuntu ARMv8编译Qt源码以及QtCreator

最近需要在NVIDIA小盒子上面跑一个程序&#xff0c;一开始想着在Ubuntu x64下交叉编译一版&#xff0c;后来发现libqxcb.so 这个库在configure时就会一直报错&#xff0c;多方查找怀疑可能是由于硬件不支持在x64环境下编译AMR架构的xcb库。 所以最后在ARM下直接编译Qt源码了&am…

华为数通方向HCIP-DataCom H12-831题库(多选题:81-100)

第81题 经典的网络转发方式是基于路由表转发。OpenFlow交换机的转发方式是基于流表转发。对于这两种转发方式,以下说法正确的有哪些选项? A、流表的匹配方式是同时匹配流量的MAC地址和IP地址。 B、路由表的匹配方式是匹配拥有最长掩码的目的网段路由 C、流表是变长的。一台网…

测试C#调用Vlc.DotNet组件播放视频

除了Windows Media Player组件&#xff0c;在百度上搜索到还有不少文章介绍采用Vlc.DotNet组件播放视频&#xff0c;关于Vlc.DotNet的详细介绍见参考文献1&#xff0c;本文学习Vlc.DotNet的基本用法。   VS2022中新建基于.net core的winform程序&#xff0c;在Nuget包管理器中…

疫情物资管理系统-基于SSM实现

包括-源码参考文档 下载地址: https://juzhendongli.store/commodity/details/5

PDF编辑工具Acrobat Pro DC 2023中文

Acrobat Pro DC 2023是一款全面、高效的PDF编辑和管理软件。它提供了丰富的PDF编辑功能&#xff0c;如创建、编辑、合并、分割、压缩、旋转、裁剪等&#xff0c;让用户可以轻松处理各种PDF文档。同时&#xff0c;该软件还具有智能的PDF处理技术&#xff0c;可以自动识别和修复P…

iPhone手机屏幕分辨率

ios app测试时&#xff0c;需要测试应用在不同型号的苹果手机上的表现形式&#xff0c;可以自己在浏览器上配置。 代数设备逻辑像素尺寸缩放发布时间第一代iPhone 2G320 x 480480 x 3203.5寸1x2007年6月29日第二代iPhone 3320 x 480480 x 3203.5寸1x2008年7月11日第三代iPhone …

微前端qiankun接入Vue和React项目

主应用&#xff1a;Vue3Webpack 1、创建主应用&#xff1a; npx vue create main-vue3-app 2、安装qiankun npx yarn add qiankun 3、项目中使用的vue、vue-router、qiankun依赖如下&#xff0c;webpack版本为5.x 4、在根目录下创建vue.config.js const { defineConfig }…

【第25例】IPD体系进阶:需求分析团队RAT

目录 简介 RAT CSDN学院相关内容推荐 作者简介 简介 RAT是英文Requirement Analysis Team英文首字母的简称,也即需求分析团队,每个产品线都需要设定对应的一个RAT的组织。 RAT主要负责产品领域内需求的分析活动,是RMT的支撑团队: 这个时候可以将RAT细化为PL-RAT团队,…

云原生架构设计理论与实践

云原生架构设计理论与实践 云原生架构概述 云原生的背景 云原生定义和特征 云原生架构的设计原则 架构模式 服务化架构模式 Mesh化架构模式 Serverless模式 存储计算分离模式 分布式事务模式 可观测架构 事件驱动架构 云原生架构相关技术 容器技术 云原生微服务技术 无服务…