Loading system/gd/cert/matchers.py +15 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,12 @@ class L2capMatchers(object): def LeConnectionParameterUpdateRequest(): return lambda packet: L2capMatchers._is_le_control_frame_with_code(packet, LeCommandCode.CONNECTION_PARAMETER_UPDATE_REQUEST) @staticmethod def LeConnectionParameterUpdateResponse( result=l2cap_packets.ConnectionParameterUpdateResponseResult. ACCEPTED): return lambda packet: L2capMatchers._is_matching_connection_parameter_update_response(packet, result) @staticmethod def CreditBasedConnectionRequest(psm): return lambda packet: L2capMatchers._is_matching_credit_based_connection_request(packet, psm) Loading Loading @@ -289,6 +295,15 @@ class L2capMatchers(object): return False return True @staticmethod def _is_matching_connection_parameter_update_response(packet, result): frame = L2capMatchers.le_control_frame_with_code( packet, LeCommandCode.CONNECTION_PARAMETER_UPDATE_RESPONSE) if frame is None: return False return l2cap_packets.ConnectionParameterUpdateResponseView( frame).GetResult() == result @staticmethod def _is_matching_credit_based_connection_request(packet, psm): frame = L2capMatchers.le_control_frame_with_code( Loading system/gd/cert/py_l2cap.py +6 −6 Original line number Diff line number Diff line Loading @@ -130,12 +130,12 @@ class PyLeL2cap(Closable): response_future, self._device, psm, self._le_l2cap_stream) def update_connection_parameter(self, conn_interval_min=0x20, conn_interval_max=0x20, conn_latency=0x20, supervision_timeout=0x20, min_ce_length=0x20, max_ce_length=0x20): conn_interval_min=0x10, conn_interval_max=0x10, conn_latency=0x0a, supervision_timeout=0x64, min_ce_length=12, max_ce_length=12): self._device.l2cap_le.SendConnectionParameterUpdate( l2cap_le_facade_pb2.ConnectionParameter( conn_interval_min=conn_interval_min, Loading system/gd/cert/py_le_acl_manager.py +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ class PyLeAclManager(Closable): remote_addr, None) def accept_connection(self): connection_complete = ConnectionCompleteCapture() connection_complete = LeConnectionCompleteCapture() assertThat(self.incoming_connection_stream).emits(connection_complete) handle = connection_complete.get().GetConnectionHandle() return PyLeAclManagerAclConnection(self.device, self.le_acl_stream, Loading system/gd/hci/acl_manager.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1441,7 +1441,7 @@ struct AclManager::impl : public security::ISecurityManagerListener { supervision_timeout, min_ce_length, max_ce_length); hci_layer_->EnqueueCommand(std::move(packet), common::BindOnce([](CommandStatusView status) { ASSERT(status.IsValid()); ASSERT(status.GetCommandOpCode() == OpCode::LE_CREATE_CONNECTION); ASSERT(status.GetCommandOpCode() == OpCode::LE_CONNECTION_UPDATE); }), handler_); } Loading system/gd/l2cap/classic/cert/l2cap_test.py +5 −3 Original line number Diff line number Diff line Loading @@ -609,7 +609,7 @@ class L2capTest(GdBaseTestClass): self.cert_l2cap.turn_on_ertm(tx_window_size=3, max_transmit=2) (dut_channel, cert_channel) = self._open_channel( scid=0x41, psm=0x33, use_ertm=True) scid=0x41, psm=0x33, mode=RetransmissionFlowControlMode.ERTM) for _ in range(4): dut_channel.send(b'abc') Loading @@ -634,7 +634,7 @@ class L2capTest(GdBaseTestClass): self.cert_l2cap.turn_on_ertm(tx_window_size=3, max_transmit=2) (dut_channel, cert_channel) = self._open_channel( scid=0x41, psm=0x33, use_ertm=True) scid=0x41, psm=0x33, mode=RetransmissionFlowControlMode.ERTM) for _ in range(4): dut_channel.send(b'abc') Loading Loading @@ -889,7 +889,9 @@ class L2capTest(GdBaseTestClass): self.dut.l2cap.OpenChannel( l2cap_facade_pb2.OpenChannelRequest( remote=self.cert_address, psm=0x33, mode=RetransmissionFlowControlMode.ERTM)) remote=self.cert_address, psm=0x33, mode=RetransmissionFlowControlMode.ERTM)) assertThat(self.cert_l2cap.get_control_channel()).emitsNone( L2capMatchers.ConfigurationRequest()) Loading Loading
system/gd/cert/matchers.py +15 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,12 @@ class L2capMatchers(object): def LeConnectionParameterUpdateRequest(): return lambda packet: L2capMatchers._is_le_control_frame_with_code(packet, LeCommandCode.CONNECTION_PARAMETER_UPDATE_REQUEST) @staticmethod def LeConnectionParameterUpdateResponse( result=l2cap_packets.ConnectionParameterUpdateResponseResult. ACCEPTED): return lambda packet: L2capMatchers._is_matching_connection_parameter_update_response(packet, result) @staticmethod def CreditBasedConnectionRequest(psm): return lambda packet: L2capMatchers._is_matching_credit_based_connection_request(packet, psm) Loading Loading @@ -289,6 +295,15 @@ class L2capMatchers(object): return False return True @staticmethod def _is_matching_connection_parameter_update_response(packet, result): frame = L2capMatchers.le_control_frame_with_code( packet, LeCommandCode.CONNECTION_PARAMETER_UPDATE_RESPONSE) if frame is None: return False return l2cap_packets.ConnectionParameterUpdateResponseView( frame).GetResult() == result @staticmethod def _is_matching_credit_based_connection_request(packet, psm): frame = L2capMatchers.le_control_frame_with_code( Loading
system/gd/cert/py_l2cap.py +6 −6 Original line number Diff line number Diff line Loading @@ -130,12 +130,12 @@ class PyLeL2cap(Closable): response_future, self._device, psm, self._le_l2cap_stream) def update_connection_parameter(self, conn_interval_min=0x20, conn_interval_max=0x20, conn_latency=0x20, supervision_timeout=0x20, min_ce_length=0x20, max_ce_length=0x20): conn_interval_min=0x10, conn_interval_max=0x10, conn_latency=0x0a, supervision_timeout=0x64, min_ce_length=12, max_ce_length=12): self._device.l2cap_le.SendConnectionParameterUpdate( l2cap_le_facade_pb2.ConnectionParameter( conn_interval_min=conn_interval_min, Loading
system/gd/cert/py_le_acl_manager.py +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ class PyLeAclManager(Closable): remote_addr, None) def accept_connection(self): connection_complete = ConnectionCompleteCapture() connection_complete = LeConnectionCompleteCapture() assertThat(self.incoming_connection_stream).emits(connection_complete) handle = connection_complete.get().GetConnectionHandle() return PyLeAclManagerAclConnection(self.device, self.le_acl_stream, Loading
system/gd/hci/acl_manager.cc +1 −1 Original line number Diff line number Diff line Loading @@ -1441,7 +1441,7 @@ struct AclManager::impl : public security::ISecurityManagerListener { supervision_timeout, min_ce_length, max_ce_length); hci_layer_->EnqueueCommand(std::move(packet), common::BindOnce([](CommandStatusView status) { ASSERT(status.IsValid()); ASSERT(status.GetCommandOpCode() == OpCode::LE_CREATE_CONNECTION); ASSERT(status.GetCommandOpCode() == OpCode::LE_CONNECTION_UPDATE); }), handler_); } Loading
system/gd/l2cap/classic/cert/l2cap_test.py +5 −3 Original line number Diff line number Diff line Loading @@ -609,7 +609,7 @@ class L2capTest(GdBaseTestClass): self.cert_l2cap.turn_on_ertm(tx_window_size=3, max_transmit=2) (dut_channel, cert_channel) = self._open_channel( scid=0x41, psm=0x33, use_ertm=True) scid=0x41, psm=0x33, mode=RetransmissionFlowControlMode.ERTM) for _ in range(4): dut_channel.send(b'abc') Loading @@ -634,7 +634,7 @@ class L2capTest(GdBaseTestClass): self.cert_l2cap.turn_on_ertm(tx_window_size=3, max_transmit=2) (dut_channel, cert_channel) = self._open_channel( scid=0x41, psm=0x33, use_ertm=True) scid=0x41, psm=0x33, mode=RetransmissionFlowControlMode.ERTM) for _ in range(4): dut_channel.send(b'abc') Loading Loading @@ -889,7 +889,9 @@ class L2capTest(GdBaseTestClass): self.dut.l2cap.OpenChannel( l2cap_facade_pb2.OpenChannelRequest( remote=self.cert_address, psm=0x33, mode=RetransmissionFlowControlMode.ERTM)) remote=self.cert_address, psm=0x33, mode=RetransmissionFlowControlMode.ERTM)) assertThat(self.cert_l2cap.get_control_channel()).emitsNone( L2capMatchers.ConfigurationRequest()) Loading