BTH_HCI_IOCTL_GET_HANDLE_FOR_BD

This IOCTL retrieves the connection handle for a Bluetooth device if it is connected.

Parameters

  • hDeviceContext
    [in] Device context handle.

  • fSelector
    [in] Equals BTH_HCI_IOCTL_GET_HANDLE_FOR_BD.

  • cInBuffer
    [in] Equals sizeof(BD_ADDR)+1.

  • pInBuffer
    [in] Must be an aligned pointer to the BD_ADDR structure followed by the 0-based order number — 1 byte — of the handle to retrieve. The order number allows you to enumerate all connection handles for the peer represented by the Bluetooth address, including SCO connections. To perform this enumeration, call the IOCTL with the order number starting at 0, and then increase it by 1 until an error is returned.

  • cOutBuffer
    [in] Equals 2.

  • pOutBuffer
    [in] Must be an aligned pointer to an unsigned short handle.

    [out] Contains the connection handle.

  • pcDataReturned
    [out] Equals cOutBuffer.

Return Values

If the call succeeds, the return value is ERROR_SUCCESS.

If the function fails, the following table shows a list of possible error values.

Error value Description
ERROR_NOT_FOUND Devices are not connected.
ERROR_INVALID_PARAMETER Parameters are invalid (buffers are not properly sized).
ERROR_SERVICE_NOT_ACTIVE HCI is not active or there is no hardware.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Bt_ddi.h.

See Also

BD_ADDR

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.