2 Star 8 Fork 2

霓光计划-Harmony/NLChat星闪通讯软件

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SLE_Device_Configure_Tutorial.md 9.08 KB
一键复制 编辑 原始数据 按行查看 历史
Hny0305Lin 提交于 2024-07-04 17:58 . 更新SLE硬件配置烧入教程。

SLE串口透传测试

该教程演示如何通过两块开发板实现SLE数据传输测试,A开发板通过串口接收数据,然后通过SLE传输给B开发板,B开发板通过串口将接收到的数据打印出来;同样,B开发板通过串口接收数据,然后通过SLE传输给A开发板,A开发板通过串口将接收到的数据打印出来。在测试中需要一块开发板做为Server端,另外一块开发板做为Client端,两块开发板配对后就可以互发消息了。

图片

图片

一、准备工作

  • 准备2块BearPi-Pico H2821开发板
  • 准备2根USB Type-C双头数据线,方便开发板连入手机等设备
  • 准备好硬件侧端项目,因为需要编译,点我前往硬件侧端

二、编译 SLE UART Server代码

在Windows下编译操作

  1. 点击左侧的“KConfig”,打开配置界面.

    Alt text

  2. 选择Enable SLE UART Server sample

    Application  --->
        [*] Enable Sample.
        [ ]     Enable the Sample of peripheral.
        [*]     Enable the Sample of products.
        [ ]         Enable all the sample of product, it's just for build.
        [ ]         Support BLE UART sample.
        [*]         Support SLE UART sample.
                        SLE UART Sample Configuration  --->
                            Select sle uart type (Enable SLE UART Server sample.)  --->
                                    (X) Enable SLE UART Server sample.
                                    ( ) Enable SLE UART Client sample.

    Alt textAlt text

  3. 选择协议

    Protocol  --->
        Select sle ble support  --->
            ( ) Select sle ble central default.
            (X) Select sle ble peripheral.
            ( ) Select sle peripheral.
            ( ) Select sle central.
            ( ) Select ble peripheral.
    
    

    Alt text

  4. 按下"Save"键保存配置。

    Alt text

  5. 编译烧录固件

    参考环境搭建教程编译烧录代码

在Ubuntu下编译操作

  1. 在MobaXterm中输入:

  2. 选择Enable SLE UART Server sample

    Application  --->
        [*] Enable Sample.
        [ ]     Enable the Sample of peripheral.
        [*]     Enable the Sample of products.
        [ ]         Enable all the sample of product, it's just for build.
        [ ]         Support BLE UART sample.
        [*]         Support SLE UART sample.
                        SLE UART Sample Configuration  --->
                            Select sle uart type (Enable SLE UART Server sample.)  --->
                                    (X) Enable SLE UART Server sample.
                                    ( ) Enable SLE UART Client sample.

    Alt textAlt text

  3. 选择协议

    Protocol  --->
        Select sle ble support  --->
            ( ) Select sle ble central default.
            (X) Select sle ble peripheral.
            ( ) Select sle peripheral.
            ( ) Select sle central.
            ( ) Select ble peripheral.
    
    

    Alt text

  4. 按下"ESC"键退出并保存配置。

  5. 编译烧录固件

    参考环境搭建教程编译烧录代码

三、编译 SLE UART Client代码

在Windows下编译操作

  1. 点击左侧的“KConfig”,打开配置界面.

    Alt text

  2. 选择Enable SLE UART Client sample

    Application  --->
        [*] Enable Sample.
        [ ]     Enable the Sample of peripheral.
        [*]     Enable the Sample of products.
        [ ]         Enable all the sample of product, it's just for build.
        [ ]         Support BLE UART sample.
        [*]         Support SLE UART sample.
                        SLE UART Sample Configuration  --->
                            Select sle uart type (Enable SLE UART Server sample.)  --->
                                    ( ) Enable SLE UART Server sample.
                                    (X) Enable SLE UART Client sample.

    Alt textAlt text

  3. 选择协议

    Protocol  --->
        Select sle ble support  --->
            (X) Select sle ble central default.
            ( ) Select sle ble peripheral.
            ( ) Select sle peripheral.
            ( ) Select sle central.
            ( ) Select ble peripheral.
    
    

    Alt text

  4. 按下"Save"键保存配置。

    Alt text

  5. 编译烧录固件

    参考环境搭建教程编译烧录代码

在Ubuntu下编译操作

  1. 在MobaXterm中输入:

  2. 选择Enable SLE UART Client sample

    Application  --->
        [*] Enable Sample.
        [ ]     Enable the Sample of peripheral.
        [*]     Enable the Sample of products.
        [ ]         Enable all the sample of product, it's just for build.
        [ ]         Support BLE UART sample.
        [*]         Support SLE UART sample.
                        SLE UART Sample Configuration  --->
                            Select sle uart type (Enable SLE UART Server sample.)  --->
                                    ( ) Enable SLE UART Server sample.
                                    (X) Enable SLE UART Client sample.

    Alt textAlt text

  3. 选择协议

    Protocol  --->
        Select sle ble support  --->
            (X) Select sle ble central default.
            ( ) Select sle ble peripheral.
            ( ) Select sle peripheral.
            ( ) Select sle central.
            ( ) Select ble peripheral.
    
    

    Alt text

  4. 按下"ESC"键退出并保存配置。

  5. 编译烧录固件

    参考环境搭建教程编译烧录代码

四、测试

烧录固件后先启动server设备,再启动client设备,在串口工具的输入框中输入数据并发送,测试server和client设备之间的数据收发,如下图所示。

Alt text

Alt text

Alt text

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/light-harmonyOS/NLChat.git
git@gitee.com:light-harmonyOS/NLChat.git
light-harmonyOS
NLChat
NLChat星闪通讯软件
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891