BluetoothDevice 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public ref class BluetoothDevice sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BluetoothDevice final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class BluetoothDevice : System.IDisposable
Public NotInheritable Class BluetoothDevice
Implements IDisposable
- 继承
- 属性
- 实现
Windows 要求
| 设备系列 |
Windows 10 (在 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 中引入)
|
| API contract |
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)
|
| 应用功能 |
bluetooth
|
注解
版本历史记录
| Windows 版本 | SDK 版本 | 增值 |
|---|---|---|
| 1511 | 10586 | DeviceInformation |
| 1511 | 10586 | GetDeviceSelectorFromBluetoothAddress |
| 1511 | 10586 | GetDeviceSelectorFromClassOfDevice |
| 1511 | 10586 | GetDeviceSelectorFromConnectionStatus |
| 1511 | 10586 | GetDeviceSelectorFromDeviceName |
| 1511 | 10586 | GetDeviceSelectorFromPairingState |
| 1607 | 14393 | DeviceAccessInformation |
| 1607 | 14393 | GetRfcommServicesAsync |
| 1607 | 14393 | GetRfcommServicesAsync (BluetoothCacheMode) |
| 1607 | 14393 | GetRfcommServicesForIdAsync (RfcommServiceId) |
| 1607 | 14393 | GetRfcommServicesForIdAsync (RfcommServiceId,BluetoothCacheMode) |
| 1607 | 14393 | RequestAccessAsync |
| 1709 | 16299 | BluetoothDeviceId |
| 1803 | 17134 | WasSecureConnectionUsedForPairing |
属性
| BluetoothAddress |
获取设备地址。 |
| BluetoothDeviceId |
获取蓝牙设备 ID。 |
| ClassOfDevice |
获取设备的蓝牙设备类信息。 |
| ConnectionStatus |
获取设备的连接状态。 |
| DeviceAccessInformation |
设备的当前 DeviceAccessInformation 对象。 用于检查和监视对设备的访问更改。 |
| DeviceId |
获取来自 Windows.Devices.Enumeration.DeviceInformation.Id 的设备 ID |
| DeviceInformation |
获取蓝牙设备的 DeviceInformation 对象。 |
| HostName |
获取设备的 HostName。 |
| Name |
获取设备的名称。 |
| RfcommServices |
获取设备支持的 RFCOMM 服务的只读列表。 重要 RfcommServices API 已弃用,将来的 Windows 版本中可能不可用。 请改用 GetRfcommServicesAsync。 |
| SdpRecords |
获取设备的 SDP) 记录 (服务发现协议的只读列表。 |
| WasSecureConnectionUsedForPairing |
获取一个布尔值,该值指示 BluetoothDevice 是否使用安全连接进行配对。 |
方法
事件
| ConnectionStatusChanged |
当设备的连接状态发生更改时发生。 |
| NameChanged |
在设备名称更改时发生。 |
| SdpRecordsChanged |
当设备的 SDP 记录列表已更改时发生。 |