def _is_matching_connection_request(packet, psm): frame = L2capMatchers.control_frame_with_code( packet, CommandCode.CONNECTION_REQUEST) if frame is None: return False request = l2cap_packets.ConnectionRequestView(frame) return request.GetPsm() == psm
def _extract_connection_request(packet): frame = L2capMatchers.control_frame_with_code( packet, CommandCode.CONNECTION_REQUEST) return l2cap_packets.ConnectionRequestView(frame)