Share via


BluetoothLEDevice クラス

定義

Bluetooth LE デバイスを表します。

コード例については、「 Bluetooth Low Energy サンプル 」と「 デバイスの列挙とペアリングのサンプル」を参照してください。

public ref class BluetoothLEDevice 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 BluetoothLEDevice 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 BluetoothLEDevice : System.IDisposable
Public NotInheritable Class BluetoothLEDevice
Implements IDisposable
継承
Object Platform::Object IInspectable BluetoothLEDevice
属性
実装

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 外観
1511 10586 BluetoothAddressType
1511 10586 DeviceInformation
1511 10586 From BluetoothAddressAsync(UInt64,BluetoothAddressType)
1511 10586 GetDeviceSelectorFromAppearance
1511 10586 GetDeviceSelectorFrom BluetoothAddress(UInt64)
1511 10586 GetDeviceSelectorFrom BluetoothAddress(UInt64,BluetoothAddressType)
1511 10586 GetDeviceSelectorFromConnectionStatus
1511 10586 GetDeviceSelectorFromDeviceName
1511 10586 GetDeviceSelectorFromPairingState
1703 15063 DeviceAccessInformation
1703 15063 GetGattServicesAsync
1703 15063 GetGattServicesAsync(BluetoothCacheMode)
1703 15063 GetGattServicesForUuidAsync(Guid)
1703 15063 GetGattServicesForUuidAsync(Guid,BluetoothCacheMode)
1703 15063 RequestAccessAsync
1709 16299 BluetoothDeviceId
1803 17134 WasSecureConnectionUsedForPairing

プロパティ

Appearance

Bluetooth LE デバイスの BluetoothLEAppearance オブジェクトを取得します。

BluetoothAddress

デバイス アドレスを取得します。

BluetoothAddressType

Bluetooth LE デバイスのアドレスの種類を取得します。

BluetoothDeviceId

bluetooth デバイス ID を取得します。

ConnectionStatus

デバイスの接続状態を取得します。

DeviceAccessInformation

DeviceAccessInformation を取得します。

DeviceId

デバイス ID を取得します。

DeviceInformation

Bluetooth LE デバイスのデバイス情報を取得します。

GattServices

デバイスでサポートされている GATT サービスの読み取り専用リストを取得します。

重要

GattServices API は非推奨であり、今後のバージョンの Windows では使用できない可能性があります。 代わりに、 GetGattServicesAsync を使用します

Name

Bluetooth LE デバイスの名前を取得します。

WasSecureConnectionUsedForPairing

BluetoothLEDevice がセキュア接続を使用してペアになったかどうかを示すブール値を取得します。

メソッド

Close()

この Bluetooth LE デバイスを閉じます。 これは、接続を持つ唯一のアプリである場合、デバイスへの接続を閉じる可能性があります。

Dispose()

アンマネージ リソースの解放またはリセットに関連付けられているアプリケーション定義のタスクを実行します。

FromBluetoothAddressAsync(UInt64)

指定されたアドレスを持つピア Bluetooth LE デバイスを表す BluetoothLEDevice オブジェクトを返します。 「 解説」を 参照してください (このメンバー トピック内)。

FromBluetoothAddressAsync(UInt64, BluetoothAddressType)

指定されたアドレスとアドレスの種類を持つピア デバイスを表す BluetoothLEDevice オブジェクトを返します。 「 解説」を 参照してください (このメンバー トピック内)。

FromIdAsync(String)

指定された ID の BluetoothLEDevice オブジェクトを返します。「メンバー 」トピックの「解説 」を参照してください。

GetConnectionParameters()

リモート デバイスの接続パラメーターを取得します。 複数のアプリまたはその他のシステム シナリオでもこれらのパラメーターを要求する場合、システムは、システムの優先順位に基づいて、互換性のあるパラメーターを自動的に結合します。

注意

デバイスが接続されていない場合、接続パラメーターは無効です (ゼロすべて)。

GetConnectionPhy()

Bluetooth LE 物理レイヤー (PHY) に関する情報を取得します。

注意

デバイスが接続されていない場合、接続 PHY は無効です (すべて false)

GetDeviceSelector()

すべての Bluetooth Low Energy (LE) デバイスを識別するための高度なクエリ構文 (AQS) 文字列を取得します。 この文字列は、Bluetooth LE デバイスの一覧を取得するために FindAllAsync メソッドまたは CreateWatcher メソッドに渡されます。

GetDeviceSelectorFromAppearance(BluetoothLEAppearance)

BluetoothLEAppearance オブジェクトから高度なクエリ構文 (AQS) フィルター文字列を作成します。 AQS 文字列は CreateWatcher メソッドに渡され、指定した外観の DeviceInformation オブジェクトのコレクションを返します。

GetDeviceSelectorFromBluetoothAddress(UInt64)

Bluetooth LE デバイスを表す 64 ビット アドレスから高度なクエリ構文 (AQS) フィルター文字列を作成します。 AQS 文字列は CreateWatcher メソッドに渡され、 DeviceInformation オブジェクトのコレクションを返します。

GetDeviceSelectorFromBluetoothAddress(UInt64, BluetoothAddressType)

Bluetooth LE デバイスを表す 64 ビットのアドレスとアドレスの種類から高度なクエリ構文 (AQS) フィルター文字列を作成します。 AQS 文字列は CreateWatcher メソッドに渡されます。

GetDeviceSelectorFromConnectionStatus(BluetoothConnectionStatus)

指定された BluetoothConnectionStatus を使用して、Bluetooth LE デバイスのクエリを含む高度なクエリ構文 (AQS) フィルター文字列を作成します。 AQS 文字列は CreateWatcher メソッドに渡され、指定された Bluetooth 接続状態を持つ DeviceInformation オブジェクトのコレクションを返します。

GetDeviceSelectorFromDeviceName(String)

Bluetooth LE デバイス名のクエリを含む高度なクエリ構文 (AQS) フィルター文字列を作成します。 AQS 文字列は CreateWatcher メソッドに渡され、指定された Bluetooth LE デバイス名を含む DeviceInformation オブジェクトのコレクションを返します。

GetDeviceSelectorFromPairingState(Boolean)

ペアになっているかペアになっていない Bluetooth LE デバイスのクエリを含む高度なクエリ構文 (AQS) フィルター文字列を作成します。 AQS 文字列は CreateWatcher メソッドに渡され、 DeviceInformation オブジェクトのコレクションを返します。

GetGattService(Guid)

指定されたサービス ID を持つ GATT サービスを返します。

重要

GetGattService API は非推奨であり、今後のバージョンの Windows では使用できない可能性があります。 代わりに、 GetGattServicesAsync を使用します

GetGattServicesAsync()

この Bluetooth LowEnergy デバイスの GattDeviceServices を取得します。

GetGattServicesAsync(BluetoothCacheMode)

指定したキャッシュ モードのこの Bluetooth LowEnergy デバイスの GattDeviceServices を返します。

GetGattServicesForUuidAsync(Guid)

指定した UUID を持つ Bluetooth LowEnergy デバイスの GattDeviceServices を返します。

GetGattServicesForUuidAsync(Guid, BluetoothCacheMode)

指定した UUID を持つ Bluetooth LowEnergy デバイスの GattDeviceServices を返します。

RequestAccessAsync()

Bluetooth LowEnergy デバイスへのアクセスを要求します。

RequestPreferredConnectionParameters(BluetoothLEPreferredConnectionParameters)

指定した Bluetooth LE 優先接続パラメーター オブジェクトの Bluetooth LE 優先接続パラメーター要求オブジェクトを取得します。

イベント

ConnectionParametersChanged

デバイスの現在の接続パラメーターが変更されたときに発生するイベント。 パラメーターは、デバイスへの接続が確立された後にのみ更新されます。

ConnectionPhyChanged

デバイスの現在の PHY が変更されたときに発生するイベント。 PHY は、デバイスへの接続が確立された後にのみ更新されます。

ConnectionStatusChanged

デバイスの接続状態が変更されたときに発生します。

GattServicesChanged

デバイスでサポートされている GATT サービスの一覧が変更されたときに発生します。

NameChanged

デバイスの名前が変更されたときに発生します。

適用対象

こちらもご覧ください