BluetoothYardımcı Programlar

public class BluetoothUtils
extends Object

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


Cihazda BluetoothInstrumentation'ı çağırmak için yardımcı program işlevleri

Cihaz tarafı BluetoothEnstrümantasyon kodu AOSP'de şu adreste bulunabilir: frameworks/base/core/tests/bluetoothtests

Özet

Alanlar

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

Kamu inşaatçıları

BluetoothUtils ()

Genel yöntemler

static void cleanLogFile ( ITestDevice device)

Snoop günlük dosyasını cihazdan sil

static boolean disable ( ITestDevice device)

Belirtilen cihazda Bluetooth'u devre dışı bırakır

static boolean disableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

sl4a çağrısıyla btsnoop günlüğünü devre dışı bırak

static boolean disableBtsnoopLogging ( ITestDevice device)

sl4a çağrısıyla btsnoop günlüğünü devre dışı bırak

static boolean enable ( ITestDevice device)

Belirtilen cihazda Bluetooth'u etkinleştirir

static boolean enableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

sl4a çağrısıyla btsnoop günlüğünü etkinleştir

static boolean enableBtsnoopLogging ( ITestDevice device)

sl4a çağrısıyla btsnoop günlüğünü etkinleştir

static String getBluetoothMac ( ITestDevice device)

Verilen cihazın BT mac'unu alır

static getBondedDevices ( ITestDevice device)

Belirtilen cihazın bağlandığı cihazların bluetooth mac adreslerini döndürür

static String getBtSnoopLogFilePath ( ITestDevice device)

bt_stack.config dosyasından bt snoop günlük dosyası yolunu alın

static String runBluetoothInstrumentation ( ITestDevice device, String command)

BT enstrümantasyon komutunu yürütmek ve çıktıyı döndürmek için uygun yöntem

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

Doğrusal geri çekilmeyle BT eşleştirmesini temizlemeyi yeniden dener

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

Test sonuçları için gözetleme günlük dosyasını yükleyin

Alanlar

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

Kamu inşaatçıları

BluetoothYardımcı Programlar

public BluetoothUtils ()

Genel yöntemler

cleanLogFile

public static void cleanLogFile (ITestDevice device)

Snoop günlük dosyasını cihazdan sil

Parametreler
device ITestDevice

Atar
DeviceNotAvailableException

devre dışı bırakmak

public static boolean disable (ITestDevice device)

Belirtilen cihazda Bluetooth'u devre dışı bırakır

İadeler
boolean Devre dışı bırakma başarılı olursa doğru, aksi halde yanlış

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

BtsnoopLogging'i devre dışı bırak

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a çağrısıyla btsnoop günlüğünü devre dışı bırak

Parametreler
sl4aApkFile File : sl4a.apk dosya konumu, eğer kuruluysa boş

İadeler
boolean başarı ya da değil

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

BtsnoopLogging'i devre dışı bırak

public static boolean disableBtsnoopLogging (ITestDevice device)

sl4a çağrısıyla btsnoop günlüğünü devre dışı bırak

İadeler
boolean başarı ya da değil

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

olanak vermek

public static boolean enable (ITestDevice device)

Belirtilen cihazda Bluetooth'u etkinleştirir

İadeler
boolean Etkinleştirme başarılı olursa doğru, aksi halde yanlış

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

BtsnoopLogging'i etkinleştir

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a çağrısıyla btsnoop günlüğünü etkinleştir

Parametreler
sl4aApkFile File : sl4a.apk dosya konumu, eğer kuruluysa boş

İadeler
boolean başarı ya da değil

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

BtsnoopLogging'i etkinleştir

public static boolean enableBtsnoopLogging (ITestDevice device)

sl4a çağrısıyla btsnoop günlüğünü etkinleştir

İadeler
boolean başarı ya da değil

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

Verilen cihazın BT mac'unu alır

İadeler
String BT mac veya bulunamazsa null

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

Belirtilen cihazın bağlandığı cihazların bluetooth mac adreslerini döndürür

İadeler
bluetooth mac adresleri

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

bt_stack.config dosyasından bt snoop günlük dosyası yolunu alın

İadeler
String bt_snoop_log için dosya adı veya bulunamazsa null

Atar
DeviceNotAvailableException

çalıştırBluetoothEnstrümantasyon

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

BT enstrümantasyon komutunu yürütmek ve çıktıyı döndürmek için uygun yöntem

Parametreler
command String : BT enstrümantasyonuna gönderilen ve şu anda desteklenen bir komut dizisi: etkinleştirme, devre dışı bırakma, eşleşmeyi kaldırma, getName, getAddress, getBondedDevices; daha fazla ayrıntı için AOSP kaynağına bakın

İadeler
String BluetoothInstrumentation çıktısı

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

çalıştırBluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

Parametreler
device ITestDevice

command String

İadeler
boolean

Atar
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

Parametreler
client Sl4aClient

onOff boolean

İadeler
boolean

Atar
DeviceNotAvailableException

Yeniden Denemeyle eşleştirmeyi kaldır

public static boolean unpairWithRetry (ITestDevice device)

Doğrusal geri çekilmeyle BT eşleştirmesini temizlemeyi yeniden dener

İadeler
boolean

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

LogDosyalarını yükle

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

Test sonuçları için gözetleme günlük dosyasını yükleyin

Parametreler
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Atar
DeviceNotAvailableException