次の方法で共有


BthNsLookupServiceBegin (Compact 2013)

3/26/2014

This function initiates a client query that is constrained by the information in a WSAQUERYSET structure.

Syntax

INT BthNsLookupServiceBegin(
  LPWSAQUERYSET pQuerySet,
  DWORD dwFlags,
  LPHANDLE lphLookup
);

Parameters

  • pQuerySet
    [in] Pointer to the search criteria.
  • dwFlags
    [in] The following table shows a list of flags for this parameter.

    Flag

    Description

    LUP_CONTAINERS

    Specifies that device discovery be performed. If this flag is not set, service discovery is performed instead.

    LUP_RES_SERVICE

    Searches the local Service Discovery Protocol (SDP) database. Clear this flag to search for services on a peer device.

  • lphLookup
    [out] Handle to use when calling the BthNsLookupServiceNext function to start retrieving the results set.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_SERVICE_NOT_ACTIVE

The Bluetooth stack is not present.

SOCKET_ERROR

The call to WSALookupServiceBegin failed.

Other standard HRESULT error codes may be returned as appropriate.

Remarks

This function returns a handle that the BthNsLookupServiceNext function uses.

Note   To preserve Win32 compatibility, consider using the Winsock equivalent of this function, WSALookupServiceBegin.

If LUP_CONTAINERS is set, the SDP performs a device inquiry to find other Bluetooth devices in the area. The BthNsLookupServiceBegin function performs the query. The BthNsLookupServiceNext function retrieves the results one device at a time.

You can specify extra parameters for device inquiries by having the pQuerySet.lpBlob point to a BTHNS_INQUIRYBLOB structure.

If LUP_CONTAINERS is not set, an SDP service search is performed. The pQuerySet.lpBlob must point to a BTHNS_RESTRICTIONBLOB data structure.

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Service Discovery Functions
BTHNS_INQUIRYBLOB
BTHNS_RESTRICTIONBLOB
BthNsLookupServiceEnd
BthNsLookupServiceNext
WSAQUERYSET (Bluetooth)