BluetoothSetServiceState 函数

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

参数:
hRadio

A handle of the local Bluetooth radio.  本地蓝牙无线电的句柄。

pbtdi

A pointer to a BLUETOOTH_DEVICE_INFO structure. Must be a previously found radio address. 指向BLUETOOTH_DEVICE_INFO结构的指针。必须是以前找到的无线电地址。

pGuidService

A pointer to the service GUID on the remote device. 指向远程设备上的服务GUID的指针

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.

调整服务的标志。要禁用服务,设置为BLUETOOTH_SERVICE_DISABLE;要启用该服务,请将其设置为BLUETOOTH_SERVICE_ENABLE。

返回值:

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

成功完成后返回ERROR_SUCCESS。下表列出了常见的错误。

Return codeDescription

ERROR_INVALID_PARAMETER

The dwServiceFlags are not valid.      dwServiceFlags无效。

ERROR_SERVICE_DOES_NOT_EXIST

The GUID specified in pGuidService is not supported.   不支持pGuidService中指定的GUID

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.

dwServiceFlags设置为BLUETOOTH_SERVICE_DISABLE,服务已经禁用,或者dwServiceFlags设置为BLUETOOTH_SERVICE_ENABLE,服务已经启用

 

Windows维护了服务全局惟一标识符(GUIDs)到支持蓝牙设备的驱动程序的映射。启用服务将安装相应的设备驱动程序,禁用服务将删除相应的设备驱动程序。如果启用了不支持的服务,则不会安装驱动程序。

Header

Declared in BluetoothAPIs.h; include Bthsdpdef.h and BluetoothAPIs.h.

Library

Use Bthprops.lib.

转载于:https://www.cnblogs.com/qiwu1314/p/9981445.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值