How to Configure the Profile of Feasycom Bluetooth Audio Module by AT Commands?

2024-07-21 FEASYCOM Official Website
Bluetooth Audio Module,FSC-BT1036C,FSC-BT1026C,FSC-BT1035

FEASYCOM's Bluetooth Audio Module includes a series of profiles for data and audio transmission functions. When developers are writing and debugging programs, they often need to configure the module firmware's functionality. Therefore, Feasycom provides a set of AT commands with a specific format to facilitate developers in configuring profiles anytime, anywhere. This article will introduce how to use these AT commands to developers using Feasycom Bluetooth Audio modules.


First, the format of Feasycom's AT commands is as follows:


AT+Command{=Param1{,Param2{,Param3...}}}<CR><LF>


Note:

- All commands start with "AT" and end with "<CR><LF>"


- "<CR>" represents the carriage return, corresponding to "HEX" as "0x0D"


- "<LF>" represents the line feed, corresponding to "HEX" as "0x0A"


- If the command includes parameters, the parameters should be separated by "="


- If the command includes multiple parameters, the parameters should be separated by ","


- If the command has a response, the response starts with "<CR><LF>" and ends with "<CR><LF>"


- The module should always return the result of the command execution, returning "OK" for success and ERR<code> for failure (the figure below lists the meanings of all ERR<code>)


Error Code  | Meaning

------------|--------

001         | Failed

002         | Invalid parameter

003         | Invalid state

004         | Command mismatch

005         | Busy

006         | Command not supported

007         | Profile not turned on

008         | No memory

Others      | Reserved for future use


The following are two examples of AT command execution results:

1. Read the Bluetooth name of the module

 

<< AT+VER

>> +VER=FSC-BT1036-XXXX

>> OK


2. Answer a call when there is no incoming call


<< AT+HFPANSW

>> ERR003


Next, let's list some commonly used profiles as shown below:


- SPP (Serial Port Profile)

- GATTS (Generic Attribute Profile LE-Peripheral role)

- GATTC (Generic Attribute Profile LE-Central role)

- HFP-HF (Hands-Free Profile)

- HFP-AG (Hands-Free-AG Profile)

- A2DP-Sink (Advanced Audio Distribution Profile)

- A2DP-Source (Advanced Audio Distribution Profile)

- AVRCP-Controller (Audio/Video remote controller Profile)

- AVRCP-Target (Audio/Video remote controller Profile)

- HID-DEVICE (Human Interface Profile)

- PBAP (Phonebook Access Profile)

- iAP2 (For iOS devices)


Finally, we list the corresponding AT commands for the profiles mentioned above in the table below:


Command     | AT+PROFILE{=Param}

Param       | Expressed as a decimal bit field, each bit represents

BIT[0]      | SPP (Serial Port Profile)

BIT[1]      | GATT Server (Generic Attribute Profile)

BIT[2]      | GATT Client (Generic Attribute Profile)

BIT[3]      | HFP-HF (Hands-Free Profile Handsfree)

BIT[4]      | HFP-AG (Hands-Free Profile Audio Gateway)

BIT[5]      | A2DP Sink (Advanced Audio Distribution Profile)

BIT[6]      | A2DP Source (Advanced Audio Distribution Profile)

BIT[7]      | AVRCP Controller (Audio/Video remote controller Profile)

BIT[8]      | AVRCP Target (Audio/Video remote controller Profile)

BIT[9]      | HID Keyboard (Human Interface Profile)

BIT[10]     | PBAP Server (Phonebook Access Profile)

BIT[15]     | iAP2 (For iOS devices)

Response    | +PROFILE=Param

Note        | The following profiles cannot be enabled simultaneously via AT commands:

- GATT Server and GATT Client

- HFP Sink and HFP Source

- A2DP Sink and A2DP Source

- AVRCP Controller and AVRCP Target


Using AT commands to configure the Profile of Feasycom Bluetooth Audio Module is implemented in binary form in the firmware program. The parameters need to be configured by converting the corresponding BIT positions to decimal numbers. Here are three examples:

1. Read the current profile


<< AT+PROFILE

>> +PROFILE=1195


2. Enable only HFP Source and A2DP Source, disable others (i.e., both BIT[4] and BIT[6] are 1 in binary, and other BIT positions are 0, the converted decimal sum is 80)


<< AT+PROFILE=80

>> OK


3. Enable only HFP Sink and A2DP Sink, disable others (i.e., both BIT[3] and BIT[5] are 1 in binary, and other BIT positions are 0, the converted decimal sum is 40)


<< AT+PROFILE=40

>> OK


The complete AT commands can be obtained from the corresponding product's general programming manual provided by Feasycom. Below are only a few main Bluetooth Audio module general programming manual download links:

- FSC-BT1036C (Master-Slave integrated, can switch between audio master and audio slave functions through commands)

- FSC-BT1026C (Supports audio slave function and TWS function)

- FSC-BT1035 (Supports audio master function)


  • +1 Like
  • Add to Favorites

Recommend

This document is provided by Sekorm Platform for VIP exclusive service. The copyright is owned by Sekorm. Without authorization, any medias, websites or individual are not allowed to reprint. When authorizing the reprint, the link of www.sekorm.com must be indicated.

Contact Us

Email: