Development Examples
Profile Initialization
Module Profile initialization, response event examples are as follows:
Parameter Modification
Modify Bluetooth Name
Before the MCU modifies any parameters, it is recommended to first query, then modify, and finally verify. For the MCU to modify the device name to CARKIT, the reference code example is as follows:
void change_name(void)
{
uart_send("AT+NAME\r\n");
if(uart_read("+NAME",name_buf))
{
if(memcmp(name_buf,"CARKIT",6))
{
uart_send("AT+NAME=CARKIT,0\r\n"); //defalut disable MAC address suffix
uart_send("AT+NAME\r\n"); // read bt name
if(uart_read("+NAME",name_buf))
{
if(memcmp(name_buf,"CARKIT",6))
{
//change name fail
}
else
{
//change name success
}
}
}
}
}
Auido Sink Mode Application
Profile Connection
Play and Pause Music
Take and Hang up Call
Phonebook Download
Application Process Operation Examples:
HFP connection has been established
Response: <<+PWRSTAT=1
Response: <<+VER=FSC-BT1026C,V4.9.4,20230428 // Example, please refer to the actual version
Response: <<+PROFILE=1195 // General default, enable SPP, GATT Server, HFP-HF, A2DP Sink, AVRCP Controller, PBAP Server profiles
Response: <<+SPPSTAT=1
Response: <<+GATTSTAT=1
Response: <<+A2DPSTAT=1
Response: <<+AVRCPSTAT=1
Response: <<+HFPSTAT=1
Response: <<+AVRCPSTAT=1
Response: <<+PBSTAT=1
Response: <<+DEVSTAT=1
Response: <<+DEVSTAT=7 // Enables device discoverability; mobile phones can find this Bluetooth device and establish a connection
Download all phonebooks
Send :>>AT+PBDOWN=1
Response: <<OK
Response: <<+PBSTAT=2
Response: <<+PBSTAT=3 // PBAP connected
Response: <<+PBSTAT=4 // PBAP downloading
Response: <<+PBDATA=1<FF>Local Number<FF>+8618620277272
Response: <<+PBDATA=1<FF>Zhang San<FF>0571-85592192
...
Response: <<+PBDATA=1<FF>Jerry<FF>18909731215
Response: <<+PBDATA=E // Download completed
Response: <<+PBSTAT=3
Download 50 call records
Send: >>AT+PBWODN=5,50
Response: <<ok
Response: <<+PBDATA=3<FF>yidong<FF>+10086<FF>20200213T114247
...
Response: <<+PBDATA=2<FF>andy<FF>85592192<FF>20200212T104202
Response: <<+PBDATA=E // Download completed
Response: <<+PBSTAT=3