วิธีกำหนดค่าโปรไฟล์ของโมดูลเสียงบลูทู ธ FeasyCom โดยคำสั่ง AT AT?
ความไม่แน่นอน’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. ดังนั้น, ความไม่แน่นอน 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 ความไม่แน่นอน เสียงบลูทู ธ โมดูล.
อันดับแรก, 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 บลูทู ธ 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 (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)
ในที่สุด, 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] | คัท Server (Generic Attribute Profile)
BIT[2] | คัท 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)
Response | +PROFILE=Param
บันทึก | The following profiles cannot be enabled simultaneously via AT commands:
– คัท 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 โมดูลเสียงบลูทู ธ 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)