Hands-free Audio Gateway (AG)
Overview
Application demonstrating usage of the Hands-free Audio Gateway (AG) APIs.
Requirements
Running on the host with Bluetooth BR/EDR (Classic) support, or
A board with Bluetooth BR/EDR (Classic) support
Building and Running
See Bluetooth samples for details.
Running
The application works as a Hands-Free Audio Gateway. After the Bluetooth Host stack is initialized,
the GAP discovery procedure will be started automatically. The target device is Hands-Free Unit
(The major of COD is 0x04 (BT_COD_MAJOR_AUDIO_VIDEO), the minor of the COD is 0x02
(BT_COD_MAJOR_AUDIO_VIDEO_MINOR_HANDS_FREE)). When the target device is discovered,
the AG will connect to the device.
After the ACL connection is established, the AG will initiate the Service Discovery Protocol (SDP) to discover the Hands-Free Unit’s supported features. Once the HFP connection is established, the AG will be ready to handle incoming calls and audio streaming requests from the connected HFP unit.
The application will remain in a standby state, waiting for the outgoing call request from the
Hands-Free Unit. If there are no incoming or outgoing calls within the duration specified by
CONFIG_BT_HFP_AG_START_CALL_DELAY_TIME, the AG will start a simulation call. The
direction of the call is determined by CONFIG_BT_HFP_AG_CALL_OUTGOING.
Once a call is initiated, the AG will establish an SCO (Synchronous Connection-Oriented) link for audio transmission.
When the SCO connect is established, the application will initialize the codec and pcm interface for voice streaming if the codec and pcm configurations are available.
The HFP application requires the following optional configuration options:
The codec depends on the devicetree alias named i2s-codec-rx and i2s-codec-tx.
The PCM interface depends on the devicetree alias named pcm-rxtx, or pcm-tx and pcm-rx.
After the call is active, the AG will start a delay-able worker with the 10 seconds timeout to disconnect the ACL connection directly.
This sample has been tested on mimxrt1170_evk@B/mimxrt1176/cm7.
Bluetooth Hands-Free Audio Gateway voice streaming topology