BlueZ移植及应用开发参考


1. BlueZ移植

BlueZ的依赖库比较多,各个开源库的依赖关系如下:

graph LR
zlib[zlib]
libffi[libffi]
gettext[gettext]
glib[glib]
zlib -->glib
libffi -->glib
gettext -->glib
expat[expat]
dbus[dbus]
glib -->dbus
expat -->dbus
libical[libical]
ncurses[ncurses]
readline[readline]
ncurses -->readline
BlueZ[BlueZ]
glib -->BlueZ
dbus -->BlueZ
libical -->BlueZ
readline -->BlueZ

本次移植采用的各个程序版本为:

zlib-1.2.11
libffi-3.3
gettext-0.20.2
glib-2.52.3
expat-2.2.9
dbus-1.13.18
libical-1.0
ncurses-6.2
readline-8.0
bluez-5.54

部分程序(DBus)运行时的配置文件路径与编译时指定的安装路径有关联,最简单的方式是直接在虚拟机里用root账户编译并安装到/目录。在服务器上编译时无法也不能安装到根目录,因此我们编译时不指定安装路径,而是通过在环境变量中临时添加DESTDIR变量来指定安装路径(或者通过类似make DESTDIR=/home/tianhui.he/codes/bluez/out install这样的方式指定安装路径)。这样带来的一个问题是在编译源码时可能会出现找不到依赖库的情况,需要手动修改依赖库的“.la”及“.pc”文件。这里记录下移植过程以备后续参考。

本文使用的编译环境

tianhui.he@xmbc6401:~/codes/bluez/code/bluez-5.54$ uname -a
Linux xmbc6401 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
tianhui.he@xmbc6401:~/codes/bluez/code/bluez-5.54$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:    16.04
Codename:    xenial
tianhui.he@xmbc6401:~/codes/bluez/code/bluez-5.54$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/tools/gcc-arm-9.1-2019.11-x86_64-arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/9.1.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: '/home/meng/build_toolchain/linaro_linux_9_1_0/build/snapshots/gcc.git~gcc-9_1_0-release/configure' SHELL=/bin/bash --with-mpc=/home/meng/build_toolchain/linaro_linux_9_1_0/build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/meng/build_toolchain/linaro_linux_9_1_0/build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/meng/build_toolchain/linaro_linux_9_1_0/build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --with-system-zlib --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --with-float=hard --with-fpu=vfpv3-d16 --with-mode=thumb --with-tune=cortex-a9 --with-arch=armv7-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/meng/build_toolchain/linaro_linux_9_1_0/build/sysroots/arm-linux-gnueabihf --with-sysroot=/home/meng/build_toolchain/linaro_linux_9_1_0/build/builds/destdir/x86_64-unknown-linux-gnu/arm-linux-gnueabihf/libc --enable-checking=yes --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=arm-linux-gnueabihf --prefix=/home/meng/build_toolchain/linaro_linux_9_1_0/build/builds/destdir/x86_64-unknown-linux-gnu
Thread model: posix
gcc version 9.1.0 (GCC)

源码目录组织如下,在tarball文件夹中存放的是源压缩包,code为解压后的源码存放目录,out为目标文件输出目录

tianhui.he@xmbc6401:~/codes/bluez$ ls
code  out  tarball
# 将添加到当前shell的环境变量中!!!
export DESTDIR=/home/tianhui.he/codes/bluez/out

1.1. zlib-1.2.11

cd zlib-1.2.11
export CC=arm-linux-gnueabihf-gcc
export AR=arm-linux-gnueabihf-ar
export RANLIB=arm-linux-gnueabihf-ranlib
./configure
make -j32
make install

1.2. libffi-3.3

cd libffi-3.3
./configure --host=arm-linux --target=arm-linux CC=arm-linux-gnueabihf-gcc
make -j32
make install

1.3. gettext-0.20.2

cd gettext-0.20.2
./configure --host=arm-linux --target=arm-linux CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++
make -j32
make install

1.4. glib-2.52.3

cd glib-2.52.3
echo ac_cv_type_long_long=yes>arm-linux-gnueabihf.cache
echo glib_cv_stack_grows=no>>arm-linux-gnueabihf.cache
echo glib_cv_uscore=no>>arm-linux-gnueabihf.cache
echo ac_cv_func_posix_getpwuid_r=yes>>arm-linux-gnueabihf.cache
echo ac_cv_func_posix_getgrgid_r=yes>>arm-linux-gnueabihf.cache
./configure --host=arm-linux --target=arm-linux LIBFFI_CFLAGS='-I/home/tianhui.he/codes/bluez/out/usr/local/include' LIBFFI_LIBS='/home/tianhui.he/codes/bluez/out/usr/local/lib/libffi.so' ZLIB_CFLAGS='-I/home/tianhui.he/codes/bluez/out/usr/local/include' ZLIB_LIBS='/home/tianhui.he/codes/bluez/out/usr/local/lib/libz.so' CC="arm-linux-gnueabihf-gcc -I/home/tianhui.he/codes/bluez/out/usr/local/include -L/home/tianhui.he/codes/bluez/out/usr/local/lib -lz -lffi " enable_libmount=no --with-pcre=internal --cache-file=arm-linux-gnueabihf.cache

直接make会出错,需修改gio/gdbusauth.cgio/gdbusmessage.c下的两处printf %sNULL的错误

tianhui.he@xmbc6401:~/codes/bluez/code/glib-2.52.3/gio$ git diff gdbusauth.c
diff --git a/gdbusauth.c b/gdbusauth.c
index a4458b2..2b8c83c 100644
--- a/gdbusauth.c
+++ b/gdbusauth.c
@@ -1302,9 +1302,9 @@ _g_dbus_auth_run_server (GDBusAuth              *auth,
                                                     &line_length,
                                                     cancellable,
                                                     error);
-          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
           if (line == NULL)
             goto out;
+          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
           if (g_strcmp0 (line, "BEGIN") == 0)
             {
               /* YAY, done! */
tianhui.he@xmbc6401:~/codes/bluez/code/glib-2.52.3/gio$ git diff gdbusmessage.c
diff --git a/gdbusmessage.c b/gdbusmessage.c
old mode 100644
new mode 100755
index 94b75ff..37af66e
--- a/gdbusmessage.c
+++ b/gdbusmessage.c
@@ -2695,7 +2695,8 @@ g_dbus_message_to_blob (GDBusMessage          *message,
   if (message->body != NULL)
     {
       gchar *tupled_signature_str;
-      tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
+      if(signature_str)
+          tupled_signature_str = g_strdup_printf ("(%s)", signature_str);
       if (signature == NULL)
         {
           g_set_error (error,

重新编译安装

make -j32
make install

1.5. expat-2.2.9

cd expat-2.2.9
./configure --host=arm-linux --target=arm-linux CC=arm-linux-gnueabihf-gcc
make -j32
make install

1.6. dbus-1.13.18

cd dbus-1.13.18
echo ac_cv_have_abstract_sockets=yes>arm-linux-gnueabihf.cache
./configure --host=arm-linux --target=arm-linux CC="arm-linux-gnueabihf-gcc -lz -lffi -lgmodule-2.0 -lglib-2.0 -I/home/tianhui.he/codes/bluez/out/usr/local/include -I/home/tianhui.he/codes/bluez/out/usr/local/include/glib-2.0 -I/home/tianhui.he/codes/bluez/out/usr/local/lib/glib-2.0/include -L/home/tianhui.he/codes/bluez/out/usr/local/lib -L/home/tianhui.he/codes/bluez/out/usr/local/lib/glib-2.0" --cache-file=arm-linux-gnueabihf.cache --with-x=no

配置完成后需修改./out/usr/local/lib/目录下所有“.la”文件中指定的库文件及依赖库文件路径,主要涉及dependency_libslibdir这两个参数,例如libglib-2.0.la文件,将

# Libraries that this one depends upon.
dependency_libs=' -L/home/tianhui.he/codes/bluez/out/usr/local/lib -lz /usr/local/lib/libffi.la -lpthread'
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'

修改为

# Libraries that this one depends upon.
dependency_libs=' -L/home/tianhui.he/codes/bluez/out/usr/local/lib -lz /home/tianhui.he/codes/bluez/out/usr/local/lib/libffi.la -lpthread'
# Directory that this library needs to be installed in:
libdir='/home/tianhui.he/codes/bluez/out/usr/local/lib'

以及./out/usr/local/lib/pkgconfig目录下所有“.pc”文件中的prefix参数,例如glib-2.0.pc文件,将

prefix=/usr/local

修改为

prefix=/home/tianhui.he/codes/bluez/out/usr/local

修改完成后重新编译安装

make -j32
make install

1.7. libical-1.0

cd libical-1.0
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
make -j32
make install

1.8. ncurses-6.2

cd ncurses-6.2
export CPPFLAGS="-P"
./configure --host=arm-linux --target=arm-linux CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ AR=arm-linux-gnueabihf-ar STRIP=arm-linux-gnueabihf-strip --enable-widec --with-shared --with-progs=no
make -j32
make install
# make install会出错,不过不影响
# ncurses对DESTDIR的使用方式有差异,需手动将lib及include下的文件统一移动到out/usr/local下
mv ../../out/usr/lib/* ../../out/usr/local/lib/
mv ../../out/usr/include/* ../../out/usr/local/include/

1.9. readline-8.0

cd readline-8.0/
./configure --host=arm-linux --target=arm-linux CC=arm-linux-gnueabihf-gcc AR=arm-linux-gnueabihf-ar RANLIB=arm-linux-gnueabihf-ranlib enable_static=no
make -j32
# readline的编译脚本不读环境变量,需手动配置DESTDIR
make DESTDIR=/home/tianhui.he/codes/bluez/out install

1.10. bluez-5.54

cd bluez-5.54
./configure --mandir=/home/tianhui.he/codes/bluez/out/usr/local/man --sysconfdir=/etc --localstatedir=/var --host=arm-linux DBUS_LIBS='/home/tianhui.he/codes/bluez/out/usr/local/lib/libdbus-1.so' DBUS_CFLAGS='-I/home/tianhui.he/codes/bluez/out/usr/local/include/dbus-1.0/ -I/home/tianhui.he/codes/bluez/out/usr/local/lib/dbus-1.0/include' DBUS_CONFDIR= CC="arm-linux-gnueabihf-gcc -I/home/tianhui.he/codes/bluez/out/usr/local/include -I/home/tianhui.he/codes/bluez/out/usr/local/include/glib-2.0/ -I/home/tianhui.he/codes/bluez/out/usr/local/lib/glib-2.0/include/ -L/home/tianhui.he/codes/bluez/out/usr/local/lib -L/home/tianhui.he/codes/bluez/out/usr/local/lib/glib-2.0/ -lz -lffi -lgmodule-2.0 -lglib-2.0 -ldbus-1 -lreadline -lncursesw" --enable-debug --enable-test --enable-shared --enable-testing --disable-udev --disable-systemd --disable-cups --disable-obex --enable-library --enable-tools --enable-deprecated PKG_CONFIG_PATH=/home/tianhui.he/codes/bluez/out/usr/local/lib/pkgconfig

与编译dbus-1.13.18类似,配置完之后需修改几个新增库的“.la”及“.pc”文件,修改完成后重新编译安装

make -j32
make install

2. kernel配置

测试模组为aic8800d40,此模组需要外部加载firmware,所以需要开启内核的FW_LOADER功能。

CONFIG_BT=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_3WIRE=y
CONFIG_AIC_WLAN_SUPPORT=y
CONFIG_AIC_FW_PATH="/customer/vendor/etc/firmware"
CONFIG_AIC8800_WLAN_SUPPORT=m
CONFIG_AIC8800_BTLPM_SUPPORT=m
CONFIG_SERIAL_DEV_BUS=y
CONFIG_FW_LOADER=

dts部分的修改:

fuart2: fuart2@1F221400 {
            compatible = "sstar,uart";
            reg = <0x00 0x1F221400 0x00 0x100>, <0x00 0x1F221E00 0x00 0x100>;
            interrupts= <GIC_SPI INT_IRQ_FUART_2 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI INT_IRQ_UART2_MERGE IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI INT_IRQ_UART2_MERGE IRQ_TYPE_LEVEL_HIGH>;
            dma-enable;
            sctp_enable = <1>;    //  0修改为1
            rx_fifo_level = <0>;
            tx_fifo_level = <0>;
            digmux = <4>;
            clocks = <&CLK_fuart2>;
            status = "ok";
        };

padmux部分的修改:

// 新增uart pin脚配置
<PAD_SAR_ADC0_05         PINMUX_FOR_FUART2_MODE_1         MDRV_PUSE_FUART_TX>,
<PAD_SAR_ADC0_04         PINMUX_FOR_FUART2_MODE_1         MDRV_PUSE_FUART_RX>,
<PAD_SAR_ADC0_06         PINMUX_FOR_FUART2_MODE_1         MDRV_PUSE_FUART_CTS>,
<PAD_SAR_ADC0_07         PINMUX_FOR_FUART2_MODE_1         MDRV_PUSE_FUART_RTS>,

3. 运行环境配置

3.1. 复制可执行程序及所需的动态库

编译完bluez及依赖的库后可以在指定的安装目录下找到binlib文件夹,根据实际情况拷贝所需的文件到主板上的相应目录,这边我们拷贝了如下资源文件:

bin文件:
hciconfig
hciattach
dbus-daemon
bluetoothd
bluetoothctl

配置文件:
main.conf
dbus-1

shell文件:
bt_demo.sh

lib文件:
libasound.so
libasound.so.2
libasound.so.2.0.0
libdbus-1.so
libdbus-1.so.3
libdbus-1.so.3.19.13
libexpat.so
libexpat.so.1
libexpat.so.1.6.12
libglib-2.0.so
libglib-2.0.so.0
libglib-2.0.so.0.6600.3
libncurses.so
libncurses.so.6
libncurses.so.6.1
libpcre.so
libpcre.so.1
libpcre.so.1.2.12
libreadline.so
libreadline.so.8
libreadline.so.8.1
libselinux.so
libselinux.so.1

3.2. dbus-daemon运行配置

  • 从编译安装目录拷贝需要用到的bin文件到主板的/customer/bt/目录

  • dbus-1拷贝到主板的/customer/bt/目录

  • dbus默认使用的是messagebus用户,主板需添加这个用户

  • 如果使用的是dbus用户,主板需添加这个用户(可以通过echo的方式也可以通过adduser来添加)

echo "messagebus:x:500:500::/home/messagebus:/bin/sh" >> /etc/passwd
echo "dbus:x:1000:1000:Linux User,,,:/home/dbus:/bin/sh" >> /etc/passwd

3.3. bluetoothd运行配置

main.conf文件并拷贝到主板的/customer/bt/目录,main.conf内容如下:

[General]
Name = BlueZ
Class = 0x000100
DiscoverableTimeout = 0
PairableTimeout = 0
NameResolving = true
ControllerMode = dual
MultiProfile = off
FastConnectable = false
Privacy = device

[GATT]
Cache = always

[Policy]
AutoEnable = true

3.4. 测试

如前文所述,aic8800d40模组需要外部加载firmware,驱动查找firmware的目录为/customer/lib/firmware/,因此除了加载正确的驱动外还需要将它的firmware放到指定目录,这部分操作放在了wifi_demo.sh中执行。wifi_demo.sh的路径在/customer/wifi/BGAXX/或者/customer/wifi/QFNXX/路径下,请根据实际的封装来选择,文件的内容如下:

#!/bin/sh

# aic8800 sdio wifi bt firmware path
mkdir -p /customer/vendor/etc
cp -r /customer/wifi/firmware /customer/vendor/etc/

# insmod aic8800 sdio wifi driver
insmod cfg80211.ko
insmod aic8800_bsp.ko
insmod aic8800_fdrv.ko

# export bin and so path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/customer/wifi
export PATH=$PATH:/customer/wifi

# wpa_supplicant.conf ctrl_interface path
mkdir -p /tmp/wifi/run/wpa_supplicant

./wpa_supplicant -Dnl80211 -i wlan0 -c ./wpa_supplicant.conf &

在运行完wifi_demo.sh之后就可以运行bt_demo.sh,bt_demo.sh的内容如下:

注意:以下内容中的ttyS2可能需要根据实际用的fuart来修改

#!/bin/sh

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/customer/bt
export PATH=$PATH:/customer/bt
path
# system_bus_socket path
mkdir -p /var/run/dbus
# bind system_bus_socket path to /var/run/dbus
mount --bind /var/run/dbus /run/dbus

./hciattach -s 1500000 /dev/ttyS2 any 1500000 flow nosleep
sleep 0.5
./hciconfig hci0 up
sleep 0.5
./dbus-daemon --config-file=/customer/bt/dbus-1/system.conf --print-address &
sleep 0.5
./bluetoothd -E -f /customer/bt/main.conf &

正常运行的log

log

/ # cd customer/wifi/
/customer/wifi #
/customer/wifi #
/customer/wifi # ./wifi_demo.sh
aicbsp_init
RELEASE_DATE:2024_0327_3561b08f
aicbsp_resv_mem_init
AICWFDBG(LOGINFO)   rwnx v6.4.3.0 - - 241c091M (master)
AICWFDBG(LOGINFO)   RELEASE_DATE:2024_0327_3561b08f
aicbsp: aicbsp_set_subsys, subsys: AIC_WIFI, state to: 1
aicbsp: aicbsp_set_subsys, power state change to 1 dure to AIC_WIFI
aicbsp: aicbsp_platform_power_on
aicbsp: aicbsp_sdio_probe:1 vid:0xC8A1  did:0x0082
aicbsp: aicbsp_sdio_probe:2 vid:0xC8A1  did:0x0182
aicbsp: aicbsp_sdio_probe after replace:1
AICWFDBG(LOGINFO)   aicwf_sdio_chipmatch USE AIC8800D80
aicbsp: aicbsp_get_feature, set FEATURE_SDIO_CLOCK 150 MHz
aicbsp: aicwf_sdio_reg_init
AICWFDBG(LOGINFO)   aicbsp: aicbsp_driver_fw_init, chip rev: 3
rwnx_load_firmware :firmware path = /customer/vendor/etc/firmware/fw_patch_table_8800d80_u02.bin
file md5:0c9bf9c9c10f7a90a22a4c35fa58c967
rwnx_plat_bin_fw_upload_android
rwnx_load_firmware :firmware path = /customer/vendor/etc/firmware/fw_adid_8800d80_u02.bin
file md5:f546881a81b960d89a672578eb45a809
rwnx_plat_bin_fw_upload_android
rwnx_load_firmware :firmware path = /customer/vendor/etc/firmware/fw_patch_8800d80_u02.bin
file md5:35d137b8a76daaeb4f5034df8e15bcde
aicbt_patch_table_load bt btmode[3]:5
aicbt_patch_table_load bt uart_baud[3]:1500000
aicbt_patch_table_load bt uart_flowctrl[3]:1
aicbt_patch_table_load bt lpm_enable[3]:0
aicbt_patch_table_load bt tx_pwr[3]:28463
aicbsp: bt patch version: - Mar 07 2024 14:29:05 - git f94a3e4
rwnx_plat_bin_fw_upload_android
rwnx_load_firmware :firmware path = /customer/vendor/etc/firmware/fmacfw_8800d80_u02.bin
file md5:13e6f0e58aae342d260d8672ab61c31f
rd_version_val=06090101
AICWFDBG(LOGINFO)   aicwf_sdio_chipmatch USE AIC8800D80
aicbsp: aicbsp_get_feature, set FEATURE_SDIO_CLOCK 150 MHz
aicsdio: aicwf_sdio_reg_init
AICWFDBG(LOGINFO)   sdio ready
aicbsp: aicbsp_resv_mem_alloc_skb, alloc resv_mem_txdata succuss, id: 0, size: 98304
AICWFDBG(LOGINFO)   sdio_bustx_thread the policy of current thread is:1
AICWFDBG(LOGINFO)   sdio_busrx_thread the policy of current thread is:1
AICWFDBG(LOGINFO)   sdio_bustx_thread the rt_priority of current thread is:1
AICWFDBG(LOGINFO)   sdio_bustx_thread the current pid is:987
aicbsp: sdio_err:<aicwf_sdio_bus_pwrctl,1385>: bus down
AICWFDBG(LOGINFO)   sdio_busrx_thread the rt_priority of current thread is:1
aicbsp: aicbsp_get_feature, set FEATURE_SDIO_CLOCK 150 MHz
AICWFDBG(LOGINFO)   rwnx_cfg80211_init sizeof(struct rwnx_hw):14264
AICWFDBG(LOGINFO)   aicwf_prealloc_txq_alloc size is diff will to be kzalloc
AICWFDBG(LOGINFO)   aicwf_prealloc_txq_alloc txq kzalloc successful
AICWFDBG(LOGINFO)   sdio_busrx_thread the current pid is:988
AICWFDBG(LOGINFO)   FDRV chip_id=3, chip_sub_id=0!!
AICWFDBG(LOGINFO)   userconfig file path:aic_userconfig_8800d80.txt
AICWFDBG(LOGINFO)   ### Load file aic_userconfig_8800d80.txt
AICWFDBG(LOGINFO)   rwnx_load_firmware :firmware path = /customer/vendor/etc/firmware/aic_userconfig_8800d80.txt
AICWFDBG(LOGINFO)   file md5:35c8e99f3edd34d2a39bc9920e1da494
AICWFDBG(LOGINFO)   ### Load file done: aic_userconfig_8800d80.txt, size=2683
AICWFDBG(LOGINFO)   rwnx_plat_userconfig_parsing3: AIC USERCONFIG 2022/0803/1707
AICWFDBG(LOGINFO)   rwnx_plat_userconfig_parsing3: txpwr_lvl
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=enable value=1
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_1m_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_2m_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_5m5_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_11m_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_6m_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_9m_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_12m_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_18m_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_24m_2g4 value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_36m_2g4 value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_48m_2g4 value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11b_11ag_54m_2g4 value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs0_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs1_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs2_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs3_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs4_2g4 value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs5_2g4 value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs6_2g4 value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs7_2g4 value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs8_2g4 value=14
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs9_2g4 value=14
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs0_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs1_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs2_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs3_2g4 value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs4_2g4 value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs5_2g4 value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs6_2g4 value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs7_2g4 value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs8_2g4 value=14
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs9_2g4 value=14
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs10_2g4 value=13
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs11_2g4 value=13
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11a_6m_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11a_9m_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11a_12m_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11a_18m_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11a_24m_5g value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11a_36m_5g value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11a_48m_5g value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11a_54m_5g value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs0_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs1_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs2_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs3_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs4_5g value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs5_5g value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs6_5g value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs7_5g value=15
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs8_5g value=14
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11n_11ac_mcs9_5g value=14
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs0_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs1_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs2_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs3_5g value=18
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs4_5g value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs5_5g value=16
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs6_5g value=14
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs7_5g value=14
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs8_5g value=13
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs9_5g value=13
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs10_5g value=12
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_11ax_mcs11_5g value=12
AICWFDBG(LOGINFO)   rwnx_plat_userconfig_parsing3: txpwr_lvl_adj
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_enable value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_2g4_chan_1_4 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_2g4_chan_5_9 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_2g4_chan_10_13 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_5g_chan_42 value=0
AICWFDBG(LOGERROR)  invalid cmd: lvl_adj_5g_chan_42
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_5g_chan_58 value=0
AICWFDBG(LOGERROR)  invalid cmd: lvl_adj_5g_chan_58
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_5g_chan_106 value=0
AICWFDBG(LOGERROR)  invalid cmd: lvl_adj_5g_chan_106
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_5g_chan_122 value=0
AICWFDBG(LOGERROR)  invalid cmd: lvl_adj_5g_chan_122
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_5g_chan_138 value=0
AICWFDBG(LOGERROR)  invalid cmd: lvl_adj_5g_chan_138
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=lvl_adj_5g_chan_155 value=0
AICWFDBG(LOGERROR)  invalid cmd: lvl_adj_5g_chan_155
AICWFDBG(LOGINFO)   rwnx_plat_userconfig_parsing3: txpwr_loss
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=loss_enable value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=loss_value value=2
AICWFDBG(LOGINFO)   rwnx_plat_userconfig_parsing3: txpwr_ofst
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_enable value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_11b_chan_1_4 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_11b_chan_5_9 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_11b_chan_10_13 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_ofdm_highrate_chan_1_4 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_ofdm_highrate_chan_5_9 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_ofdm_highrate_chan_10_13 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_ofdm_lowrate_chan_1_4 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_ofdm_lowrate_chan_5_9 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_2g4_ofdm_lowrate_chan_10_13 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_lowrate_chan_42 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_lowrate_chan_58 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_lowrate_chan_106 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_lowrate_chan_122 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_lowrate_chan_138 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_lowrate_chan_155 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_highrate_chan_42 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_highrate_chan_58 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_highrate_chan_106 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_highrate_chan_122 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_highrate_chan_138 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_highrate_chan_155 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_midrate_chan_42 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_midrate_chan_58 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_midrate_chan_106 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_midrate_chan_122 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_midrate_chan_138 value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=ofst_5g_ofdm_midrate_chan_155 value=0
AICWFDBG(LOGINFO)   rwnx_plat_userconfig_parsing3: xtal cap
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=xtal_enable value=0
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=xtal_cap value=24
AICWFDBG(LOGINFO)   rwnx_plat_nvram_set_value_v3:command=xtal_cap_fine value=31
AICWFDBG(LOGINFO)   userconfig download complete

AICWFDBG(LOGINFO)   is 5g support = 1, vendor_info = 0x00
AICWFDBG(LOGINFO)   Firmware Version: zh Mar 07 2024 15:00:09 - ga004cf5
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:enable:1
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_1m_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_2m_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_5m5_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_11m_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_6m_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_9m_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_12m_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_18m_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_24m_2g4:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_36m_2g4:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_48m_2g4:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11b_11ag_54m_2g4:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs0_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs1_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs2_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs3_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs4_2g4:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs5_2g4:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs6_2g4:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs7_2g4:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs8_2g4:14
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs9_2g4:14
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs0_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs1_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs2_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs3_2g4:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs4_2g4:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs5_2g4:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs6_2g4:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs7_2g4:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs8_2g4:14
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs9_2g4:14
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs10_2g4:13
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs11_2g4:13
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_1m_5g:-128
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_2m_5g:-128
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_5m5_5g:-128
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_11m_5g:-128
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_6m_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_9m_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_12m_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_18m_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_24m_5g:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_36m_5g:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_48m_5g:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11a_54m_5g:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs0_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs1_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs2_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs3_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs4_5g:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs5_5g:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs6_5g:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs7_5g:15
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs8_5g:14
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11n_11ac_mcs9_5g:14
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs0_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs1_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs2_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs3_5g:18
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs4_5g:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs5_5g:16
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs6_5g:14
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs7_5g:14
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs8_5g:13
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs9_5g:13
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs10_5g:12
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_v3_in_fdrv:lvl_11ax_mcs11_5g:12
AICWFDBG(LOGINFO)   get_userconfig_txpwr_loss:loss_enable:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_loss:loss_value:2
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:enable:1
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_1m_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_2m_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_5m5_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_11m_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_6m_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_9m_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_12m_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_18m_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_24m_2g4:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_36m_2g4:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_48m_2g4:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11b_11ag_54m_2g4:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs0_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs1_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs2_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs3_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs4_2g4:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs5_2g4:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs6_2g4:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs7_2g4:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs8_2g4:14
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs9_2g4:14
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs0_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs1_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs2_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs3_2g4:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs4_2g4:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs5_2g4:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs6_2g4:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs7_2g4:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs8_2g4:14
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs9_2g4:14
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs10_2g4:13
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs11_2g4:13
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_1m_5g:-128
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_2m_5g:-128
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_5m5_5g:-128
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_11m_5g:-128
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_6m_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_9m_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_12m_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_18m_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_24m_5g:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_36m_5g:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_48m_5g:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11a_54m_5g:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs0_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs1_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs2_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs3_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs4_5g:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs5_5g:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs6_5g:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs7_5g:15
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs8_5g:14
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11n_11ac_mcs9_5g:14
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs0_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs1_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs2_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs3_5g:18
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs4_5g:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs5_5g:16
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs6_5g:14
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs7_5g:14
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs8_5g:13
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs9_5g:13
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs10_5g:12
AICWFDBG(LOGINFO)   rwnx_send_txpwr_lvl_v3_req:lvl_11ax_mcs11_5g:12
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:enable:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_2g4_chan_1_4:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_2g4_chan_5_9:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_2g4_chan_10_13:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_5g_chan_42:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_5g_chan_58:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_5g_chan_106:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_5g_chan_122:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_5g_chan_138:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_lvl_adj_in_fdrv:lvl_adj_5g_chan_155:0
AICWFDBG(LOGINFO)   get_userconfig_txpwr_ofst2x_in_fdrv:enable      :0
AICWFDBG(LOGINFO)   pwrofst2x 2.4g: [0]:11b, [1]:ofdm_highrate, [2]:ofdm_lowrate
  chan= 1-4 5-9 10-13
AICWFDBG(LOGINFO)
  [0] =
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)
  [1] =
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)
  [2] =
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)
pwrofst2x 5g: [0]:ofdm_lowrate, [1]:ofdm_highrate, [2]:ofdm_midrate
  chan= 36-50   51-64   98-114  115-130 131-146 147-166
AICWFDBG(LOGINFO)
  [0] =
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)
  [1] =
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)
  [2] =
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)       0
AICWFDBG(LOGINFO)
AICWFDBG(LOGINFO)   rwnx_send_txpwr_ofst2x_req:Do not use txpwr_ofst2x
AICWFDBG(LOGINFO)   get_userconfig_xtal_cap:enable       :0
AICWFDBG(LOGINFO)   get_userconfig_xtal_cap:xtal_cap     :0
AICWFDBG(LOGINFO)   get_userconfig_xtal_cap:xtal_cap_fine:0
AICWFDBG(LOGINFO)   get macaddr: 5c:8e:8b:54:db:93
AICWFDBG(LOGINFO)   getRegdomainFromRwnxDB set ccode:00
AICWFDBG(LOGINFO)   rwnx_get_countrycode_channels support channel:1 2 3 4 5 6 7 8 9 10 11 12 13 14 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140 144 149 153 157 161 165
ieee80211 phy0:
*******************************************************
** CAUTION: USING PERMISSIVE CUSTOM REGULATORY RULES **
*******************************************************
AICWFDBG(LOGINFO)   fw_log_init: ffffff8003628000, ffffff800362a800
AICWFDBG(LOGINFO)   rwnx_interface_add: wlan%d, 2, 10
AICWFDBG(LOGINFO)   interface add:5c 8e 8b 54 db 93
AICWFDBG(LOGINFO)   New interface create wlan0
/customer/wifi # Successfully initialized wpa_supplicant
nl80211: kernel reports: Authentication algorithm number required
rfkill: Cannot open RFKILL control device
rwnx_virtual_interface_add: 10, p2p-dev-wlan0
rwnx_virtual_interface_add, ifname=p2p-dev-wlan0, wdev=0000000039d3acfa, vif_idx=1
p2p dev addr=5c 8e 8b 54 db 92
nl80211: kernel reportP2P interface started
s: Registration to specific type not supported
rfkill: Cannot get wiphy information

/customer/wifi #
/customer/wifi #
/customer/wifi # cd ../bt/
/customer/bt # ./bt_demo.sh
Device setup complete
unix:path=/var/run/dbus/system_bus_socket,guid=bae36beab28e58e759dc9ef90000002a
/customer/bt #
/customer/bt # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/customer/bt
/customer/bt #
/customer/bt # ./bluetoothctl
Agent registered
[CHG] Controller 5C:8E:8B:54:DB:94 Pairable: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller 5C:8E:8B:54:DB:94 Discovering: yes
[NEW] Device 48:D8:45:02:BB:54 JEET AIR PLUS L
[NEW] Device 48:D8:45:02:FB:1F JEET AIR PLUS R
[NEW] Device 56:45:B4:B0:CA:49 56-45-B4-B0-CA-49
[NEW] Device 48:F5:8D:BE:E9:1C 48-F5-8D-BE-E9-1C
[bluetooth]# scan off
Discovery stopped
[CHG] Device 48:F5:8D:BE:E9:1C RSSI is nil
[CHG] Device 56:45:B4:B0:CA:49 TxPower is nil
[CHG] Device 56:45:B4:B0:CA:49 RSSI is nil
[CHG] Device 48:D8:45:02:FB:1F RSSI is nil
[CHG] Device 48:D8:45:02:BB:54 RSSI is nil
[CHG] Controller 5C:8E:8B:54:DB:94 Discovering: no
[bluetooth]#

运行命令的介绍:

1、模组上电且驱动加载正常的话用hciconfig -a命令应该可以看到hci0设备,启用该设备使之进入UP RUNNING状态

/customer/bt # ./hciconfig -a
hci0:   Type: Primary  Bus: UART
    BD Address: 5C:8E:8B:54:DB:94  ACL MTU: 1021:9  SCO MTU: 255:4
    UP RUNNING
    RX bytes:1096 acl:0 sco:0 events:63 errors:0
    TX bytes:1358 acl:0 sco:0 commands:53 errors:0
    Features: 0xbf 0x2e 0x4d 0xfe 0xd8 0x3f 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV3
    Link policy: RSWITCH SNIFF
    Link mode: SLAVE ACCEPT
    Name: 'BlueZ'
    Class: 0x000100
    Service Classes: Unspecified
    Device Class: Computer, Uncategorized
    HCI Version:  (0xd)  Revision: 0xb
    LMP Version:  (0xd)  Subversion: 0xb
    Manufacturer: not assigned (2875)

/customer/bt #

2、启动dbus

./dbus-daemon --config-file=/customer/bt/dbus-1/system.conf --print-address &

3、启动bluetoothd,若是有根据前面的配置在main.conf中开启AutoEnable=true则bluetoothd会自动启用hci设备,那么可以省略第一步

./bluetoothd -E -f /customer/bt/main.conf &

4、使用bluetoothctl测试蓝牙功能,如scan on/off开关扫描

/customer/bt # ./bluetoothctl
Agent registered
[CHG] Controller 5C:8E:8B:54:DB:94 Pairable: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller 5C:8E:8B:54:DB:94 Discovering: yes
[NEW] Device 48:D8:45:02:BB:54 JEET AIR PLUS L
[NEW] Device 48:D8:45:02:FB:1F JEET AIR PLUS R
[NEW] Device 56:45:B4:B0:CA:49 56-45-B4-B0-CA-49
[NEW] Device 48:F5:8D:BE:E9:1C 48-F5-8D-BE-E9-1C
[bluetooth]# scan off
Discovery stopped
[CHG] Device 48:F5:8D:BE:E9:1C RSSI is nil
[CHG] Device 56:45:B4:B0:CA:49 TxPower is nil
[CHG] Device 56:45:B4:B0:CA:49 RSSI is nil
[CHG] Device 48:D8:45:02:FB:1F RSSI is nil
[CHG] Device 48:D8:45:02:BB:54 RSSI is nil
[CHG] Controller 5C:8E:8B:54:DB:94 Discovering: no
[bluetooth]#

4. 调试方法

1、直接使用hcitool工具发送命令,如

hciconfig hci0 up
# 0x0006命令设置广播参数,广播间隔(如下:0x0020 ~ 0x0040之间,单位为0.625ms)等...
hcitool -i hci0 cmd 0x08 0x0006 0x0020 0x0040 0x00 0x00 0x00 00 00 00 00 00 00 0x07 0x00
# 0x0008命令设置广播内容,数据格式为total length(1Byte) :ltv(1+1+len Byte) : ltv ...
hcitool -i hci0 cmd 0x08 0x0008 16 02 01 06 03 02 80 ff 0e 09 62 6c 65 5f 6e 61 6d 65 5f 31
# 0x000A命令开启广播
hcitool cmd 0x08 0x000A 0x01

2、使用bluetoothd-d选项开启调试信息;

3、使用hcidump -w xxx.cfa抓取hci数据包后放到pc上用wireshark分析。