如果服务器想获得其他设备与自己的连接情况,可以使用BthGetBasebandConnections接口,第一个参数入力参数,第二个和第三个参数为出力参数,连接的设备信息和连接数目。
BASEBAND_CONNECTION connections[1] = {0};
int cConnectionsIn = 1;
int cConnectionsOut = 0;
/* Wait connected by bluetooth sender */
BASEBAND_CONNECTION* pConnections = connections;
int iErr = 0;
do
{
<span style="white-space:pre"> </span>iErr = BthGetBasebandConnections(cConnectionsIn, pConnections, &cConnectionsOut);
if ( cConnectionsOut > 0 )
{
<span style="white-space:pre"> </span>break;
}
else
{
Sleep(500);
}
} while ( TRUE );