/*!
@brief This function is called to read the remote name of the device with
the specified Bluetooth device address.
@param theAppTask The client task.
@param bd_addr The Bluetooth address of the remote device.
A CL_DM_REMOTE_NAME_COMPLETE message will be sent to the initiating task on
completion of the request.
*/
void ConnectionReadRemoteName(Task theAppTask, const bdaddr *bd_addr);
case HFP_SLC_CONNECT_CFM:
{
const HFP_SLC_CONNECT_CFM_T *conncfm = (const HFP_SLC_CONNECT_CFM_T *)message;
ConnectionReadRemoteName(&theSink.task,&(conncfm->bd_addr)); /* 获取远端蓝牙名称 */
MAIN_DEBUG_L1(("HFP_SLC_CONNECT_CFM [%x]\n", conncfm->status ));
if (stateManagerGetState() == deviceLimbo)
{
if ( conncfm->status == hfp_success )
{
/*A connection has been made and we are now logically off*/
sinkDisconnectAllSlc();
}
}
else
{
sinkHandleSlcConnectCfm(conncfm);
#ifdef ENABLE_PEER
if(!peerLinkReservedCanDeviceConnect(&conncfm->bd_addr))
{ /* Another link is reserved for a peer device to connect, disconnect the second AG.*/
sinkDisconnectSlcFromDevice(&conncfm->bd_addr);
}
#endif
}
}
break;
2.收到CL_DM_REMOTE_NAME_COMPLETE 事件后,解析远端蓝牙名称
case CL_DM_REMOTE_NAME_COMPLETE:
/* 获取远端蓝牙名称 */
MAIN_DEBUG_L1(("remote name = %s\n",((CL_DM_REMOTE_NAME_COMPLETE_T *)message)->remote_name));
break;