BLE File Transfer Example

Source code path: example/ble/file_transfer

Supported Platforms

All platforms

Overview

This example demonstrates how to implement a GAP peripheral role on this platform to receive files sent from a mobile device.

Example Usage

  1. The Finsh commands for this example can be displayed by entering diss help to show command usage.

  2. When operating as a peripheral device, it will start advertising on boot with the name format: SIFLI_APP-xx-xx-xx-xx-xx-xx, where xx represents the device’s Bluetooth address. You can connect using a mobile BLE app.

  3. The sifli ble serial transport protocol can be used to send files from the mobile device to the target device, supporting one or multiple files in a single transfer.

Hardware Requirements

Before running this example, you need to prepare:

Compilation and Flashing

Navigate to the example’s project/common directory and run the scons command to compile:

> scons --board=eh-lb525 -j32

Navigate to the example’s project/common/build_xx directory and run uart_download.bat, then select the port as prompted to download:

$ ./uart_download.bat
     Uart Download
please input the serial port num:5

For detailed compilation and downloading steps, please refer to the relevant sections in Quick Start.

Expected Results

After the example starts:

  1. It can be discovered and connected by a mobile BLE app.

  2. Compress the files to be transferred into a single .zip file and transfer this file to your mobile device.

  3. Use the SIFLI BLE app to search for and connect to the device, then on the watchface interface, select custom file and choose the file to transfer it to the device.

  4. Mobile app operation steps: APP1 APP2 APP3 APP4

  5. Transfer interface: Set file type to 3 (custom file) Check the withByteAlign option Future development can define different processing for various file types

Mobile SDK Integration

https://github.com/OpenSiFli/SiFli_OTA_APP SiFli-SDK file transfer

Troubleshooting

When the development board returns an error, check the ble_watchface_status_id_t enumeration in bf0_sibles_watchface.h

Reference Documentation

Update History

Version

Date

Release Notes

0.0.1

07/2025

Initial version

No newline at end of right file.