Share via


BthSetCODInquiryFilter (Windows Embedded CE 6.0)

1/6/2010

This function sets the Inquiry Filter to a specified class of device (COD).

Syntax

int BthSetCODInquiryFilter (
  unsigned int cod,
  unsigned int codMask
);

Parameters

  • cod
    [in] An int value that indicates the Class of Device (COD) filter to be used in the inquiry filter. Potential values are defined in the Bluetooth Assigned Numbers document that is available on the Bluetooth web site.
  • codMask
    [in] An int value that defines the COD mask that specifies the “don’t care” bits from the cod parameter. Potential values are defined in the Bluetooth Assigned Numbers document that is available on the Bluetooth web site.

Return Values

This function returns ERROR_SUCCESS when it completes successfully.

A return value of ERROR_SERVICE_NOT_ACTIVE indicates that the hardware is not inserted or that the Bluetooth stack is not present.

Other standard error codes may be returned as appropriate.

Remarks

This function will send to the Bluetooth baseband a Bluetooth HCI command that sets the Bluetooth inquiry filter to only return devices that match the specified class of device. Future calls to make an inquiry will only return devices that match the inquiry filter, see BthPerformInquiry. Inquiry filters are combined if this API is called multiple times; see the Bluetooth HCI specification v1.2 available on the Bluetooth web site. According to this specification the number of filters that can be stored in the baseband is implementation dependent. If there is a contradiction between event filters the latest filter will override older ones. All this logic is handled in the baseband module and not in the software stack. The filter can be cleared by calling BthClearInquiryFilter. A similar and existing API is BthSetInquiryFilter which sets an inquiry filter based on the Bluetooth address.

Requirements

Header bt_api.h
Library Btdrt.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

Bluetooth OS Functions
BthClearInquiryFilter
BthWriteCOD

Other Resources

Bluetooth Application Development