Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The BluetoothFindFirstDevice function begins the enumeration Bluetooth devices.
HBLUETOOTH_DEVICE_FIND BluetoothFindFirstDevice(
const BLUETOOTH_DEVICE_SEARCH_PARAMS *pbtsp,
BLUETOOTH_DEVICE_INFO *pbtdi
);
pbtsp
Pointer to a BLUETOOTH_DEVICE_SEARCH_PARAMS structure. The dwSize member of the BLUETOOTH_DEVICE_SEARCH_PARAMS structure pointed to by pbtsp must match the size of the structure.
pbtdi
Pointer to a BLUETOOTH_DEVICE_INFO structure into which information about the first Bluetooth device found is placed. The dwSize member of the BLUETOOTH_DEVICE_INFO structure pointed to by pbtdi must match the size of the structure, or the call to the BluetoothFindFirstDevice function fails.
Returns a valid handle to the first Bluetooth device upon successful completion, and the pbtdi parameter points to information about the device. When this handle is no longer needed, it must be closed via the BluetoothFindDeviceClose.
Returns NULL upon failure. Call the GetLastError function for more information on the error. The following table describe common errors:
Return code | Description |
---|---|
|
The pbtsp or pbtdi parameter is NULL. |
|
The structure pointed to by pbtsp or pbtdi is not the correct size. |
The BluetoothFindFirstDevice function does not find Bluetooth Low Energy (LE) devices. To access Bluetooth LE devices, use the Windows Runtime Bluetooth Low Energy APIs. The Windows Runtime APIs for Bluetooth work in both UWP and classic desktop apps.
Requirement | Value |
---|---|
Minimum supported client | Windows Vista, Windows XP with SP2 [desktop apps only] |
Minimum supported server | None supported |
Target Platform | Windows |
Header | bluetoothapis.h (include Bthsdpdef.h, BluetoothAPIs.h) |
Library | Bthprops.lib |
DLL | bthprops.cpl |
BLUETOOTH_DEVICE_SEARCH_PARAMS
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today