AT 명령에 의해 Feasycom Bluetooth 오디오 모듈의 프로필을 구성하는 방법?
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. 그러므로, Feasycom provides a set of AT commands with a specific format to facilitate developers in configuring profiles anytime, 어딘가에. This article will introduce how to use these AT commands to developers using Feasycom Bluetooth Audio modules.
첫 번째, the format of Feasycom’s AT commands is as follows:
AT+Command{=Param1{,Param2{,Param3…}}}<CR><LF>
메모:
– All commands start with “에” 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
기타 | 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
다음, let’s list some commonly used profiles as shown below:
– spp (직렬 포트 프로파일)
– GATTS (Generic Attribute Profile LE-Peripheral role)
– GATTC (Generic Attribute Profile LE-Central role)
– HFP-HF (핸즈프리 프로필)
– HFP-AG (Hands-Free-AG Profile)
– A2DP-Sink (고급 오디오 배포 프로파일)
– A2DP-Source (고급 오디오 배포 프로파일)
– AVRCP-Controller (Audio/Video remote controller Profile)
– AVRCP-Target (Audio/Video remote controller Profile)
– HID-DEVICE (Human Interface Profile)
– PBAP (Phonebook Access Profile)
마지막으로, 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 (직렬 포트 프로파일)
BIT[1] | GATT Server (Generic Attribute Profile)
BIT[2] | 가트 클라이언트 (Generic Attribute Profile)
BIT[3] | HFP-HF (Hands-Free Profile Handsfree)
BIT[4] | HFP-AG (Hands-Free Profile Audio Gateway)
BIT[5] | A2DP Sink (고급 오디오 배포 프로파일)
BIT[6] | A2DP Source (고급 오디오 배포 프로파일)
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
메모 | 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 (즉., 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 (즉., 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)