BluetoothFindFirstRadio function
The BluetoothFindFirstRadio function begins the enumeration of local Bluetooth radios.
Syntax
HBLUETOOTH_RADIO_FIND BluetoothFindFirstRadio( BLUETOOTH_FIND_RADIO_PARAMS *pbtfrp, __out HANDLE *phRadio );
Parameters
- pbtfrp
-
Pointer to a BLUETOOTH_FIND_RADIO_PARAMS structure. The dwSize member of the BLUETOOTH_FIND_RADIO_PARAMS structure pointed to by pbtfrp must match the size of the structure.
- phRadio [out]
-
Pointer to where the first enumerated radio handle will be returned. When no longer needed, this handle must be closed via CloseHandle.
Return value
In addition to the handle indicated by phRadio, calling this function will also create a HBLUETOOTH_RADIO_FIND handle for use with the BluetoothFindNextRadio function. When this handle is no longer needed, it must be closed via the BluetoothFindRadioClose.
Returns NULL upon failure. Call the GetLastError function for more information on the error. The following table describe common errors:
| Return code | Description |
|---|---|
|
No Bluetooth radios found. |
|
The pbtfrp parameter is NULL. |
|
The structure pointed to by pbtfrp is not the correct size. |
|
Out of memory. |
Requirements
|
Minimum supported client | Windows Vista, Windows XP with SP2 |
|---|---|
|
Minimum supported server | None supported |
|
Header |
|
|
Library |
|
See also
- BluetoothFindNextRadio
- BluetoothFindRadioClose
- BluetoothGetRadioInfo
- GetLastError
- BLUETOOTH_FIND_RADIO_PARAMS
Send comments about this topic to Microsoft
Build date: 9/6/2011
"Radio" means Bluetooth adapter, or Bluetooth dongle. It will either be an internal Bluetooth adapter in a laptop, or a USB Bluetooth adapter. USB Vuetooth adapters are the cheap alternative.
This function will only find Bluetooth adapters that use the Microsoft Bluetooth stack. It will not work with adapters using the BlueSoleil, or Widcomm stacks. You need to download seperate BlueSoleil and Widcomm SDKs to find those Bluetooth adapters.
There is an incorrect tutorial which mentions this function on CodeProject:
http://www.codeproject.com/KB/winsdk/BluetoothAPI__Device_Enum.aspx
Its use of BluetoothFindFirstRadio is wrong and will loop forever.
- 5/1/2008
- Carl Kenner
- 7/21/2008
- Stanley Roark
