BluetoothUtils

public class BluetoothUtils
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.BluetoothUtils


Funkcje pomocnicze do wywoływania BluetoothInstrumentation na urządzeniu

Kod sterowania Bluetooth po stronie urządzenia można znaleźć w AOSP pod adresem: frameworks/base/core/tests/bluetoothtests

Podsumowanie

Fieldsem

public static final String BTSNOOP_API

public static final String BTSNOOP_CMD

public static final String BTSNOOP_DISABLE_CMD

public static final String BTSNOOP_ENABLE_CMD

public static final String GOLD_BTSNOOP_LOG_PATH

public static final String O_BUILD

Konstruktory publiczne

BluetoothUtils()

Metody publiczne

static void cleanLogFile(ITestDevice device)

Usuwanie pliku dziennika podsłuchu z urządzenia

static boolean disable(ITestDevice device)

Wyłącza Bluetootha na danym urządzeniu.

static boolean disableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

Wyłączanie rejestrowania btsnoop przez wywołanie sl4a

static boolean disableBtsnoopLogging(ITestDevice device)

Wyłączanie rejestrowania btsnoop przez wywołanie sl4a

static boolean enable(ITestDevice device)

Włącza Bluetootha na danym urządzeniu.

static boolean enableBtsnoopLogging(ITestDevice device, File sl4aApkFile)

Włączanie logowania btsnoop przez wywołanie sl4a

static boolean enableBtsnoopLogging(ITestDevice device)

Włączanie logowania btsnoop przez wywołanie sl4a

static String getBluetoothMac(ITestDevice device)

Pobiera adres MAC BT danego urządzenia.

static getBondedDevices(ITestDevice device)

Zwraca adresy MAC Bluetooth urządzeń, z którymi połączone jest dane urządzenie.

static String getBtSnoopLogFilePath(ITestDevice device)

Pobieranie ścieżki do pliku dziennika bt snoop z pliku bt_stack.config

static String runBluetoothInstrumentation(ITestDevice device, String command)

Metoda ułatwiająca wykonywanie polecenia BT i zwracanie danych

static boolean runBluetoothInstrumentationWithRetry(ITestDevice device, String command)
static boolean toggleBtsnoopLogging(Sl4aClient client, boolean onOff)
static boolean unpairWithRetry(ITestDevice device)

Ponowne próby usunięcia parowania BT z liniowym zmniejszaniem częstotliwości

static void uploadLogFiles(ITestInvocationListener listener, ITestDevice device, String type, int iteration)

Przesyłanie pliku dziennika snoop do celów testowania

Fieldsem

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_BUILD

public static final String O_BUILD

Konstruktory publiczne

BluetoothUtils

public BluetoothUtils ()

Metody publiczne

cleanLogFile

public static void cleanLogFile (ITestDevice device)

Usuwanie pliku dziennika podsłuchu z urządzenia

Parametry
device ITestDevice

Rzuty
DeviceNotAvailableException

wyłącz

public static boolean disable (ITestDevice device)

Wyłącza Bluetootha na danym urządzeniu.

Zwroty
boolean Wartość true, jeśli wyłączenie zakończyło się powodzeniem. W przeciwnym razie wartość false.

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Wyłączanie rejestrowania btsnoop przez wywołanie sl4a

Parametry
sl4aApkFile File: lokalizacja pliku sl4a.apk, null, jeśli został zainstalowany

Zwroty
boolean sukces lub nie

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

Wyłączanie rejestrowania btsnoop przez wywołanie sl4a

Zwroty
boolean sukces lub nie

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

włącz

public static boolean enable (ITestDevice device)

Włącza Bluetootha na danym urządzeniu.

Zwroty
boolean Wartość true, jeśli enable zakończyło się powodzeniem, w przeciwnym razie wartość false

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

Włączanie logowania btsnoop przez wywołanie sl4a

Parametry
sl4aApkFile File: lokalizacja pliku sl4a.apk, null, jeśli został zainstalowany

Zwroty
boolean sukces lub nie

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

Włączanie logowania btsnoop przez wywołanie sl4a

Zwroty
boolean sukces lub nie

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Pobiera adres MAC BT danego urządzenia.

Zwroty
String Adres MAC BT lub null, jeśli nie znaleziono

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

Zwraca adresy MAC Bluetooth urządzeń, z którymi połączone jest dane urządzenie.

Zwroty
adresy MAC Bluetooth,

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

Pobieranie ścieżki do pliku dziennika bt snoop z pliku bt_stack.config

Zwroty
String Nazwa pliku bt_snoop_log lub wartość null, jeśli plik nie został znaleziony

Rzuty
DeviceNotAvailableException

runBluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

Metoda ułatwiająca wykonywanie polecenia BT i zwracanie danych

Parametry
command String: ciąg poleceń wysyłany do narzędzia BT, obecnie obsługiwane: enable, disable, unpairAll, getName, getAddress, getBondedDevices; więcej informacji znajdziesz w źródle AOSP

Zwroty
String wyjście BluetoothInstrumentation

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parametry
device ITestDevice

command String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parametry
client Sl4aClient

onOff boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Ponowne próby usunięcia parowania BT z liniowym zmniejszaniem częstotliwości

Zwroty
boolean

Rzuty
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

uploadLogFiles

public static void uploadLogFiles (ITestInvocationListener listener, 
                ITestDevice device, 
                String type, 
                int iteration)

Przesyłanie pliku dziennika snoop do celów testowania

Parametry
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Rzuty
DeviceNotAvailableException