BluetoothUtils
public
class
BluetoothUtils
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.util.BluetoothUtils |
기기에서 BluetoothInstrumentation을 호출하는 유틸리티 함수
기기 측 BluetoothInstrumentation 코드는 AOSP에서 확인할 수 있습니다.
frameworks/base/core/tests/bluetoothtests
요약
상수 | |
|---|---|
String |
BTSNOOP_API
|
String |
BTSNOOP_CMD
|
String |
BTSNOOP_DISABLE_CMD
|
String |
BTSNOOP_ENABLE_CMD
|
String |
GOLD_BTSNOOP_LOG_PATH
|
String |
O_BUILD
|
공개 생성자 | |
|---|---|
BluetoothUtils()
|
|
공개 메서드 | |
|---|---|
static
void
|
cleanLogFile(ITestDevice device)
기기에서 스눕 로그 파일 삭제 |
static
boolean
|
disable(ITestDevice device)
지정된 기기에서 블루투스를 사용 중지합니다. |
static
boolean
|
disableBtsnoopLogging(ITestDevice device, File sl4aApkFile)
sl4a 호출로 btsnoop 로깅 사용 중지 |
static
boolean
|
disableBtsnoopLogging(ITestDevice device)
sl4a 호출로 btsnoop 로깅 사용 중지 |
static
boolean
|
enable(ITestDevice device)
지정된 기기에서 블루투스를 사용 설정합니다. |
static
boolean
|
enableBtsnoopLogging(ITestDevice device, File sl4aApkFile)
sl4a 호출로 btsnoop 로깅 사용 설정 |
static
boolean
|
enableBtsnoopLogging(ITestDevice device)
sl4a 호출로 btsnoop 로깅 사용 설정 |
static
String
|
getBluetoothMac(ITestDevice device)
지정된 기기의 BT mac을 가져옵니다. |
static
|
getBondedDevices(ITestDevice device)
지정된 기기가 페어링된 기기의 블루투스 MAC 주소를 반환합니다. |
static
String
|
getBtSnoopLogFilePath(ITestDevice device)
bt_stack.config 파일에서 bt 스눕 로그 파일 경로 가져오기 |
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
상수 값: "bluetoothConfigHciSnoopLog"
BTSNOOP_CMD
public static final String BTSNOOP_CMD
상수 값: "setprop persist.bluetooth.btsnoopenable "
BTSNOOP_DISABLE_CMD
public static final String BTSNOOP_DISABLE_CMD
상수 값: "setprop persist.bluetooth.btsnoopenable false"
BTSNOOP_ENABLE_CMD
public static final String BTSNOOP_ENABLE_CMD
상수 값: "setprop persist.bluetooth.btsnoopenable true"
GOLD_BTSNOOP_LOG_PATH
public static final String GOLD_BTSNOOP_LOG_PATH
상수 값: "/data/misc/bluetooth/logs/btsnoop_hci.log"
O_BUILD
public static final String O_BUILD
상수 값: 'O'
공개 생성자
BluetoothUtils
public BluetoothUtils ()
공개 메서드
cleanLogFile
public static void cleanLogFile (ITestDevice device)
기기에서 스눕 로그 파일 삭제
| 매개변수 | |
|---|---|
device |
ITestDevice |
| 생성 값 | |
|---|---|
DeviceNotAvailableException |
|
사용 중지
public static boolean disable (ITestDevice device)
지정된 기기에서 블루투스를 사용 중지합니다.
| 반환 값 | |
|---|---|
boolean |
사용 중지가 성공하면 true, 그렇지 않으면 false입니다. |
| 생성 값 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
disableBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device, File sl4aApkFile)
sl4a 호출로 btsnoop 로깅 사용 중지
| 매개변수 | |
|---|---|
sl4aApkFile |
File: sl4a.apk 파일 위치, 설치된 경우 null |
| 반환 값 | |
|---|---|
boolean |
성공 여부 |
| 생성 값 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
disableBtsnoopLogging
public static boolean disableBtsnoopLogging (ITestDevice device)
sl4a 호출로 btsnoop 로깅 사용 중지
| 반환 값 | |
|---|---|
boolean |
성공 여부 |
| 생성 값 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
사용 설정
public static boolean enable (ITestDevice device)
지정된 기기에서 블루투스를 사용 설정합니다.
| 반환 값 | |
|---|---|
boolean |
사용 설정이 성공하면 true, 그렇지 않으면 false |
| 생성 값 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
enableBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device, File sl4aApkFile)
sl4a 호출로 btsnoop 로깅 사용 설정
| 매개변수 | |
|---|---|
sl4aApkFile |
File: sl4a.apk 파일 위치, 설치된 경우 null |
| 반환 값 | |
|---|---|
boolean |
성공 여부 |
| 생성 값 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
enableBtsnoopLogging
public static boolean enableBtsnoopLogging (ITestDevice device)
sl4a 호출로 btsnoop 로깅 사용 설정
| 반환 값 | |
|---|---|
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 staticgetBondedDevices (ITestDevice device)
지정된 기기가 페어링된 기기의 블루투스 MAC 주소를 반환합니다.
| 반환 값 | |
|---|---|
|
블루투스 MAC 주소 |
| 생성 값 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
getBtSnoopLogFilePath
public static String getBtSnoopLogFilePath (ITestDevice device)
bt_stack.config 파일에서 bt 스눕 로그 파일 경로 가져오기
| 반환 값 | |
|---|---|
String |
bt_snoop_log의 파일 이름입니다. 찾을 수 없는 경우 null입니다. |
| 생성 값 | |
|---|---|
DeviceNotAvailableException |
|
runBluetoothInstrumentation
public static String runBluetoothInstrumentation (ITestDevice device, String command)
BT 계측 명령어를 실행하고 출력을 반환하는 편의 메서드
| 매개변수 | |
|---|---|
command |
String: BT 계측에 전송되는 명령어 문자열입니다. 현재 지원되는 명령어는 enable, disable, unpairAll, getName, getAddress, getBondedDevices입니다. 자세한 내용은 AOSP 소스를 참고하세요. |
| 반환 값 | |
|---|---|
String |
BluetoothInstrumentation의 출력 |
| 생성 값 | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
runBluetoothInstrumentationWithRetry
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 |
|