沒有可以使用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