Utilitaires Bluetooth
public class BluetoothUtils
extends Object
java.lang.Object |
↳ | com.android.tradefed.util.BluetoothUtils |
Fonctions utilitaires pour appeler l'instrument Bluetooth sur l'appareil
Le code de l'instrument Bluetooth côté appareil peut être trouvé dans AOSP à l'adresse : frameworks/base/core/tests/bluetoothtests
Résumé
Méthodes publiques |
---|
static void | cleanLogFile (ITestDevice device) Supprimer le fichier journal Snoop de l'appareil |
static boolean | disable (ITestDevice device) Désactive le Bluetooth sur l'appareil donné |
static boolean | disableBtsnoopLogging (ITestDevice device, File sl4aApkFile) Désactiver la journalisation btsnoop par appel sl4a |
static boolean | disableBtsnoopLogging (ITestDevice device) Désactiver la journalisation btsnoop par appel sl4a |
static boolean | enable (ITestDevice device) Active le Bluetooth sur l'appareil donné |
static boolean | enableBtsnoopLogging (ITestDevice device, File sl4aApkFile) Activer la journalisation btsnoop par appel sl4a |
static boolean | enableBtsnoopLogging (ITestDevice device) Activer la journalisation btsnoop par appel sl4a |
static String | getBluetoothMac (ITestDevice device) Récupère le Mac BT de l'appareil donné |
static | getBondedDevices (ITestDevice device) Renvoie les adresses Mac Bluetooth des appareils avec lesquels l'appareil donné s'est lié |
static String | getBtSnoopLogFilePath (ITestDevice device) Obtenez le chemin du fichier journal BT Snoop à partir du fichier bt_stack.config |
static String | runBluetoothInstrumentation (ITestDevice device, String command) Méthode pratique pour exécuter la commande d'instrumentation BT et renvoyer la sortie |
static boolean | runBluetoothInstrumentationWithRetry (ITestDevice device, String command) |
static boolean | toggleBtsnoopLogging ( Sl4aClient client, boolean onOff) |
static boolean | unpairWithRetry (ITestDevice device) Réessaye d'effacer le couplage BT avec une interruption linéaire |
static void | uploadLogFiles (ITestInvocationListener listener, ITestDevice device, String type, int iteration) Téléchargez le fichier journal Snoop pour les résultats des tests |
Des champs
BTSNOOP_API
public static final String BTSNOOP_API
BTSNOOP_CMD
public static final String BTSNOOP_CMD
BTSNOOP_DISABLE_CMD
public static final String BTSNOOP_DISABLE_CMD
BTSNOOP_ENABLE_CMD
public static final String BTSNOOP_ENABLE_CMD
GOLD_BTSNOOP_LOG_PATH
public static final String GOLD_BTSNOOP_LOG_PATH
O_CONSTRUCTION
public static final String O_BUILD
Constructeurs publics
Utilitaires Bluetooth
public BluetoothUtils ()
Méthodes publiques
fichierJournal propre
public static void cleanLogFile (ITestDevice device)
Supprimer le fichier journal Snoop de l'appareil
Paramètres |
---|
device | ITestDevice |
Jetés |
---|
DeviceNotAvailableException | |
désactiver
public static boolean disable (ITestDevice device)
Désactive le Bluetooth sur l'appareil donné
Retour |
---|
boolean | Vrai si la désactivation réussit, faux sinon |
Jetés |
---|
DeviceNotAvailableException | |
désactiverBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device,
File sl4aApkFile)
Désactiver la journalisation btsnoop par appel sl4a
Paramètres |
---|
sl4aApkFile | File : emplacement du fichier sl4a.apk, nul s'il a été installé |
Retour |
---|
boolean | succès ou pas |
Jetés |
---|
DeviceNotAvailableException | |
désactiverBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device)
Désactiver la journalisation btsnoop par appel sl4a
Retour |
---|
boolean | succès ou pas |
Jetés |
---|
DeviceNotAvailableException | |
activer
public static boolean enable (ITestDevice device)
Active le Bluetooth sur l'appareil donné
Retour |
---|
boolean | Vrai si l'activation réussit, faux sinon |
Jetés |
---|
DeviceNotAvailableException | |
activerBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device,
File sl4aApkFile)
Activer la journalisation btsnoop par appel sl4a
Paramètres |
---|
sl4aApkFile | File : emplacement du fichier sl4a.apk, nul s'il a été installé |
Retour |
---|
boolean | succès ou pas |
Jetés |
---|
DeviceNotAvailableException | |
activerBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device)
Activer la journalisation btsnoop par appel sl4a
Retour |
---|
boolean | succès ou pas |
Jetés |
---|
DeviceNotAvailableException | |
obtenirBluetoothMac
public static String getBluetoothMac (ITestDevice device)
Récupère le Mac BT de l'appareil donné
Retour |
---|
String | BT mac ou null si introuvable |
Jetés |
---|
DeviceNotAvailableException | |
getBondedDevices
public static getBondedDevices (ITestDevice device)
Renvoie les adresses Mac Bluetooth des appareils avec lesquels l'appareil donné s'est lié
Retour |
---|
| adresses Mac Bluetooth |
Jetés |
---|
DeviceNotAvailableException | |
getBtSnoopLogFilePath
public static String getBtSnoopLogFilePath (ITestDevice device)
Obtenez le chemin du fichier journal BT Snoop à partir du fichier bt_stack.config
Retour |
---|
String | Le nom du fichier pour bt_snoop_log ou null s'il n'est pas trouvé |
Jetés |
---|
DeviceNotAvailableException | |
runBluetoothInstrumentation
public static String runBluetoothInstrumentation (ITestDevice device,
String command)
Méthode pratique pour exécuter la commande d'instrumentation BT et renvoyer la sortie
Paramètres |
---|
command | String : une chaîne de commande envoyée à l'instrumentation BT, actuellement prise en charge : activer, désactiver, unpairAll, getName, getAddress, getBondedDevices ; reportez-vous à la source AOSP pour plus de détails |
Retour |
---|
String | sortie de l'instrumentation Bluetooth |
Jetés |
---|
DeviceNotAvailableException | |
runBluetoothInstrumentationWithRetry
public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device,
String command)
Paramètres |
---|
device | ITestDevice |
command | String |
Jetés |
---|
DeviceNotAvailableException | |
basculerBtsnoopLogging
public static boolean toggleBtsnoopLogging (Sl4aClient client,
boolean onOff)
Paramètres |
---|
client | Sl4aClient |
onOff | boolean |
Jetés |
---|
DeviceNotAvailableException | |
dissocierAvecRéessayer
public static boolean unpairWithRetry (ITestDevice device)
Réessaye d'effacer le couplage BT avec une interruption linéaire
Jetés |
---|
DeviceNotAvailableException | |
télécharger des fichiers journaux
public static void uploadLogFiles (ITestInvocationListener listener,
ITestDevice device,
String type,
int iteration)
Téléchargez le fichier journal Snoop pour les résultats des tests
Paramètres |
---|
listener | ITestInvocationListener |
device | ITestDevice |
type | String |
iteration | int |
Jetés |
---|
DeviceNotAvailableException | |