PFN_DEVICE_CALLBACK callback function (bluetoothapis.h)

The PFN_DEVICE_CALLBACK function is a callback prototype used in association with selecting Bluetooth devices. The PFN_DEVICE_CALLBACK function can be set to NULL if no specialized filtering is required.

Syntax

PFN_DEVICE_CALLBACK PfnDeviceCallback;

BOOL PfnDeviceCallback(
  LPVOID pvParam,
  const BLUETOOTH_DEVICE_INFO *pDevice
)
{...}

Parameters

pvParam

A parameter passed in from the pvParam member of the BLUETOOTH_SELECT_DEVICE_PARAMS structure through the BluetoothSelectDevices function.

pDevice

Remote Bluetooth address queried; this is the address inserted into the user-presented list of Bluetooth devices.

Return value

Returning FALSE prevents the device from being added to the list view of Bluetooth devices.

Remarks

The BLUETOOTH_DEVICE_INFO structure pointed to in pDevice is the device that the BluetoothSelectDevices function is querying to determine if that device should be added to the list view.

If the callback performs SDP queries for each device, the list of devices from which the user can choose will be delayed until all devices can be queried. A recommended approach is to use the service to call bitfield in the class of device, available through GET_COD_SERVICE, to determine whether the device should be displayed to the user. The service class bitfield is available in the pDevice parameter through the ulClassOfDevice member.

Requirements

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)

See also

BLUETOOTH_DEVICE_INFO

BLUETOOTH_SELECT_DEVICE_PARAMS

BluetoothSelectDevices