BluetoothUtils

public class BluetoothUtils
extends Object

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


פונקציות שירות להתקשרות BluetoothInstrumentation במכשיר

ניתן למצוא קוד מכשירי Bluetooth בצד ההתקן ב-AOSP בכתובת: frameworks/base/core/tests/bluetoothtests

סיכום

שדות

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

בנאים ציבוריים

BluetoothUtils ()

שיטות ציבוריות

static void cleanLogFile ( ITestDevice device)

מחק קובץ יומן סנופ מהמכשיר

static boolean disable ( ITestDevice device)

משבית את ה-Bluetooth במכשיר הנתון

static boolean disableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

השבת רישום btsnoop באמצעות שיחת sl4a

static boolean disableBtsnoopLogging ( ITestDevice device)

השבת רישום btsnoop באמצעות שיחת sl4a

static boolean enable ( ITestDevice device)

מפעיל Bluetooth במכשיר הנתון

static boolean enableBtsnoopLogging ( ITestDevice device, File sl4aApkFile)

אפשר רישום btsnoop באמצעות שיחת sl4a

static boolean enableBtsnoopLogging ( ITestDevice device)

אפשר רישום btsnoop באמצעות שיחת sl4a

static String getBluetoothMac ( ITestDevice device)

מאחזר BT mac של המכשיר הנתון

static getBondedDevices ( ITestDevice device)

מחזירה כתובות mac של Bluetooth של מכשירים שהמכשיר הנתון נקשר אליהם

static String getBtSnoopLogFilePath ( ITestDevice device)

קבל נתיב קובץ יומן bt snoop מקובץ bt_stack.config

static String runBluetoothInstrumentation ( ITestDevice device, String command)

שיטת נוחות לביצוע פקודת מכשור BT והחזרת פלט

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

מנסה שוב לנקות את צימוד BT עם החזר ליניארי

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

העלה קובץ יומן סנופ לתוצאות הבדיקה

שדות

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

בנאים ציבוריים

BluetoothUtils

public BluetoothUtils ()

שיטות ציבוריות

cleanLogFile

public static void cleanLogFile (ITestDevice device)

מחק קובץ יומן סנופ מהמכשיר

פרמטרים
device ITestDevice

זורק
DeviceNotAvailableException

להשבית

public static boolean disable (ITestDevice device)

משבית את ה-Bluetooth במכשיר הנתון

החזרות
boolean נכון אם ההשבתה מצליחה, לא נכון אחרת

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

השבת רישום btsnoop באמצעות שיחת sl4a

פרמטרים
sl4aApkFile File : מיקום הקובץ sl4a.apk, null אם הוא הותקן

החזרות
boolean הצלחה או לא

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

השבת רישום btsnoop באמצעות שיחת sl4a

החזרות
boolean הצלחה או לא

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

לְאַפשֵׁר

public static boolean enable (ITestDevice device)

מפעיל Bluetooth במכשיר הנתון

החזרות
boolean True אם ההפעלה מוצלחת, false אחרת

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

אפשרBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

אפשר רישום btsnoop באמצעות שיחת sl4a

פרמטרים
sl4aApkFile File : מיקום הקובץ sl4a.apk, null אם הוא הותקן

החזרות
boolean הצלחה או לא

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

אפשרBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

אפשר רישום btsnoop באמצעות שיחת sl4a

החזרות
boolean הצלחה או לא

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

מאחזר BT mac של המכשיר הנתון

החזרות
String BT mac או null אם לא נמצא

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

מחזירה כתובות mac של Bluetooth של מכשירים שהמכשיר הנתון נקשר אליהם

החזרות
כתובות Bluetooth של מק

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

getBtSnoopLogFilePath

public static String getBtSnoopLogFilePath (ITestDevice device)

קבל נתיב קובץ יומן bt snoop מקובץ bt_stack.config

החזרות
String שם הקובץ עבור bt_snoop_log או null אם הוא לא נמצא

זורק
DeviceNotAvailableException

הפעלת BluetoothInstrumentation

public static String runBluetoothInstrumentation (ITestDevice device, 
                String command)

שיטת נוחות לביצוע פקודת מכשור BT והחזרת פלט

פרמטרים
command String : מחרוזת פקודה שנשלחה למכשירי BT, נתמכת כעת: enable, disable, unpairAll, getName, getAddress, getBondedDevices; עיין במקור AOSP לפרטים נוספים

החזרות
String פלט של מכשירי Bluetooth

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

הפעל BluetoothInstrumentationWithRetry

public static boolean runBluetoothInstrumentationWithRetry (ITestDevice device, 
                String command)

פרמטרים
device ITestDevice

command String

החזרות
boolean

זורק
DeviceNotAvailableException

toggleBtsnoopLogging

public static boolean toggleBtsnoopLogging (Sl4aClient client, 
                boolean onOff)

פרמטרים
client Sl4aClient

onOff boolean

החזרות
boolean

זורק
DeviceNotAvailableException

unpairWithRetry

public static boolean unpairWithRetry (ITestDevice device)

מנסה שוב לנקות את צימוד BT עם החזר ליניארי

החזרות
boolean

זורק
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

uploadLogFiles

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

העלה קובץ יומן סנופ לתוצאות הבדיקה

פרמטרים
listener ITestInvocationListener

device ITestDevice

type String

iteration int

זורק
DeviceNotAvailableException