Expose new GATT Client/Server APIs through facades (2/2)
Expose new GATT Client/Server API for:
* readPhy,
* setPreferredPhy,
* onConnectionUpdated callback
Test: None
Bug: 30622771
Change-Id: I32c20d1b7c3f9d39a1f2a8fb01037541b774a940
diff --git a/acts/framework/acts/test_utils/bt/GattEnum.py b/acts/framework/acts/test_utils/bt/GattEnum.py
index 115b6c6..ec35327 100644
--- a/acts/framework/acts/test_utils/bt/GattEnum.py
+++ b/acts/framework/acts/test_utils/bt/GattEnum.py
@@ -188,4 +188,10 @@
class GattPhy(IntEnum):
PHY_LE_1M = 1
PHY_LE_2M = 2
- PHY_LE_CODED = 3
\ No newline at end of file
+ PHY_LE_CODED = 3
+
+
+class GattPhyMask(IntEnum):
+ PHY_LE_1M_MASK = 1
+ PHY_LE_2M_MASK = 2
+ PHY_LE_CODED_MASK = 4
\ No newline at end of file
diff --git a/acts/framework/acts/test_utils/bt/bt_gatt_utils.py b/acts/framework/acts/test_utils/bt/bt_gatt_utils.py
index b42cb97..79bf2cb 100644
--- a/acts/framework/acts/test_utils/bt/bt_gatt_utils.py
+++ b/acts/framework/acts/test_utils/bt/bt_gatt_utils.py
@@ -23,6 +23,7 @@
from acts.test_utils.bt.GattEnum import GattConnectionState
from acts.test_utils.bt.GattEnum import GattCharacteristic
from acts.test_utils.bt.GattEnum import GattDescriptor
+from acts.test_utils.bt.GattEnum import GattPhyMask
from acts.test_utils.bt.GattEnum import GattService
from acts.test_utils.bt.GattEnum import GattTransport
import pprint
@@ -43,7 +44,8 @@
gatt_callback = cen_ad.droid.gattCreateGattCallback()
log.info("Gatt Connect to mac address {}.".format(mac_address))
bluetooth_gatt = cen_ad.droid.gattClientConnectGatt(
- gatt_callback, mac_address, autoconnect, transport)
+ gatt_callback, mac_address, autoconnect, transport,
+ GattPhyMask.PHY_LE_1M_MASK)
expected_event = GattCbStrings.GATT_CONN_CHANGE.value.format(gatt_callback)
try:
event = cen_ad.ed.pop_event(expected_event, default_timeout)
diff --git a/acts/tests/google/ble/gatt/GattConnectTest.py b/acts/tests/google/ble/gatt/GattConnectTest.py
index d63b4d0..9834ea9 100644
--- a/acts/tests/google/ble/gatt/GattConnectTest.py
+++ b/acts/tests/google/ble/gatt/GattConnectTest.py
@@ -30,6 +30,7 @@
from acts.test_utils.bt.GattEnum import MtuSize
from acts.test_utils.bt.GattEnum import GattCbErr
from acts.test_utils.bt.GattEnum import GattCbStrings
+from acts.test_utils.bt.GattEnum import GattPhyMask
from acts.test_utils.bt.GattEnum import GattTransport
from acts.test_utils.bt.bt_gatt_utils import GattTestUtilsError
from acts.test_utils.bt.bt_gatt_utils import disconnect_gatt_connection
@@ -281,7 +282,8 @@
autoconnect = True
bluetooth_gatt = self.cen_ad.droid.gattClientConnectGatt(
gatt_callback, mac_address, autoconnect,
- GattTransport.TRANSPORT_AUTO.value)
+ GattTransport.TRANSPORT_AUTO.value,
+ GattPhyMask.PHY_LE_1M_MASK)
self.bluetooth_gatt_list.append(bluetooth_gatt)
expected_event = GattCbStrings.GATT_CONN_CHANGE.value.format(
gatt_callback)