Hvordan konfigurere profilen til Feasycom Bluetooth Audio Module med på kommandoer?
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. Derfor, Feasycom provides a set of AT commands with a specific format to facilitate developers in configuring profiles anytime, hvor som helst. This article will introduce how to use these AT commands to developers using Feasycom Bluetooth -lyd modules.
Først, the format of Feasycom’s AT commands is as follows:
AT+Command{=Param1{,Param2{,Param3…}}}<CR><LF>
Note:
– All commands start with “PÅ” and end with “<CR><LF>”
– “<CR>” represents the carriage return, corresponding to “HEX” som “0x0D”
– “<LF>” represents the line feed, corresponding to “HEX” som “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
Andre | Reserved for future use
The following are two examples of AT command execution results:
- Read the Bluetooth name of the module
<< AT+VER
>> +VER=FSC-BT1036-XXXX
>> OK
- Answer a call when there is no incoming call
<< AT+HFPANSW
>> ERR003
NESTE, let’s list some commonly used profiles as shown below:
– Spp (Seriell portprofil)
– GATTS (Generic Attribute Profile LE-Peripheral role)
– GATTC (Generic Attribute Profile LE-Central role)
– HFP-HF (Håndfri profil)
– HFP-AG (Hands-Free-AG Profile)
– A2DP-Sink (Avansert lyddistribusjonsprofil)
– A2DP-Source (Avansert lyddistribusjonsprofil)
– AVRCP-Controller (Audio/Video remote controller Profile)
– AVRCP-Target (Audio/Video remote controller Profile)
– HID-DEVICE (Human Interface Profile)
– Pbap (Phonebook Access Profile)
Endelig, 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 (Seriell portprofil)
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 (Avansert lyddistribusjonsprofil)
BIT[6] | A2DP Source (Avansert lyddistribusjonsprofil)
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)
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 -lydmodul 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 (Dvs., 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 (Dvs., 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)