Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BluetoothSetServiceState function

The BluetoothSetServiceState function enables or disables services for a Bluetooth device.

Syntax


DWORD BluetoothSetServiceState(
  HANDLE hRadio,
  BLUETOOTH_DEVICE_INFO *pbtdi,
  GUID *pGuidService,
  DWORD dwServiceFlags
);

Parameters

hRadio

A handle of the local Bluetooth radio.

pbtdi

A pointer to a BLUETOOTH_DEVICE_INFO structure. Must be a previously found radio address.

pGuidService

A pointer to the service GUID on the remote device.

dwServiceFlags

The flags that adjust the service. To disable the service, set to BLUETOOTH_SERVICE_DISABLE; to enable the service, set to BLUETOOTH_SERVICE_ENABLE.

Return value

Returns ERROR_SUCCESS upon successful completion. The following table lists common errors.

Return codeDescription
ERROR_INVALID_PARAMETER

The dwServiceFlags are not valid.

ERROR_SERVICE_DOES_NOT_EXIST

The GUID specified in pGuidService is not supported.

E_INVALIDARG

dwServiceFlags is set to BLUETOOTH_SERVICE_DISABLE and the service is already disabled, or dwServiceFlags is set to BLUETOOTH_SERVICE_ENABLE and the service is already enabled.

 

Remarks

Windows maintains a mapping of service Globally Unique Identifiers (GUIDs) to supported drivers for Bluetooth-enabled devices. Enabling a service installs the corresponding device driver and disabling a service removes the corresponding device driver. If a non-supported service is enabled, a driver is not installed.

Requirements

Minimum supported client

Windows Vista, Windows XP with SP2 [desktop apps only]

Minimum supported server

None supported

Header

BluetoothAPIs.h (include Bthsdpdef.h or BluetoothAPIs.h)

Library

Bthprops.lib

DLL

Bthprops.dll

See also

BluetoothDisplayDeviceProperties
BluetoothFindDeviceClose
BluetoothFindFirstDevice
BluetoothFindNextDevice
BluetoothGetDeviceInfo
BluetoothRemoveDevice
BLUETOOTH_DEVICE_INFO
BLUETOOTH_DEVICE_SEARCH_PARAMS

 

 

Community Additions

Show:
© 2014 Microsoft