MCPcopy Index your code
hub / github.com/secdev/scapy / read_all

Method read_all

scapy/layers/can.py:675–693  ·  view source on GitHub ↗

Read a specific number or all packets from a candump file. :param count: Specify a specific number of packets to be read. All packets can be read by count=-1. :return: A PacketList object containing read CAN messages

(self, count=-1)

Source from the content-addressed store, hash-verified

673 callback(p)
674
675 def read_all(self, count=-1):
676 # type: (int) -> PacketList
677 """Read a specific number or all packets from a candump file.
678
679 :param count: Specify a specific number of packets to be read.
680 All packets can be read by count=-1.
681 :return: A PacketList object containing read CAN messages
682 """
683 res = []
684 while count != 0:
685 try:
686 p = self.read_packet()
687 if p is None:
688 continue
689 except EOFError:
690 break
691 count -= 1
692 res.append(p)
693 return PacketList(res, name=os.path.basename(self.filename))
694
695 def recv(self, size=CAN_MTU):
696 # type: (int) -> Optional[Packet]

Callers 1

rdcandumpFunction · 0.45

Calls 3

read_packetMethod · 0.95
PacketListClass · 0.90
appendMethod · 0.45

Tested by

no test coverage detected