BluetoothDevice.CreateUsingSocketSettings(BluetoothSocketSettings) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Crée un socket client pour se connecter à un serveur Bluetooth distant avec les paramètres BluetoothSocketSettings de socket spécifiés Cette API est utilisée pour se connecter à un serveur distant hébergé à l’aide BluetoothAdapter#listenUsingSocketSettingsde .
[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
Paramètres
- settings
- BluetoothSocketSettings
Paramètres de BluetoothSocketSettingssocket Bluetooth .
Retours
prêt BluetoothSocket pour une connexion sortante.
- Attributs
Remarques
Crée un socket client pour se connecter à un serveur Bluetooth distant avec les paramètres BluetoothSocketSettings de socket spécifiés Cette API est utilisée pour se connecter à un serveur distant hébergé à l’aide BluetoothAdapter#listenUsingSocketSettingsde .
<ul><li>For 'BluetoothSocket.TYPE_RFCOMM' : le RFCOMM UUID doit être fourni à l’aide BluetoothSocketSettings#setRfcommUuid()de .
<li>Pour « BluetoothSocket.TYPE_LE » : la valeur du multiplexeur de service/protocole L2cap (PSM) doit être fournie à l’aide BluetoothSocketSettings#setL2capPsm()de .
</ul>
L’application utilisant cette API est responsable de l’obtention de la valeur de multiplexeur de protocole/de service (psm) à partir d’un appareil distant.
Permet BluetoothSocket#connect de lancer la connexion sortante.
Les parties de cette page sont des modifications basées sur le travail créé et partagé par Android Open Source et utilisées en fonction des termes décrits dans la Creative Commons 2.5 Attribution License.