adk\src\domains\bt\bt_device\bt_device.c
adk\src\domains\bt\bt_device\bt_device.h
判定蓝牙不同连接的api,可以根据这些api去完成一些特定的项目需求。
bool appDeviceIsBredrHandsetConnected(void)
{
return btDevice_IsHandsetConnected(btDevice_IsDeviceConnectedOverBredr);
}
bool appDeviceIsLeHandsetConnected(void)
{
return btDevice_IsHandsetConnected(btDevice_IsDeviceConnectedOverLe);
}
bool appDeviceIsHandsetConnected(void)
{
return btDevice_IsHandsetConnected(btDevice_IsDeviceConnectedOverBredrOrLe);
}
其他api接口可以自行查看这个文件下的相关函数。
比如是否是主耳从耳,从耳是否连接,a2dp,avrcp等状态获取
bool appDeviceIsHandsetA2dpDisconnected(void)
{
bool is_disconnected = TRUE;
avInstanceTaskData *inst = btDevice_GetAvInstanceForHandset();
if (inst)
{
if (!appA2dpIsDisconnected(inst))
is_disconnected = FALSE;
}
return is_disconnected;
}
bool appDeviceIsHandsetA2dpConnected(void)
{
bool