BluetoothDevice.CreateUsingSocketSettings(BluetoothSocketSettings) Método

Definición

Crea un socket de cliente para conectarse a un servidor Bluetooth remoto con la configuración BluetoothSocketSettings de socket especificada Esta API se usa para conectarse a un servidor remoto hospedado mediante BluetoothAdapter#listenUsingSocketSettings.

[Android.Runtime.Register("createUsingSocketSettings", "(Landroid/bluetooth/BluetoothSocketSettings;)Landroid/bluetooth/BluetoothSocket;", "", ApiSince=36)]
public Android.Bluetooth.BluetoothSocket CreateUsingSocketSettings(Android.Bluetooth.BluetoothSocketSettings settings);
[<Android.Runtime.Register("createUsingSocketSettings", "(Landroid/bluetooth/BluetoothSocketSettings;)Landroid/bluetooth/BluetoothSocket;", "", ApiSince=36)>]
member this.CreateUsingSocketSettings : Android.Bluetooth.BluetoothSocketSettings -> Android.Bluetooth.BluetoothSocket

Parámetros

settings
BluetoothSocketSettings

Configuración del BluetoothSocketSettingssocket Bluetooth .

Devoluciones

un BluetoothSocket listo para una conexión saliente.

Atributos

Comentarios

Crea un socket de cliente para conectarse a un servidor Bluetooth remoto con la configuración BluetoothSocketSettings de socket especificada Esta API se usa para conectarse a un servidor remoto hospedado mediante BluetoothAdapter#listenUsingSocketSettings.

<ul><li>Para 'BluetoothSocket.TYPE_RFCOMM': el UUID RFCOMM debe proporcionarse mediante BluetoothSocketSettings#setRfcommUuid(). <li>Para "BluetoothSocket.TYPE_LE": el valor de multiplexador de servicio o protocolo L2cap (PSM) debe proporcionarse mediante BluetoothSocketSettings#setL2capPsm(). </ul>

La aplicación que usa esta API es responsable de obtener el valor del multiplexador de protocolo o servicio (psm) del dispositivo remoto.

Use BluetoothSocket#connect para iniciar la conexión saliente.

Java documentación para android.bluetooth.BluetoothDevice.createUsingSocketSettings(android.bluetooth.BluetoothSocketSettings).

Las partes de esta página son modificaciones basadas en el trabajo creado y compartido por el Android y se usan según los términos descritos en creative Creative Commons 2.5 Attribution License.

Se aplica a