Bluetooth Araçları

public class BluetoothUtils
extends Object

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


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

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)

Verilen 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)

Verilen cihazda bluetooth'u etkinleştirir

static boolean enableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

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

static boolean enableBtsnoopLogging ( ITestDevice device)

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

static String getBluetoothMac ( ITestDevice device)

Verilen cihazın BT mac'unu alır

static getBondedDevices ( ITestDevice device)

Verilen 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 kolaylık yöntemi

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

Doğrusal geri alma ile BT eşleştirmesini temizlemeyi yeniden dener

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

Test sonuçları için snoop 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

Bluetooth Araçları

public BluetoothUtils ()

Genel yöntemler

temizGünlükDosyası

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)

Verilen cihazda bluetooth'u devre dışı bırakır

İadeler
boolean Devre dışı bırakma başarılıysa doğru, aksi takdirde 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, yüklenmişse 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)

Verilen cihazda bluetooth'u etkinleştirir

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

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

etkinleştirmeBtsnoopGünlüğü

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

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

parametreler
sl4aApkFile File : sl4a.apk dosya konumu, yüklenmişse boş

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

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

etkinleştirmeBtsnoopGünlüğü

public static boolean enableBtsnoopLogging (ITestDevice device)

sl4a çağrısı ile 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 bulunmazsa null

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

Getbondeddevices

public static  getBondedDevices (ITestDevice device)

Verilen 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 bulunmazsa null

Atar
DeviceNotAvailableException

runBluetoothEnstrümantasyon

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

BT enstrümantasyon komutunu yürütmek ve çıktıyı döndürmek için kolaylık yöntemi

parametreler
command String : şu anda desteklenen BT araçlarına gönderilen bir komut dizisi: enable, disable, unpairAll, getName, getAddress, getBondedDevices; daha fazla ayrıntı için AOSP kaynağına bakın

İadeler
String Bluetooth Enstrümantasyonunun çıkışı

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runBluetoothInstrumentationWithRetry

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

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

Doğrusal geri alma ile BT eşleştirmesini temizlemeyi yeniden dener

İadeler
boolean

Atar
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

günlük dosyalarını karşıya yükle

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

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

parametreler
listener ITestInvocationListener

device ITestDevice

type String

iteration int

Atar
DeviceNotAvailableException