BLE AMS Example

Source code path: example/ble/ams

Supported Platforms

All platforms

Overview

This example demonstrates how to trigger Apple AMS (Apple Media Service) protocol subscription and simple handling of corresponding events. AMS is an audio control protocol provided by Apple that allows access to the current iOS device’s audio playback status and control of music play, pause, etc.

Usage Instructions

  1. The example starts advertising upon boot with the name SIFLI_APP-xx-xx-xx-xx-xx-xx, where xx represents the Bluetooth address of the device. This can be obtained using the finsh command “nvds get_mac”.

  2. Use BLE software (LightBlue, nRF Connect, etc.) on iOS devices (iPhone or iPad) to connect to this device. Note that AMS requires pairing to complete, so you must accept when the pairing dialog appears on the iOS device.

  3. Play music on the iOS device. This example has registered AMS Player/queue/track, and you can see related content in the logs.

    1. Related protocol reference: AMS Official Documentation

Hardware Requirements

Before running this example, prepare:

Compilation and Flashing

Switch to the example project directory and run the scons command to compile:

> scons --board=eh-lb525 -j32

Switch to the example project/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 download steps, please refer to the Quick Start Guide.

Expected Results

After the example starts:

  1. It can be connected and successfully paired by BLE software on iOS (such as LightBlue, nRF Connect).

  2. When the iOS device plays music, the device displays related information through logs.

Troubleshooting

Reference Documentation

Update History

Version

Date

Release Notes

0.0.1

01/2025

Initial version