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 |
取得藍牙裝置識別碼。 |
| ClassOfDevice |
取得裝置的藍牙類別裝置資訊。 |
| ConnectionStatus |
取得裝置的線上狀態。 |
| DeviceAccessInformation |
裝置目前的 DeviceAccessInformation 物件。 用來檢查和監視裝置的存取變更。 |
| DeviceId |
取得來自 Windows.Devices.Enumeration.DeviceInformation.Id 的裝置識別碼 |
| DeviceInformation |
取得藍牙裝置的 DeviceInformation 物件。 |
| HostName |
取得裝置的 HostName。 |
| Name |
取得裝置的名稱。 |
| RfcommServices |
取得裝置所支援之 RFCOMM 服務的唯讀清單。 重要 RfcommServices API 已被取代,未來版本的 Windows 可能無法使用。 請改用 GetRfcommServicesAsync。 |
| SdpRecords |
取得裝置的服務探索通訊協定 (SDP) 記錄的唯讀清單。 |
| WasSecureConnectionUsedForPairing |
取得布林值,指出藍牙Device 是否使用安全連線配對。 |
方法
事件
| ConnectionStatusChanged |
發生于裝置的線上狀態已變更時。 |
| NameChanged |
發生于裝置的名稱已變更時。 |
| SdpRecordsChanged |
發生于裝置的清單 SDP 記錄已變更時。 |