BluetoothGattServer.Connect(BluetoothDevice, Boolean) 메서드

정의

Bluetooth GATT 지원 디바이스에 대한 연결을 시작합니다.

[Android.Runtime.Register("connect", "(Landroid/bluetooth/BluetoothDevice;Z)Z", "")]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool Connect(Android.Bluetooth.BluetoothDevice? device, bool autoConnect);
[<Android.Runtime.Register("connect", "(Landroid/bluetooth/BluetoothDevice;Z)Z", "")>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.Connect : Android.Bluetooth.BluetoothDevice * bool -> bool

매개 변수

autoConnect
Boolean

원격 디바이스에 직접 연결할지(false) 또는 원격 디바이스를 사용할 수 있게 되는 즉시 자동으로 연결할지 여부(true).

반품

연결 시도가 성공적으로 시작된 경우 true입니다.

특성

설명

Bluetooth GATT 지원 디바이스에 대한 연결을 시작합니다.

연결은 즉시 설정되지 않을 수 있지만 원격 디바이스를 사용할 수 있을 때 완료됩니다. BluetoothGattServerCallback#onConnectionStateChange 이 함수의 결과로 연결 상태가 변경되면 콜백이 호출됩니다.

autoConnect 매개 변수는 원격 디바이스에 적극적으로 연결할지, 아니면 원격 디바이스가 범위/사용 가능한 경우 연결을 수동으로 검색하고 마무리할지를 결정합니다. 일반적으로 디바이스에 대한 첫 번째 연결은 직접 연결(자동 연결이 false로 설정됨)이어야 하며, 알려진 디바이스에 대한 후속 연결은 autoConnect 매개 변수를 true로 설정하여 호출해야 합니다.

에 대한 android.bluetooth.BluetoothGattServer.connect(android.bluetooth.BluetoothDevice, boolean)Java 설명서

이 페이지의 일부는 만들고 공유한 작업을 기반으로 하며 에 설명된 조건에 따라 사용됩니다.

적용 대상