没有可以使用BluetoothFindFirstRadio
,BluetoothFindNextRadio
和BluetoothGetRadioInfo
。适配器的本地MAC地址是然后在该字段的BLUETOOTH_RADIO_INFO
address
:
BLUETOOTH_FIND_RADIO_PARAMS btfrp;
btfrp.dwSize = sizeof(btfrp);
HANDLE hRadio;
HBLUETOOTH_RADIO_FIND hFind = BluetoothFindFirstRadio(&btfrp, &hRadio);
if(hFind == NULL)
{
DWORD err = GetLastError();
switch(err)
{
case ERROR_NO_MORE_ITEMS:
// No bluetooth radio found
break;
default:
// Error finding radios
}
return;
}
do
{
BLUETOOTH_RADIO_INFO radioInfo;
radioInfo.dwSize = sizeof(radioInfo);
DWORD err = BluetoothGetRadioInfo(hRadio, &radioInfo);
if(err != ERROR_SUCCESS)
{
// Error during BluetoothGetRadioInfo
continue;
}
// The mac address is in radioInfo.address
}
while(BluetoothFindNextRadio(hFind, &hRadio));
BluetoothFindRadioClose(hFind);
你要当一个蓝牙适配器插入机器检测? – 2012-08-14 07:33:03
你尝试过'WSAQUERYSET'和'NS_BTH'吗? – 2012-08-14 07:41:20
问题是我需要经典eth接口的HW地址,我需要从列表中删除所有其他接口。我可以通过WMI(Win32_NetworkAdapter和PhysicalAdapter)找出哪些接口是虚拟的(隧道等)。我也可以通过GetAdaptersAddresses找到什么是WiFi接口(因为WMI因为某些原因返回了以太网类型)。目前在我的列表中只有普通的以太网接口和蓝牙,我需要检测到“蓝牙是蓝牙”,而不是其他经典卡。 WSAQUERYSET听起来不错,我需要检查它是如何工作的,谢谢。 – Martin 2012-08-14 07:52:46