Development Examples
Profile Initialization
Module Profile initialization, response event examples are as follows:
Parameter Modification
Modify Bluetooth Name
Modify Name. Examples of AT command operations and response events are as follows:
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
}
}
}
}
}
Audio Source Mode
Search for Bluetooth headsets
Connect the main Bluetooth headset
Connect the secondary Bluetooth headset
Audio Routing Management
Transmit audio to the main and secondary Bluetooth headsets via the A2DP
Transmit audio to the main Bluetooth headset via the HFP
Turn off audio routing
Disconnect
Two headsets have been connected,disconnect the main Bluetooth headset.
Two headsets have been connected,disconnect the secondary Bluetooth headset.