Bir yardımcı program sınıfı, SL4A kullanan bir veya iki cihazda Bluetooth işlemleri sağlar
iç içe sınıflar enum
Sl4aBluetoothUtil.BluetoothAccessLevel
Dayanmaktadır Bluetooth cihazı erişim seviyesi için Numaralamalar BluetoothDevice.java
enum
Sl4aBluetoothUtil.BluetoothConnectionState
Dayanmaktadır Bluetooth bağlantı devletler için Numaralamalar BluetoothProfile.java
enum
Sl4aBluetoothUtil.BluetoothPriorityLevel
Dayanmaktadır Bluetooth profil öncelik düzeyi için Numaralamalar BluetoothProfile.java
enum
Sl4aBluetoothUtil.BluetoothProfile
Dayanmaktadır Bluetooth profilleri için Numaralamalar BluetoothProfile.java
Genel yöntemler boolean
changeProfileAccessPermission (ITestDevice primary, ITestDevice secondary, Sl4aBluetoothUtil.BluetoothProfile profile, Sl4aBluetoothUtil.BluetoothAccessLevel access)
İkincil cihazın verilen profildeki birincil cihaza erişmesi için birincil cihazdaki ikincil cihazın Bluetooth profili erişim iznini değiştirin
boolean
connect (ITestDevice primary, ITestDevice secondary, profiles)
connect (ITestDevice primary, ITestDevice secondary, profiles)
Verilen Bluetooth profillerinde birincil cihazı ikincil cihaza bağlayın
boolean
disable (ITestDevice device)
Hedef cihazda Bluetooth'u devre dışı bırak
boolean
disableBluetoothSnoopLog (ITestDevice device)
Bluetooth gözetleme günlüğünü devre dışı bırak
boolean
disconnect (ITestDevice primary, ITestDevice secondary, profiles)
disconnect (ITestDevice primary, ITestDevice secondary, profiles)
Birincil cihazın ikincil cihazdan bağlantısını kesin
boolean
enable (ITestDevice device)
Hedef cihazda Bluetooth'u etkinleştir
boolean
enableBluetoothSnoopLog (ITestDevice device)
Bluetooth gözetleme günlüğünü etkinleştir
String
getAddress (ITestDevice device)
Hedef cihazın Bluetooth MAC Adresini alın
getBondedDevices (ITestDevice device)
Hedef cihazdaki bağlı (eşleştirilmiş) cihazların Bluetooth MAC adreslerini alın
boolean
pair (ITestDevice primary, ITestDevice secondary)
Birincil cihazı ikincil cihazla eşleştirin
void
setBtConnectionTimeout (Duration timeout)
void
setBtPairTimeout (Duration timeout)
boolean
setProfilePriority (ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority)
setProfilePriority (ITestDevice primary, ITestDevice secondary, profiles, Sl4aBluetoothUtil.BluetoothPriorityLevel priority)
Birincil cihazda verilen profillerin öncelik ayarını ikincil cihaza değiştir
void
startSl4a (ITestDevice device, File sl4aApkFile)
SL4A istemcisini verilen cihaz ve SL4A apk dosyası ile açıkça başlatın.
void
stopSl4a ()
Halihazırda açılmış olan SL4A istemcilerini durdurun.
boolean
unpairAll (ITestDevice device)
Geçerli cihaz için tüm eşleştirilmiş cihazların eşleşmesini kaldırın
Korumalı yöntemler void
finalize ()
Tüm SL4A bağlantılarını temizleyin
Kamu inşaatçıları Sl4aBluetoothUtil
public Sl4aBluetoothUtil ()
Genel yöntemler changeProfileAccessPermission
public boolean changeProfileAccessPermission (ITestDevice primary,
ITestDevice secondary,
Sl4aBluetoothUtil.BluetoothProfile profile,
Sl4aBluetoothUtil.BluetoothAccessLevel access) İkincil cihazın verilen profildeki birincil cihaza erişmesi için birincil cihazdaki ikincil cihazın Bluetooth profili erişim iznini değiştirin
parametreler primary
ITestDevice
: Değişiklik iznine cihaz secondary
ITestDevice
verilen profilde birincil cihazı erişir cihaz: profile
Sl4aBluetoothUtil.BluetoothProfile
: erişmek için Bluetooth profili access
Sl4aBluetoothUtil.BluetoothAccessLevel
: erişim düzeyi, bkz BluetoothAccessLevel
İadeler boolean
izin başarıyla değiştirildiyse doğru
atar DeviceNotAvailableException
bağlamak
public boolean connect (ITestDevice primary,
ITestDevice secondary,
profiles) Verilen Bluetooth profillerinde birincil cihazı ikincil cihaza bağlayın
parametreler primary
ITestDevice
: Cihaz bağlanmaya secondary
ITestDevice
: Cihaz bağlanmak profiles
: Bağlanmak için bir dizi Bluetooth profili gereklidir
İadeler boolean
bağlantı başarılıysa doğru
atar DeviceNotAvailableException
devre dışı bırakmak
public boolean disable (ITestDevice device) Hedef cihazda Bluetooth'u devre dışı bırak
parametreler device
ITestDevice
: Hedef cihazı
İadeler boolean
Bluetooth başarıyla devre dışı bırakıldıysa doğru
atar DeviceNotAvailableException
BluetoothSnoopLog'u devre dışı bırak
public boolean disableBluetoothSnoopLog (ITestDevice device) Bluetooth gözetleme günlüğünü devre dışı bırak
parametreler device
ITestDevice
: devre dışı snoop günlüğüne
İadeler boolean
başarıyla devre dışı bırakılırsa doğru
atar DeviceNotAvailableException
bağlantıyı kes
public boolean disconnect (ITestDevice primary,
ITestDevice secondary,
profiles) Birincil cihazın ikincil cihazdan bağlantısını kesin
parametreler primary
ITestDevice
: Cihaz kesme işlemi gerçekleştirmek için secondary
ITestDevice
: cihaz bağlantısı kesildi edilecek profiles
: Bağlantısının kesilmesi gereken Bluetooth profilleri seti
İadeler boolean
bağlantı başarıyla kesilirse doğru
atar DeviceNotAvailableException
etkinleştirme
public boolean enable (ITestDevice device) Hedef cihazda Bluetooth'u etkinleştir
parametreler device
ITestDevice
: Hedef cihazı
İadeler boolean
Bluetooth başarıyla etkinleştirildiyse doğru
atar DeviceNotAvailableException
etkinleştirBluetoothSnoopLog
public boolean enableBluetoothSnoopLog (ITestDevice device) Bluetooth gözetleme günlüğünü etkinleştir
parametreler device
ITestDevice
: snoop günlüğünü etkinleştirmek için
İadeler boolean
başarıyla etkinleştirildiyse doğru
atar DeviceNotAvailableException
getAddress
public String getAddress (ITestDevice device) Hedef cihazın Bluetooth MAC Adresini alın
parametreler device
ITestDevice
: Hedef cihazı
İadeler String
MAC Adresi dizisi
atar DeviceNotAvailableException
getBondedDevices
public getBondedDevices (ITestDevice device) Hedef cihazdaki bağlı (eşleştirilmiş) cihazların Bluetooth MAC adreslerini alın
parametreler device
ITestDevice
: Hedef cihazı
İadeler Bluetooth MAC adresleri kümesi
atar DeviceNotAvailableException
çift
public boolean pair (ITestDevice primary,
ITestDevice secondary) Birincil cihazı ikincil cihazla eşleştirin
parametreler primary
ITestDevice
: cihazdan eşleştirmek secondary
ITestDevice
: çiftine aygıt
İadeler boolean
eşleştirme başarılıysa doğru
atar DeviceNotAvailableException
setBtConnectionZaman aşımı
public void setBtConnectionTimeout (Duration timeout)
parametreler timeout
Duration
setBtPairZaman aşımı
public void setBtPairTimeout (Duration timeout)
parametreler timeout
Duration
setProfilePriority
public boolean setProfilePriority (ITestDevice primary,
ITestDevice secondary,
profiles,
Sl4aBluetoothUtil.BluetoothPriorityLevel priority) Birincil cihazda verilen profillerin öncelik ayarını ikincil cihaza değiştir
parametreler primary
ITestDevice
: ayarlanan önceliğe cihaz secondary
ITestDevice
: için ayarlanan önceliğe cihaz profiles
: Öncelik ayarını değiştirmek için Bluetooth profilleri priority
Sl4aBluetoothUtil.BluetoothPriorityLevel
: öncelik seviyesi
İadeler boolean
öncelik başarıyla ayarlanırsa doğru
atar DeviceNotAvailableException
startSl4a
public void startSl4a (ITestDevice device,
File sl4aApkFile) Verilen cihaz ve SL4A apk dosyası ile SL4A istemcisini açıkça başlatın. Normalde bu yöntem gerekli değildir, çünkü SL4A bağlantısı her zaman fiili işlemlerden önce kurulacaktır.
parametreler device
ITestDevice
: Cihaz SL4A kullanılarak bağlanacak sl4aApkFile
File
: Kurulumu ve kullanımı opsiyonel SL4A apk.
atar DeviceNotAvailableException
durSl4a
public void stopSl4a () Halihazırda açılmış olan SL4A istemcilerini durdurun. Temel olarak, istemcileri artık kullanılmadıklarında hemen temizlemenin bir yolunu sunar.
unpairAll
public boolean unpairAll (ITestDevice device) Geçerli cihaz için tüm eşleştirilmiş cihazların eşleşmesini kaldırın
parametreler device
ITestDevice
: Cari cihaz eylemi gerçekleştirmek için
İadeler boolean
eşleştirme başarıyla kaldırılırsa true
atar DeviceNotAvailableException
Korumalı yöntemler Sonuçlandırmak
protected void finalize () Tüm SL4A bağlantılarını temizleyin
Geri bildirim gönderin
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-10-04 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"İhtiyacım olan bilgiler yok"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Çok karmaşık / çok fazla adım var"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Güncel değil"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Çeviri sorunu"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Örnek veya kod sorunu"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Diğer"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Anlaması kolay"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Sorunumu çözdü"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Diğer"
}]
Bize geri bildirimde bulunmak mı istiyorsunuz?