BluetoothManager.GetConnectionState(BluetoothDevice, ProfileType) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得遠端裝置設定檔目前的連線狀態。
[Android.Runtime.Register("getConnectionState", "(Landroid/bluetooth/BluetoothDevice;I)I", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public Android.Bluetooth.ProfileState GetConnectionState(Android.Bluetooth.BluetoothDevice? device, Android.Bluetooth.ProfileType profile);
[<Android.Runtime.Register("getConnectionState", "(Landroid/bluetooth/BluetoothDevice;I)I", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.GetConnectionState : Android.Bluetooth.BluetoothDevice * Android.Bluetooth.ProfileType -> Android.Bluetooth.ProfileState
參數
- device
- BluetoothDevice
遠端藍牙裝置。
- profile
- ProfileType
GATT 或 GATT_SERVER
傳回
檔案連線的狀態。 其中BluetoothProfile#STATE_CONNECTED一個、BluetoothProfile#STATE_CONNECTING、, BluetoothProfile#STATE_DISCONNECTEDBluetoothProfile#STATE_DISCONNECTING
- 屬性
備註
取得遠端裝置設定檔目前的連線狀態。
這並非特定於任何應用程式設定,而是代表本地藍牙介面卡在特定配置檔下的連線狀態。 這可以用來做像狀態列這類只想知道藍牙狀態的應用程式。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。