Skip to content

Bluetooth SDK Examples

The SiFli-SDK Bluetooth examples are focused starting points for a profile, role, or radio workflow; they are not drop-in product firmware. Start with the project that covers the product's most demanding technical requirement, get the unmodified example working on the target board, and then add one product requirement at a time.

This page organizes the Classic Bluetooth, BLE, and LE Audio broadcast examples listed in the SF32LB58x documentation by engineering task. The sf32lb58x path identifies the documentation section; it does not promise that every example supports every SF32LB58x board or another SF32 family. The latest URL is rolling. For the SDK release or commit you plan to use, check the matching project's Supported Platforms section and follow only its listed board names and build instructions. If the target board or SDK revision is not explicitly established, mark compatibility as unverified rather than inferring it from the URL, a neighboring example, or a similarly named board. Even when a page says “all platforms,” verify the example against the actual SDK revision and board configuration before product work. The project page is also the reference for menuconfig settings, test equipment, and limitations.

Start with the Right Bluetooth Path

Table: Bluetooth SDK Example Selection
Product need Start with Validate before product integration
A custom BLE service or companion-app link BLE Peripheral Advertising, connection, the service interface and behavior, reconnection, and phone-side validation
The device must act as both a phone peripheral and a sensor central BLE Central and Peripheral Simultaneous GAP roles and GATT client/server ownership
Reliable BLE data transfer BLE Throughput or BLE File Transfer The required payload flow, connection settings, and recovery behavior
Bluetooth firmware update Peripheral with OTA or Central and Peripheral with Pingpong OTA Update roles, recovery after an interrupted update, partitions, and rollback plan
Classic Bluetooth serial or phone-tethered networking SPP or PAN The serial profile or phone-provided network path, peer compatibility, and reconnection behavior
Host-to-controller HCI transport over UART for BT/BLE HCI over UART (BT/BLE) The host/controller boundary, UART transport, and target controller and board configuration
Classic Bluetooth audio or calls Music Sink, Music Source, or HFP Audio route, clocking, buffering, phone interoperability, and power budget
LE Audio broadcast BAP Broadcast Source or BAP Broadcast Sink Broadcast role, audio pipeline, test receiver or transmitter, and timing margin

Bring Up an Example as Evidence

Before changing the project, record the exact SDK version, board name, configuration, peer device or app, radio settings, and expected log. Then work through this sequence:

  1. Build and flash the unmodified example using the exact board name and instructions listed for the matching SDK release. If the release-to-documentation match or board support is not established, treat compatibility as unverified before adapting the example.
  2. Prove the defining over-the-air behavior: discover, connect, transfer, stream, or receive as appropriate.
  3. Repeat the test after reset, disconnect, reconnect, and power-cycle conditions.
  4. Add one product-specific service, user-flow, audio route, or power policy at a time.
  5. Retest under the product's combined workload, including display, sensors, storage, audio, and low-power transitions where applicable.

A working example demonstrates only the workflow it covers. It does not establish that the product's security policy, radio range, latency, power consumption, or interoperability is ready for release.

BLE Examples

Use BLE examples for companion-app links, interoperable GATT services, beacons, data transfer, and BLE-based OTA. Select a role-oriented example first, then add a profile example only when the product needs that standardized service.

Table: BLE SDK Examples by Engineering Task
Engineering task Official examples Use these projects to establish
Foundation roles and service access Peripheral, Central and Peripheral, Multi-Connection Advertising, scanning, connection ownership, and the correct central/peripheral split
Phone integration AMS, ANCS, Dual-Core ANCS Apple media or notification integration and the required phone-side pairing flow
Standard GATT profiles BASC, CPPC, CSCPC, DISS, HRPC, CTS The service role, GATT characteristic definitions, and peer interoperability of a standard profile
Input and intercom HID, BLE Talkback The interaction model before product UI or voice behavior is added
Pairing and reconnect behavior BLE Pair Bonding, identity handling, and the product's re-pairing path
Advertising and discovery iBeacon, Periodic Advertising, Periodic Advertising Sync The required broadcast or synchronization behavior without assuming a GATT connection
Data transfer and OTA File Transfer, Throughput, Peripheral with OTA, Central and Peripheral with Pingpong OTA Payload, link parameters, update roles, interruption recovery, and end-to-end validation

Do not treat a throughput result as a product data rate. It depends on the selected PHY, connection settings, peer behavior, RF environment, host activity, and payload pattern. Likewise, an ANCS or AMS example is a phone-integration baseline, not a guarantee for every iOS release or user permission state.

Classic Bluetooth Examples

Classic Bluetooth projects are relevant to products that need BR/EDR profiles, audio, serial-style transport, or IP networking through a phone. A successful development-board demonstration is only a starting point; validate interoperability with the product's actual peer devices and workload.

Table: Classic Bluetooth SDK Examples by Engineering Task
Engineering task Official examples Use these projects to establish
Host/controller transport or Classic Bluetooth serial profile HCI over UART (BT/BLE), SPP The host/controller boundary and UART transport for HCI, or the serial profile behavior for SPP
Audio streaming and media control A2DP Multi-Connection, A2DP Sharing, AVRCP Cover Art, Music Sink, Music Sink with Relay, Music Source The intended source/sink topology, audio route, media-control path, and resource budget
Calls and voice links 3-SCO, HFP, HFP Relay Call topology, audio latency, microphone/speaker path, and phone behavior
Phone-provided networking and OTA PAN, PAN OTA Phone tethering, IP traffic, reconnection, and the OTA delivery path

For the PAN networking model and phone-side setup, see Bluetooth PAN. For audio routing, buffer ownership, and system-load validation, see Audio Overview and Audio Server and Buffering.

LE Audio Broadcast Examples

The sf32lb58x documentation path alone does not establish board compatibility; check the Supported Platforms section for the exact SDK revision and target board. In the Classic Bluetooth/BAP bridge example, the README title identifies a source, but its path and overview describe a sink. The implementation at the reviewed SDK revision handles Classic A2DP and starts a BAP broadcast source; this finding applies to that pinned revision, not automatically to every release served by latest. Before building, check the README, source, and board configuration for the exact SDK release or commit you use. Do not infer the example's role or board support from the copied sink description.

The zbt projects provide LE Audio broadcast source and sink examples based on the Basic Audio Profile (BAP). Treat the source and sink as a paired system test: the broadcast configuration, audio source, receiver, clocking, and RF conditions all matter to the observed result.

Table: LE Audio Broadcast SDK Examples
Product direction Official example What to establish first
Receive a broadcast audio stream BAP Broadcast Sink Receiver behavior, output audio path, and the test broadcast configuration
Transmit a broadcast audio stream BAP Broadcast Source Source audio pipeline, broadcast configuration, and a known-good receiver
Bridge Classic Bluetooth and LE Audio broadcast BAP Broadcast Source with Classic Bluetooth The two audio domains, their handoff boundary, and combined timing/resource margin

Product Validation Beyond the Example

Table: Bluetooth Example Product-Adaptation Checks
Boundary Preserve from the source example Re-validate for the product
Radio behavior The supported board and the example's intended role or profile Antenna, enclosure, range, RF coexistence, peer devices, and regulatory test plan
Connection policy The baseline advertising, scan, or connection flow Product latency, power target, reconnect strategy, and state transitions
Security The example's pairing or bonding setup Authentication requirements, key storage, privacy, factory reset, and user-facing recovery
Data and audio The demonstrated packet or stream flow Payload format and exchange rules, error recovery, latency, buffering, codec configuration, and memory margin
Evidence Build settings, logs, and expected behavior Repeatable phone/accessory matrix, power trace, disconnect recovery, and regression test

Last updated: