【RV1106/RV1103】RV1103增加RTL8723BS

news2024/11/18 9:30:17

文章目录

  • 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.5

Realtek Bluetooth :3-wire sync pattern resend : 1, len: 8

Realtek Bluetooth :Get SYNC Resp Pkt

Realtek Bluetooth :Get SYNC pkt-active mode

Realtek Bluetooth :3-wire config pattern resend : 1 , len: 10
Realtek Bluetooth :Get CONFG pkt-active mode

Realtek Bluetooth :Get CONFG resp pkt-active mode

Realtek Bluetooth :H5 init finished

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:4928002
Realtek Bluetooth :Load FW OK
Realtek Bluetooth :RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_Command

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :receive hci command complete event with command:1001

Realtek Bluetooth :Read RTK LMP version with Status:0
Realtek Bluetooth :gLmpVersion = 0x8723
Realtek Bluetooth :RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_Command

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :receive hci command complete event with command:fc6d

Realtek 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 99

Realtek Bluetooth :Send FW last command
Realtek Bluetooth :hci_download_patch tx_index:100 rx_index: 99

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 100

Realtek 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.5

al@ff4f0000' misRealtek Bluetooth :3-wire sync pattern resend : 1, len: 8

Realtek Bluetooth :Get SYNC Resp Pkt

Realtek Bluetooth :Get SYNC pkt-active mode

Realtek Bluetooth :3-wire config pattern resend : 1 , len: 10
Realtek Bluetooth :Get CONFG pkt-active mode

Realtek Bluetooth :Get CONFG resp pkt-active mode

sing Realtek Bluetooth :H5 init finished

or 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:4928002
 46.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_Command

Realtek Bluetooth :Received reliaible seqno 0 from card
Realtek Bluetooth :receive hci command complete event with command:1001

Realtek Bluetooth :Read RTK LMP version with Status:0
nterrupt mode
Realtek Bluetooth :gLmpVersion = 0x8723
Realtek Bluetooth :RTK send HCI_VENDOR_READ_RTK_ROM_VERISION_Command

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :receive hci command complete event with command:fc6d

Realtek 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 2 from card
Realtek Bluetooth :receive hci command complete event with command:fc17

Realtek Bluetooth :Change BD Rate with status:0
Realtek Bluetooth :final_speed 1500000

Realtek Bluetooth :hw flow control enable
Realtek Bluetooth :iEndIndex:96  iLastPacketLen:71 iAdditionpkt:4

Realtek Bluetooth :hci_download_patch tx_index:0 rx_index: -1

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 0

Realtek Bluetooth :hci_download_patch tx_index:1 rx_index: 0

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 1

Realtek Bluetooth :hci_download_patch tx_index:2 rx_index: 1

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 2

Realtek Bluetooth :hci_download_patch tx_index:3 rx_index: 2

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 3

Realtek Bluetooth :hci_download_patch tx_index:4 rx_index: 3

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 4

Realtek Bluetooth :hci_download_patch tx_index:5 rx_index: 4

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 5

Realtek Bluetooth :hci_download_patch tx_index:6 rx_index: 5

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 6

Realtek Bluetooth :hci_download_patch tx_index:7 rx_index: 6

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 7

Realtek Bluetooth :hci_download_patch tx_index:8 rx_index: 7

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 8

Realtek Bluetooth :hci_download_patch tx_index:9 rx_index: 8

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 9

Realtek Bluetooth :hci_download_patch tx_index:10 rx_index: 9

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 10

Realtek Bluetooth :hci_download_patch tx_index:11 rx_index: 10

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 11

Realtek Bluetooth :hci_download_patch tx_index:12 rx_index: 11

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 12

Realtek Bluetooth :hci_download_patch tx_index:13 rx_index: 12

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 13

Realtek Bluetooth :hci_download_patch tx_index:14 rx_index: 13

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 14

Realtek Bluetooth :hci_download_patch tx_index:15 rx_index: 14

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 15

Realtek Bluetooth :hci_download_patch tx_index:16 rx_index: 15

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 16

Realtek Bluetooth :hci_download_patch tx_index:17 rx_index: 16

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 17

Realtek Bluetooth :hci_download_patch tx_index:18 rx_index: 17

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 18

Realtek Bluetooth :hci_download_patch tx_index:19 rx_index: 18

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 19

Realtek Bluetooth :hci_download_patch tx_index:20 rx_index: 19

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 20

Realtek Bluetooth :hci_download_patch tx_index:21 rx_index: 20

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 21

Realtek Bluetooth :hci_download_patch tx_index:22 rx_index: 21

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 22

Realtek Bluetooth :hci_download_patch tx_index:23 rx_index: 22

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 23

Realtek Bluetooth :hci_download_patch tx_index:24 rx_index: 23

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 24

Realtek Bluetooth :hci_download_patch tx_index:25 rx_index: 24

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 25

Realtek Bluetooth :hci_download_patch tx_index:26 rx_index: 25

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 26

Realtek Bluetooth :hci_download_patch tx_index:27 rx_index: 26

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 27

Realtek Bluetooth :hci_download_patch tx_index:28 rx_index: 27

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 28

Realtek Bluetooth :hci_download_patch tx_index:29 rx_index: 28

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 29

Realtek Bluetooth :hci_download_patch tx_index:30 rx_index: 29

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 30

Realtek Bluetooth :hci_download_patch tx_index:31 rx_index: 30

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 31

Realtek Bluetooth :hci_download_patch tx_index:32 rx_index: 31

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 32

Realtek Bluetooth :hci_download_patch tx_index:33 rx_index: 32

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 33

Realtek Bluetooth :hci_download_patch tx_index:34 rx_index: 33

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 34

Realtek Bluetooth :hci_download_patch tx_index:35 rx_index: 34

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 35

Realtek Bluetooth :hci_download_patch tx_index:36 rx_index: 35

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 36

Realtek Bluetooth :hci_download_patch tx_index:37 rx_index: 36

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 37

Realtek Bluetooth :hci_download_patch tx_index:38 rx_index: 37

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 38

Realtek Bluetooth :hci_download_patch tx_index:39 rx_index: 38

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 39

Realtek Bluetooth :hci_download_patch tx_index:40 rx_index: 39

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 40

Realtek Bluetooth :hci_download_patch tx_index:41 rx_index: 40

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 41

Realtek Bluetooth :hci_download_patch tx_index:42 rx_index: 41

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 42

Realtek Bluetooth :hci_download_patch tx_index:43 rx_index: 42

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 43

Realtek Bluetooth :hci_download_patch tx_index:44 rx_index: 43

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 44

Realtek Bluetooth :hci_download_patch tx_index:45 rx_index: 44

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 45

Realtek Bluetooth :hci_download_patch tx_index:46 rx_index: 45

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 46

Realtek Bluetooth :hci_download_patch tx_index:47 rx_index: 46

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 47

Realtek Bluetooth :hci_download_patch tx_index:48 rx_index: 47

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 48

Realtek Bluetooth :hci_download_patch tx_index:49 rx_index: 48

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 49

Realtek Bluetooth :hci_download_patch tx_index:50 rx_index: 49

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 50

Realtek Bluetooth :hci_download_patch tx_index:51 rx_index: 50

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 51

Realtek Bluetooth :hci_download_patch tx_index:52 rx_index: 51

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 52

Realtek Bluetooth :hci_download_patch tx_index:53 rx_index: 52

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 53

Realtek Bluetooth :hci_download_patch tx_index:54 rx_index: 53

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 54

Realtek Bluetooth :hci_download_patch tx_index:55 rx_index: 54

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 55

Realtek Bluetooth :hci_download_patch tx_index:56 rx_index: 55

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 56

Realtek Bluetooth :hci_download_patch tx_index:57 rx_index: 56

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 57

Realtek Bluetooth :hci_download_patch tx_index:58 rx_index: 57

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 58

Realtek Bluetooth :hci_download_patch tx_index:59 rx_index: 58

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 59

Realtek Bluetooth :hci_download_patch tx_index:60 rx_index: 59

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 60

Realtek Bluetooth :hci_download_patch tx_index:61 rx_index: 60

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 61

Realtek Bluetooth :hci_download_patch tx_index:62 rx_index: 61

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 62

Realtek Bluetooth :hci_download_patch tx_index:63 rx_index: 62

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 63

Realtek Bluetooth :hci_download_patch tx_index:64 rx_index: 63

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 64

Realtek Bluetooth :hci_download_patch tx_index:65 rx_index: 64

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 65

Realtek Bluetooth :hci_download_patch tx_index:66 rx_index: 65

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 66

Realtek Bluetooth :hci_download_patch tx_index:67 rx_index: 66

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 67

Realtek Bluetooth :hci_download_patch tx_index:68 rx_index: 67

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 68

Realtek Bluetooth :hci_download_patch tx_index:69 rx_index: 68

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 69

Realtek Bluetooth :hci_download_patch tx_index:70 rx_index: 69

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 70

Realtek Bluetooth :hci_download_patch tx_index:71 rx_index: 70

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 71

Realtek Bluetooth :hci_download_patch tx_index:72 rx_index: 71

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 72

Realtek Bluetooth :hci_download_patch tx_index:73 rx_index: 72

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 73

Realtek Bluetooth :hci_download_patch tx_index:74 rx_index: 73

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 74

Realtek Bluetooth :hci_download_patch tx_index:75 rx_index: 74

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 75

Realtek Bluetooth :hci_download_patch tx_index:76 rx_index: 75

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 76

Realtek Bluetooth :hci_download_patch tx_index:77 rx_index: 76

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 77

Realtek Bluetooth :hci_download_patch tx_index:78 rx_index: 77

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 78

Realtek Bluetooth :hci_download_patch tx_index:79 rx_index: 78

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 79

Realtek Bluetooth :hci_download_patch tx_index:80 rx_index: 79

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 80

Realtek Bluetooth :hci_download_patch tx_index:81 rx_index: 80

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 81

Realtek Bluetooth :hci_download_patch tx_index:82 rx_index: 81

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 82

Realtek Bluetooth :hci_download_patch tx_index:83 rx_index: 82

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 83

Realtek Bluetooth :hci_download_patch tx_index:84 rx_index: 83

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 84

Realtek Bluetooth :hci_download_patch tx_index:85 rx_index: 84

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 85

Realtek Bluetooth :hci_download_patch tx_index:86 rx_index: 85

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 86

Realtek Bluetooth :hci_download_patch tx_index:87 rx_index: 86

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 87

Realtek Bluetooth :hci_download_patch tx_index:88 rx_index: 87

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 88

Realtek Bluetooth :hci_download_patch tx_index:89 rx_index: 88

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 89

Realtek Bluetooth :hci_download_patch tx_index:90 rx_index: 89

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 90

Realtek Bluetooth :hci_download_patch tx_index:91 rx_index: 90

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 91

Realtek Bluetooth :hci_download_patch tx_index:92 rx_index: 91

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 92

Realtek Bluetooth :hci_download_patch tx_index:93 rx_index: 92

Realtek Bluetooth :Received reliable seqno 0 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 93

Realtek Bluetooth :hci_download_patch tx_index:94 rx_index: 93

Realtek Bluetooth :Received reliable seqno 1 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 94

Realtek Bluetooth :hci_download_patch tx_index:95 rx_index: 94

Realtek Bluetooth :Received reliable seqno 2 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 95

Realtek Bluetooth :hci_download_patch tx_index:96 rx_index: 95

Realtek Bluetooth :Received reliable seqno 3 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 96

Realtek Bluetooth :hci_download_patch tx_index:97 rx_index: 96

Realtek Bluetooth :Received reliable seqno 4 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 97

Realtek Bluetooth :hci_download_patch tx_index:98 rx_index: 97

Realtek Bluetooth :Received reliable seqno 5 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 98

Realtek Bluetooth :hci_download_patch tx_index:99 rx_index: 98

Realtek Bluetooth :Received reliable seqno 6 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 99

Realtek Bluetooth :Send FW last command
Realtek Bluetooth :hci_download_patch tx_index:100 rx_index: 99

Realtek Bluetooth :Received reliable seqno 7 from card
Realtek Bluetooth :rtk_hw_cfg.rx_index 100

Realtek 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: UART
        BD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16
        DOWN
        RX bytes:1057 acl:0 sco:0 events:30 errors:0
        TX bytes:827 acl:0 sco:0 commands:30 errors:0

打开hci0使用命令:hciconfig hci0 up

# hciconfig -a
hci0:   Type: Primary  Bus: UART
        BD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16
        DOWN
        RX bytes:1057 acl:0 sco:0 events:30 errors:0
        TX bytes:827 acl:0 sco:0 commands:30 errors:0
        Features: 0xff 0xff 0xff 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF PARK
        Link 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: UART
        BD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16
        DOWN
        RX bytes:1057 acl:0 sco:0 events:30 errors:0
        TX 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: UART
        BD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16
        UP RUNNING
        RX bytes:2113 acl:0 sco:0 events:60 errors:0
        TX bytes:1518 acl:0 sco:0 commands:61 errors:0

# hciconfig -a
hci0:   Type: Primary  Bus: UART
        BD Address: 84:20:96:B1:4D:92  ACL MTU: 1021:8  SCO MTU: 255:16
        UP RUNNING
        RX bytes:2113 acl:0 sco:0 events:60 errors:0
        TX bytes:1518 acl:0 sco:0 commands:61 errors:0
        Features: 0xff 0xff 0xff 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF PARK
        Link mode: PERIPHERAL ACCEPT
[  134.027303] Bluetooth: hu 8e040b96 retransmitting 1 pkts
        Name: 'RTK_BT_4.0'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous,
        HCI Version: 4.0 (0x6)  Revision: 0x1e3e
        LMP Version: 4.0 (0x6)  Subversion: 0xe40e
        Manufacturer: 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 devices
        inq     Inquire remote devices
        scan    Scan for remote devices
        name    Get name from remote device
        info    Get information from remote device
        spinq   Start periodic inquiry
        epinq   Exit periodic inquiry
        cmd     Submit arbitrary HCI commands
        con     Display active connections
        cc      Create connection to remote device
        dc      Disconnect from remote device
        sr      Switch central/peripheral role
        cpt     Change connection packet type
        rssi    Display connection RSSI
        lq      Display link quality
        tpl     Display transmit power level
        afh     Display AFH channel map
        lp      Set/display link policy settings
        lst     Set/display link supervision timeout
        auth    Request authentication
        enc     Set connection encryption
        key     Change connection link key
        clkoff  Read clock offset
        clock   Read local or remote clock
        lescan  Start LE scan
        leinfo  Get LE remote information
        lealadd Add device to LE Accept List
        lealrm  Remove device from LE Accept List
        lealsz  Read size of LE Accept List
        lealclr Clear LE Accept List
        lewladd 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 List
        lerlrm  Remove device from LE Resolving List
        lerlclr Clear LE Resolving List
        lerlsz  Read size of LE Resolving List
        lerlon  Enable LE Address Resolution
        lerloff Disable LE Address Resolution
        lecc    Create a LE Connection
        ledc    Disconnect a LE Connection
        lecup   LE Connection Update

For 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   显示连接RSSI

lq     显示链接质量

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 complete
        A4:55:90:0F:90:E6       Redmi K40 Pro+

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

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

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

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

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

相关文章

pip 更换源

方案1 在C盘用户名录下新建pip文件夹&#xff0c;里面包含pip.ini文件 方案2 在C盘用户名目录的AppData的Roaming下新建pip文件夹&#xff0c;里面包含pip.ini文件。 内容为 [global] index-url https://pypi.tuna.tsinghua.edu.cn/simple

题目 1056: 二级C语言-温度转换(python详解)——练气四层初期

✨博主&#xff1a;命运之光 &#x1f984;专栏&#xff1a;算法修炼之练气篇&#xff08;C\C版&#xff09; &#x1f353;专栏&#xff1a;算法修炼之筑基篇&#xff08;C\C版&#xff09; &#x1f352;专栏&#xff1a;算法修炼之练气篇&#xff08;Python版&#xff09; ✨…

CVE-2022-22965 Spring Framework远程命令执行

0x01 影响版本 Spring Framework < 5.3.18 Spring Framework < 5.2.20 JDK>9 0x02 复现环境 vulhub/spring/cve-2022-22965 0x03 漏洞复现 首先docker-compose up -d开启靶场 输入payload <%if("j".equals(request.getParameter("pwd")…

Transformer在计算机视觉领域的研究综述

论文地址&#xff1a;https://kns.cnki.net/kcms/detail/11.2127.TP.20221009.1217.003.html 目录 摘 要 1. Transformer 基本结构 1.1 位置编码 (1) 绝对位置编码 (2) 相对位置编码 1.2 自注意力机制 (1) 多头注意力 (2) 局部注意力 (3) 稀疏注意力机制 1.3 前馈神…

通信仿真软件SystemView安装教程(超详细)

介绍 system view是一种电子仿真工具。它是一个信号级的系统仿真软件&#xff0c;主要用于电路与通信系统的设计和仿真&#xff0c;是一个强有力的动态系统分析工具&#xff0c;能满足从数字信号处理&#xff0c;滤波器设计&#xff0c;直到复杂的通信系统等不同层次的设计&am…

SQL注入类型(详细讲解)

SQL注入方法(函数原理讲解) 前言 在进行SQL注入测试的时候&#xff0c;确实很重要要知道目标SQL语句是什么类型&#xff0c;因为不同类型的SQL语句对注入的有效载荷&#xff08;payload&#xff09;有不同的语法要求。下面列举了几个原因&#xff1a; 1. 语法闭合 你提到了…

“可编程网络”的基础概念介绍

什么是可编程网络&#xff1f; 可编程网络是指网络设备的行为和流量控制由独立于网络硬件运行的软件处理的网络。可编程网络的基本性质是将底层物理硬件与设备的控制软件分开。 网络可编程的历史 当可编程网络的概念首次出现时&#xff0c;它是计算机网络发展史上革命性的一…

Specializing Smaller Language Models towards Multi-Step Reasoning论文精读

0 Abstract 普遍认为&#xff0c;LLM涌现出来的few-shot learning能力是超大参数模型独有的&#xff08;>100B&#xff09;【emergent abilities】&#xff1b;作者认为&#xff0c;小模型&#xff08;<10B&#xff09;可以将这些能力从大模型&#xff08;>100B&…

【HTML/CSS学习】margin和padding的区别

1. margin margin&#xff08;外边距&#xff09;属性定义元素周围的空间。 margin主要在元素的外部创建空白区域&#xff0c;用于分隔元素与其相邻元素之间的距离。 用处&#xff1a;可以用于调整两个元素之间的间隔。 2. padding padding&#xff08;填充&#xff09;定义…

dcrcms 文件上传漏洞

dcrcms 文件上传漏洞 启动环境 启动靶场得到ip和映射端口 测试漏洞 输入http://10.9.47.6:14153/dcr进入后台 账号密码为admin:123456 寻找文件上传漏洞 看到添加新闻里有文件上传我们尝试进行上传 写一个php文件里面放入一句话木马 <?php eval($_REQUEST[666]); ?…

C++前缀和算法的应用:用地毯覆盖后的最少白色砖块 原理源码测试用例

本文涉及的基础知识点 C算法&#xff1a;前缀和、前缀乘积、前缀异或的原理、源码及测试用例 包括课程视频 题目 给你一个下标从 0 开始的 二进制 字符串 floor &#xff0c;它表示地板上砖块的颜色。 floor[i] ‘0’ 表示地板上第 i 块砖块的颜色是 黑色 。 floor[i] ‘1…

警务可视化 玫瑰图和柱折混合图

什么时候用&#xff0c;什么时候导入echarts 完整代码&#xff1a; 搭建页面结构的代码 html <template><h2>智慧公安数字服务系统</h2><div><div class"container1"> </div> <div class"container2"></di…

【golang】Windows环境下Gin框架安装和配置

Windows环境下Gin框架安装和配置 我终于搞定了Gin框架的安装&#xff0c;花了两三个小时&#xff0c;只能说道阻且长&#xff0c;所以写下这篇记录文章 先需要修改一些变量&#xff0c;这就需要打开终端&#xff0c;为了一次奏效&#xff0c;我们直接设置全局的&#xff1a; …

vue3后台管理系统

项目创建及代码规范化开发 vue脚手架创建项目 安装vue脚手架 npm install-g vue/cli npm update -g vue/cli终端输入vue create 项目名称 即可进入模板选择 //利用vue-cli创建项目 进入模板选择 Vue CLI v5.0.8 ? Please pick a preset:Default ([Vue 3] babel, eslint)De…

LabVIEW开发基于图像处理的车牌检测系统

LabVIEW开发基于图像处理的车牌检测系统 自动车牌识别的一般步骤是图像采集、去除噪声的预处理、车牌定位、字符分割和字符识别。结果主要取决于所采集图像的质量。在不同照明条件下获得的图像具有不同的结果。在要使用的预处理技术中&#xff0c;必须将彩色图像转换为灰度&am…

【每日一题】切割后面积最大的蛋糕

文章目录 Tag题目来源题目解读解题思路方法一&#xff1a;排序 其他语言python3 写在最后 Tag 【排序】【数组】【2023-10-27】 题目来源 1465. 切割后面积最大的蛋糕 题目解读 切割后面积最大的蛋糕。 解题思路 方法一&#xff1a;排序 本题较为简单&#xff0c;找出最大…

Figma是什么软件?有哪些优势和劣势?

Figma作为目前最受欢迎的设计软件&#xff0c;在国外受到UI设计师的广泛好评。如果你还对Figma感到困惑&#xff0c;不知道它在做什么&#xff0c;那么今天将为您详细介绍Figma软件&#xff0c;以帮助您快速理解和更好地使用它。 Figma软件基本介绍 简单来说&#xff0c;Figm…

全网最全 Pandas的入门与高级教程全集,都在这里了!(PDF下载)

Pandas是Python中的重要数据分析工具&#xff0c;它提供了强大的数据结构和函数&#xff0c;用于数据清洗、探索、准备和分析。 Pandas 的DataFrame和Series使数据处理更加简单&#xff0c;可通过各种方法和工具处理大型数据集。 这个开源库支持从多种数据源加载数据&#xff0…

在线音乐网站-基于SSM实现+源码和技术实现文档

源码和文档下载地址: https://juzhendongli.store/commodity/details/6 百度云盘中存储有。

【求教】老菜鸟遇到新问题,双bug欢迎有緣人答疑

文章目录 一&#xff0c;序二&#xff0c;需求三&#xff0c;代码实现1. 代码结构2. 完整代码备份 四&#xff0c;bug1 详情1. 运行准备1. &#xff09;将 application.yml 文件active设置为test2.&#xff09;修改jdbc-mysql.properties 数据库参数设为实际值3.&#xff09;注…