Loading android/pandora/mmi2grpc/mmi2grpc/gatt.py +55 −3 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ import re import sys from threading import Thread from mmi2grpc._helpers import assert_description from mmi2grpc._proxy import ProfileProxy Loading Loading @@ -440,8 +441,25 @@ class GATTProxy(ProfileProxy): assert self.connection is not None handle = stringHandleToInt(re.findall("'([a0-Z9]*)'O", description)[0]) def read(): nonlocal handle self.read_response = self.gatt.ReadCharacteristicFromHandle(\ connection=self.connection, handle=handle) worker = Thread(target=read) worker.start() worker.join(timeout=30) return "OK" @assert_description def MMI_IUT_READ_TIMEOUT(self, **kwargs): """ Please wait for 30 seconds timeout to abort the procedure. Description: Verify that the Implementation Under Test (IUT) can handle timeout after send Read characteristic without receiving response in 30 seconds. """ return "OK" @assert_description Loading Loading @@ -714,8 +732,26 @@ class GATTProxy(ProfileProxy): matches = re.findall("'([a0-Z9]*)'O with <= '([a0-Z9]*)'", description) handle = stringHandleToInt(matches[0][0]) data = bytes([1]) * int(matches[0][1]) def write(): nonlocal handle nonlocal data self.write_response = self.gatt.WriteAttFromHandle(connection=self.connection,\ handle=handle, value=data) worker = Thread(target=write) worker.start() worker.join(timeout=30) return "OK" @assert_description def MMI_IUT_WRITE_TIMEOUT(self, **kwargs): """ Please wait for 30 second timeout to abort the procedure. Description: Verify that the Implementation Under Test (IUT) can handle timeout after send Write characteristic without receiving response in 30 seconds. """ return "OK" @assert_description Loading Loading @@ -765,6 +801,22 @@ class GATTProxy(ProfileProxy): handle=handle, value=data) return "OK" def _mmi_150(self, description: str, **kwargs): """ Please send an ATT_Write_Request to Client Support Features handle = 'XXXX'O to enable Multiple Handle Value Notifications. Discover all characteristics if needed. """ assert self.connection is not None handle = stringHandleToInt(re.findall("'([a0-Z9]*)'O", description)[0]) data = bytes([4]) # Multiple Handle Value Notifications self.write_response = self.gatt.WriteAttFromHandle(connection=self.connection,\ handle=handle, value=data) return "OK" def MMI_IUT_SEND_PREPARE_WRITE_GREATER_OFFSET(self, description: str, **kwargs): """ Please send prepare write request with handle = 'XXXX'O and offset Loading android/pandora/server/configs/pts_bot_tests_config.json +3 −3 Original line number Diff line number Diff line Loading @@ -233,6 +233,9 @@ "GATT/SR/GAR/BV-04-C", "GATT/SR/GAR/BV-05-C", "GATT/SR/GAR/BV-09-C", "GATT/CL/GAS/BV-05-C", "GATT/CL/GAT/BV-01-C", "GATT/CL/GAT/BV-02-C", "GATT/SR/GAW/BI-02-C", "GATT/SR/GAW/BI-03-C", "GATT/SR/GAW/BI-05-C", Loading Loading @@ -663,9 +666,6 @@ "GATT/CL/GAR/BV-03-C", "GATT/CL/GAS/BV-01-C", "GATT/CL/GAS/BV-03-C", "GATT/CL/GAS/BV-05-C", "GATT/CL/GAT/BV-01-C", "GATT/CL/GAT/BV-02-C", "GATT/CL/GAT/BV-03-C", "GATT/CL/GAW/BI-05-C", "GATT/CL/GAW/BI-06-C", Loading Loading
android/pandora/mmi2grpc/mmi2grpc/gatt.py +55 −3 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ import re import sys from threading import Thread from mmi2grpc._helpers import assert_description from mmi2grpc._proxy import ProfileProxy Loading Loading @@ -440,8 +441,25 @@ class GATTProxy(ProfileProxy): assert self.connection is not None handle = stringHandleToInt(re.findall("'([a0-Z9]*)'O", description)[0]) def read(): nonlocal handle self.read_response = self.gatt.ReadCharacteristicFromHandle(\ connection=self.connection, handle=handle) worker = Thread(target=read) worker.start() worker.join(timeout=30) return "OK" @assert_description def MMI_IUT_READ_TIMEOUT(self, **kwargs): """ Please wait for 30 seconds timeout to abort the procedure. Description: Verify that the Implementation Under Test (IUT) can handle timeout after send Read characteristic without receiving response in 30 seconds. """ return "OK" @assert_description Loading Loading @@ -714,8 +732,26 @@ class GATTProxy(ProfileProxy): matches = re.findall("'([a0-Z9]*)'O with <= '([a0-Z9]*)'", description) handle = stringHandleToInt(matches[0][0]) data = bytes([1]) * int(matches[0][1]) def write(): nonlocal handle nonlocal data self.write_response = self.gatt.WriteAttFromHandle(connection=self.connection,\ handle=handle, value=data) worker = Thread(target=write) worker.start() worker.join(timeout=30) return "OK" @assert_description def MMI_IUT_WRITE_TIMEOUT(self, **kwargs): """ Please wait for 30 second timeout to abort the procedure. Description: Verify that the Implementation Under Test (IUT) can handle timeout after send Write characteristic without receiving response in 30 seconds. """ return "OK" @assert_description Loading Loading @@ -765,6 +801,22 @@ class GATTProxy(ProfileProxy): handle=handle, value=data) return "OK" def _mmi_150(self, description: str, **kwargs): """ Please send an ATT_Write_Request to Client Support Features handle = 'XXXX'O to enable Multiple Handle Value Notifications. Discover all characteristics if needed. """ assert self.connection is not None handle = stringHandleToInt(re.findall("'([a0-Z9]*)'O", description)[0]) data = bytes([4]) # Multiple Handle Value Notifications self.write_response = self.gatt.WriteAttFromHandle(connection=self.connection,\ handle=handle, value=data) return "OK" def MMI_IUT_SEND_PREPARE_WRITE_GREATER_OFFSET(self, description: str, **kwargs): """ Please send prepare write request with handle = 'XXXX'O and offset Loading
android/pandora/server/configs/pts_bot_tests_config.json +3 −3 Original line number Diff line number Diff line Loading @@ -233,6 +233,9 @@ "GATT/SR/GAR/BV-04-C", "GATT/SR/GAR/BV-05-C", "GATT/SR/GAR/BV-09-C", "GATT/CL/GAS/BV-05-C", "GATT/CL/GAT/BV-01-C", "GATT/CL/GAT/BV-02-C", "GATT/SR/GAW/BI-02-C", "GATT/SR/GAW/BI-03-C", "GATT/SR/GAW/BI-05-C", Loading Loading @@ -663,9 +666,6 @@ "GATT/CL/GAR/BV-03-C", "GATT/CL/GAS/BV-01-C", "GATT/CL/GAS/BV-03-C", "GATT/CL/GAS/BV-05-C", "GATT/CL/GAT/BV-01-C", "GATT/CL/GAT/BV-02-C", "GATT/CL/GAT/BV-03-C", "GATT/CL/GAW/BI-05-C", "GATT/CL/GAW/BI-06-C", Loading