BluetoothUtils

public class BluetoothUtils
extends Object

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


기기에서 BluetoothInstrumentation를 호출하기 위한 유틸리티 함수

기기 측 BluetoothInstrumentation 코드는 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)

지정된 기기에서 블루투스를 사용 중지합니다.

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

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)

지정된 기기에서 블루투스를 사용 중지합니다.

반환 값
boolean 사용 중지가 완료되면 true, 완료되지 않으면 false입니다.

생성 값
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a 호출에 의한 btsnoop 로깅 사용 중지

매개변수
sl4aApkFile File: sl4a.apk 파일 위치입니다. 설치된 경우 null입니다.

반환 값
boolean 성공 여부

생성 값
DeviceNotAvailableException

disableBtsnoopLogging

public static boolean disableBtsnoopLogging (ITestDevice device)

sl4a 호출에 의한 btsnoop 로깅 사용 중지

반환 값
boolean 성공 여부

생성 값
DeviceNotAvailableException

사용 설정

public static boolean enable (ITestDevice device)

지정된 기기에서 블루투스를 사용 설정합니다.

반환 값
boolean 사용 설정이 성공하면 true, 그렇지 않으면 false입니다.

생성 값
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device, 
                File sl4aApkFile)

sl4a 호출을 통해 btsnoop 로깅 사용 설정

매개변수
sl4aApkFile File: sl4a.apk 파일 위치입니다. 설치된 경우 null입니다.

반환 값
boolean 성공 여부

생성 값
DeviceNotAvailableException

enableBtsnoopLogging

public static boolean enableBtsnoopLogging (ITestDevice device)

sl4a 호출을 통해 btsnoop 로깅 사용 설정

반환 값
boolean 성공 여부

생성 값
DeviceNotAvailableException

getBluetoothMac

public static String getBluetoothMac (ITestDevice device)

지정된 기기의 BT MAC을 가져옵니다.

반환 값
String BT MAC 또는 찾을 수 없는 경우 null

생성 값
DeviceNotAvailableException

getBondedDevices

public static  getBondedDevices (ITestDevice device)

지정된 기기가 결합된 기기의 블루투스 MAC 주소를 반환합니다.

반환 값
블루투스 MAC 주소

생성 값
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의 출력

생성 값
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

생성 값
DeviceNotAvailableException

uploadLogFiles

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

테스트 결과를 위한 스누핑 로그 파일 업로드

매개변수
listener ITestInvocationListener

device ITestDevice

type String

iteration int

생성 값
DeviceNotAvailableException