(self, udp_payload)
Unpack Blocksat Packet from UDP payload

        Args:
            udp_payload : UDP payload received via socket (bytes)

        Returns:
            Tuple with the Blocksat Packet's payload (bytes) and sequence
            number.
Unpack Blocksat Packet from UDP payload
Unpack Blocksat Packet from UDP payload
def unpack(self, udp_payload):
        """Unpack Blocksat Packet from UDP payload

        Args:
            udp_payload : UDP payload received via socket (bytes)

        Returns:
            Tuple with the Blocksat Packet's payload (bytes) and sequence
            number.

        """
        assert (isinstance(udp_payload, bytes))
        assert (len(udp_payload) >= HEADER_LEN)

        # Separate header and payload
        header = udp_payload[:HEADER_LEN]
        self.payload = udp_payload[HEADER_LEN:]

        # Parse header
        octet_0, self.chan_num, self.frag_num, self.seq_num = struct.unpack(
            HEADER_FORMAT, header)

        # Sanity check
        assert (ord(octet_0) & 1), "Not an API packet"

        # Are there more fragments coming?
        self.more_frags = bool(ord(octet_0) & ord(b'\x80'))

        logger.debug("BlocksatPkt: Seq Num: {} / Frag Num: {} / MF: {}".format(
            self.seq_num, self.frag_num, self.more_frags))
def unpack ( self , udp_payload ) : assert ( isinstance ( udp_payload , bytes ) ) assert ( len ( udp_payload ) >= HEADER_LEN ) # Separate header and payload header = udp_payload [ : HEADER_LEN ] self . payload = udp_payload [ HEADER_LEN : ] # Parse header octet_0 , self . chan_num , self . frag_num , self . seq_num = struct . unpack ( HEADER_FORMAT , header ) # Sanity check assert ( ord ( octet_0 ) & 1 ) , "Not an API packet" # Are there more fragments coming? self . more_frags = bool ( ord ( octet_0 ) & ord ( b'\x80' ) ) logger . debug ( "BlocksatPkt: Seq Num: {} / Frag Num: {} / MF: {}" . format ( self . seq_num , self . frag_num , self . more_frags ) )