当打开蓝牙后没有反应时,需要排查蓝牙节点是否对应、固件是否加载成功,本文介绍开源鸿蒙OpenHarmony4.1系统下适配蓝牙的方法,触觉智能SBC3568主板演示
修改对应节点
开发板蓝牙硬件连接为UART1,修改对应的节点,路径为:
ido_ohos_4.1r_sdk/vendor/hihope/rk3568/bluetooth/include/bt_vendor_brcm.h
/* Device port name where Bluetooth controller attached */
#ifndef BLUETOOTH_UART_DEVICE_PORT
#define BLUETOOTH_UART_DEVICE_PORT "/dev/ttyS1" /* maguro */
#endif
如图所示:
添加对应固件
检查蓝牙固件位置
ido_ohos_4.1r_sdk/vendor/hihope/rk3568/bluetooth/
路径是否有对应的蓝牙固件,如图所示:
注意:如果没有对应的蓝牙固件请联系WiFi厂商获取
修改bluetooth路径下BUILD.gn文件,将用到的蓝牙固件添加到下方,如图所示:
ohos_prebuilt_etc("BCM43430A1.hcd") {
source = "//vendor/{product_company}/{product_name}/bluetooth/BCM43430A1.hcd"
install_images = [ vendor_base_dir ]
relative_install_dir = "firmware"
part_name = "rockchip_products"
install_enable = true
}
在下面路径添加对应的蓝牙固件名称,如图所示:
/ido_ohos_4.1r_sdk/device/board/hihope/rk3568/ohos.build
{
"subsystem": "rockchip_products",
"parts": {
"rockchip_products": {
"module_list": [
"//device/board/hihope/${device_name}:rk3568_group",
"//vendor/hihope/${product_name}/bluetooth:libbt_vendor",
"//vendor/hihope/${product_name}/bluetooth:BCM43430A1.hcd",
"//vendor/hihope/${product_name}/bluetooth:BCM4345C0.hcd",
"//vendor/hihope/${product_name}/bluetooth:BCM4345C5.hcd",
"//device/board/hihope/${device_name}/camera/vdi_impl/v4l2:camera_board_vdi_impl"
],
"test_list": [
"//kernel/linux/build/test:linuxkerneltest",
"//device/board/hihope/${device_name}/camera/vdi_impl/v4l2:camera_board_test"
],
"inner_kits": []
}
}
}
重新编译
将修改好的代码保存后退出,重新编译即可
./build.sh --project-name rk3568 --ccache