summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuanhsiao Tseng <chuanhsiao@google.com>2018-12-21 16:17:32 +0800
committerChuanhsiao Tseng <chuanhsiao@google.com>2018-12-21 08:25:52 +0000
commitd546990ee1e2a4f1ee09d4a212a397de9e54ea6b (patch)
tree0e4c91cb8465d430eeb361a4dd8932528b38fc6f
parente1d516de5fa5303efe991b9ee8cbb8bca81662ba (diff)
downloadplatform_tools_test_connectivity-d546990ee1e2a4f1ee09d4a212a397de9e54ea6b.tar.gz
platform_tools_test_connectivity-d546990ee1e2a4f1ee09d4a212a397de9e54ea6b.tar.bz2
platform_tools_test_connectivity-d546990ee1e2a4f1ee09d4a212a397de9e54ea6b.zip
Set Device Name and Service UUID in the same ScanFilter
Remove line 337 and reserve line 346, it's duplicate, only need to set includeDeviceName in AdvertiseData once, make advertiser include its device name in its packets. Remove line 344 to solve that onScanResults always be triggered. Due to building two ScanFilters and making them set advertiser's device name and specified service UUID separately, scanner can match the device name or service UUID, that is, scanner can find advertiser by matching advertiser's device name, or receive other advertising packets by matching Service UUID if testing in not clean RF environment, so need to set advertise's device name and specified service UUID in the same ScanFilter. Modify line 364 due to a little mistake, format strings need to contain “replacement fields” surrounded by curly braces {}. Bug: b/111836951 Test: Run SL4A UniqueFilteringTest:test_scan_advertisement_with_device_service_uuid_filter_expect_no_events Change-Id: I6fe807543a4ff71e6186ded5f6379dce58f34c64
-rw-r--r--acts/tests/google/ble/filtering/UniqueFilteringTest.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/acts/tests/google/ble/filtering/UniqueFilteringTest.py b/acts/tests/google/ble/filtering/UniqueFilteringTest.py
index e4ad858197..3e89f033b6 100644
--- a/acts/tests/google/ble/filtering/UniqueFilteringTest.py
+++ b/acts/tests/google/ble/filtering/UniqueFilteringTest.py
@@ -31,7 +31,7 @@ from acts.test_utils.bt.bt_constants import ble_scan_settings_modes
from acts.test_utils.bt.bt_test_utils import generate_ble_advertise_objects
from acts.test_utils.bt.bt_test_utils import generate_ble_scan_objects
from acts.test_utils.bt.bt_constants import adv_succ
-from acts.test_utils.bt.bt_test_utils import batch_scan_result
+from acts.test_utils.bt.bt_constants import batch_scan_result
from acts.test_utils.bt.bt_constants import scan_result
@@ -334,14 +334,12 @@ class UniqueFilteringTest(BluetoothBaseTest):
test_result = True
service_uuid = "00000000-0000-1000-8000-00805F9B34FB"
service_mask = "00000000-0000-1000-8000-00805F9B34FA"
- self.adv_ad.droid.bleSetAdvertiseDataIncludeDeviceName(True)
self.scn_ad.droid.bleSetScanFilterServiceUuid(service_uuid,
service_mask)
self.adv_ad.droid.bleSetAdvertiseSettingsAdvertiseMode(
ble_advertise_settings_modes['low_latency'])
filter_list, scan_settings, scan_callback = generate_ble_scan_objects(
self.scn_ad.droid)
- self.scn_ad.droid.bleBuildScanFilter(filter_list)
expected_event_name = scan_result.format(scan_callback)
self.adv_ad.droid.bleSetAdvertiseDataIncludeDeviceName(True)
self.adv_ad.droid.bleSetAdvertiseDataIncludeTxPowerLevel(True)
@@ -361,7 +359,7 @@ class UniqueFilteringTest(BluetoothBaseTest):
event_info = self.scn_ad.ed.pop_event(expected_event_name,
self.default_timeout)
self.log.error(
- "Unexpectedly found an advertiser:".format(event_info))
+ "Unexpectedly found an advertiser: {}".format(event_info))
test_result = False
except Empty as error:
self.log.debug("No events were found as expected.")