次の方法で共有


BthWriteCOD (Compact 2013)

3/26/2014

This function sets the class of device (COD) for the controller.

Syntax

int BthWriteCOD(
  unsigned int cod
);

Parameters

  • cod
    [in] COD for the adapter. Potential values are defined in the Bluetooth Assigned Numbers specifications on the Bluetooth web site.

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.

Other standard HRESULT error codes may be returned as appropriate.

Remarks

The COD is not persistent. It reverts to the default setting when the controller is reinitialized; for example, when the controller is reinserted or the device is powered down.

For more information, see "Write Class of Device" in the Core Specification v2.1 + EDR on the Bluetooth web site.

Note

To preserve Microsoft Win32 compatibility, consider using the Winsock equivalent of this function. To do so, set the optname parameter in the setsockopt function to SO_BTH_SET_COD.

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Management Functions
Bluetooth AG Service Functions
BthReadCOD