語言

BluetoothManager.GetDevicesMatchingConnectionStates 方法

定義

取得符合任一連線狀態的裝置清單。

[Android.Runtime.Register("getDevicesMatchingConnectionStates", "(I[I)Ljava/util/List;", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public System.Collections.Generic.IList<Android.Bluetooth.BluetoothDevice>? GetDevicesMatchingConnectionStates(Android.Bluetooth.ProfileType profile, int[]? states);
[<Android.Runtime.Register("getDevicesMatchingConnectionStates", "(I[I)Ljava/util/List;", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.GetDevicesMatchingConnectionStates : Android.Bluetooth.ProfileType * int[] -> System.Collections.Generic.IList<Android.Bluetooth.BluetoothDevice>

參數

profile
ProfileType

GATT 或 GATT_SERVER

states
Int32[]

各種狀態。 狀態可以是 BluetoothProfile#STATE_CONNECTED、 BluetoothProfile#STATE_CONNECTING、 BluetoothProfile#STATE_DISCONNECTEDBluetoothProfile#STATE_DISCONNECTING, , 之一。

傳回

裝置清單。 錯誤時清單會是空的。

屬性

備註

取得符合任一連線狀態的裝置清單。

若沒有任何裝置符合任何給定狀態,則會回傳一個空清單。

這並非特定於任何應用程式設定,而是代表本機藍牙介面卡的連線狀態。 這可以被像狀態欄這類只想知道本地介面卡狀態的應用程式使用。

Java 文件 android.bluetooth.BluetoothManager.getDevicesMatchingConnectionStates(int, int[])。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於