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
The Finsh commands for this example can be displayed by entering
diss helpto show command usage.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.
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:
A development board supported by this example (Supported Platforms).
A mobile device.
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:
It can be discovered and connected by a mobile BLE app.
Compress the files to be transferred into a single .zip file and transfer this file to your mobile device.
Use the SIFLI BLE APP to search, connect the device, then go to the watchface interface, select the custom file, and then choose this file. This file can then be transferred to the file system of the development board.
Mobile app operation steps:
Enable location permission for opening the feature

Click the query button at the bottom right corner to enter the Bluetooth scanning interface.

Click on “SCAN” to start the scan.

After finding the device, click on “SORT”, and the broadcast named “SIFLI_APP-xx-xx-xx-xx-xx-xx” will be placed at the top.

Click on the broadcast name “SIFLI_APP-xx-xx-xx-xx-xx-xx” to enter the device interface.

Click on the upper right corner to enter the operation interface.

Click “CONNECT” to ensure that the State is “CONNECT”

Swipe up the last box, find File transfer WFPUSH2 and click to enter the file transfer interface

Click on “SELECT FILE” to select the pre-prepared zip file from your phone, and set the “File Type” to 3. Then, check the “With Byte Align” option, and finally click “START”.

After the transmission is completed, execute the command in the console window to enter the “file_recv” folder, and then execute the “ls” command to view the list of files. Among them, the content of the zip file will be displayed.

Access to the mobile APP and DEMO project for use
Download address of Android’s free software application
https://www.pgyer.com/gurSBc
Android demo project
https://github.com/OpenSiFli/SiFli_OTA_APP
The corresponding part is “3. SiFli-SDK OTA”
iOS demo工程
https://github.com/OpenSiFli/SiFli_OTA_APP_IOS
The corresponding part is “SiFli-SDK OTA (Nor Offline)”
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. |