Bluetooth and WSAQUERYSET for Service Inquiry
Bluetooth uses the WSAQUERYSET structure, with various functions, to facilitate the discovery of devices and services in the Bluetooth namespace, NS_BTH.
The WSALookupServiceBegin and WSALookupServiceNext functions use the WSAQUERYSET structure to obtain data about the service inquiry process. The following table describes how to set the member values in the WSAQUERYSET structure for this purpose.
Member | Input to WSALookupServiceBegin | Returned value from WSALookupServiceNext |
---|---|---|
dwSize | Must be set to sizeof(WSAQUERYSET). | sizeof(WSAQUERYSET) returned by system. |
dwOutputFlags | Not used. | Not used. |
lpszServiceInstanceName | Not used. | Display name of the service, converted as a UTF-8 encoded string from the default language encoding of the Bluetooth ServiceName SDP attribute. Returned if LUP_RETURN_NAME is specified. |
lpServiceClassId | Required. The most specific single Bluetooth UUID for the services for which the search is being conducted. For example, if this value is set to the UUID of the L2CAP protocol, it returns all services using the L2CAP protocol on the target device. If set to the UUID of a specific service, it would return only the instances of that service. | Not used. |
lpVersion | Not used. | Not used. |
lpszComment | Not used. | Description of the service, converted as a UTF-8 encoded string from the default language encoding of the Bluetooth ServiceDescription SDP attribute. Returned if LUP_RETURN_COMMENT is specified. |
dwNameSpace | Must be NS_BTH. | Returns NS_BTH. |
lpNSProviderId | Not used. | Not used. |
lpszContext | Required. The Bluetooth Device Address with which to establish an SDP connection and query for services. This value must be a string that was converted by using the WSAAddressToString function call. If the local Bluetooth device address is provided, the local SDP database is searched. | Not used. |
dwNumberOfProtocols | Not used. | Not used. |
lpafpProtocols | Not used. | Not used. |
lpszQueryString | Not used. | Not used. |
dwNumberOfCsAddrs | Not used. | Indicates the number of elements in the array of CSADDR_INFO structures. |
lpcsaBuffer | Not used. | Pointer to a CSADDR_INFO structure whose LocalAddr.lpSockaddr member points to a SOCKADDR_BTH that contains the complete connectable address of the remote service, converted from the first entry of the Bluetooth ProtocolDescriptorList SDP attribute. Returned if LUP_RETURN_ADDR is specified. |
lpBlob | Optional. Pointer to a BTH_QUERY_SERVICE structure that contains advanced parameters to limit the results of the search. If provided, lpServiceClassId is ignored and cached queries do not succeed. |
|
Related topics
-
Bluetooth and WSALookupServiceNext