(self, data, seq_num, chan_num)
Split data array into Blocksat Packet(s)

        An API message may be sent over multiple packet in case its length
        exceeds the maximum UDP payload. This function splits the message into
        packets and saves all the generated Blocksat Packets into the internal
        fragment map.

        Args:
            data     : Bytes object containing the API message data
            seq_num  : API Tx sequence number (`tx_seq_num` field)
            chan_num : API channel number
Split data array into Blocksat Packet(s)
Split data array into Blocksat Packet ( s )
def split(self, data, seq_num, chan_num):
        """Split data array into Blocksat Packet(s)

        An API message may be sent over multiple packet in case its length
        exceeds the maximum UDP payload. This function splits the message into
        packets and saves all the generated Blocksat Packets into the internal
        fragment map.

        Args:
            data     : Bytes object containing the API message data
            seq_num  : API Tx sequence number (`tx_seq_num` field)
            chan_num : API channel number

        """
        assert (isinstance(data, bytes))
        n_frags = ceil(len(data) / MAX_PAYLOAD)

        logger.debug("BlocksatPktHandler: Message size: {:d} bytes\t"
                     "Fragments: {:d}".format(len(data), n_frags))

        for i_frag in range(n_frags):
            # Is this the last_fragment?
            more_frags = (i_frag + 1) < n_frags

            # Byte range of the data to send on this Blocksat packet
            s_byte = i_frag * MAX_PAYLOAD  # starting byte
            e_byte = (i_frag + 1) * MAX_PAYLOAD  # ending byte

            # Packetize
            pkt = BlocksatPkt(seq_num, i_frag, chan_num, more_frags,
                              data[s_byte:e_byte])

            # Add to fragment map
            self.append(pkt)
def split ( self , data , seq_num , chan_num ) : assert ( isinstance ( data , bytes ) ) n_frags = ceil ( len ( data ) / MAX_PAYLOAD ) logger . debug ( "BlocksatPktHandler: Message size: {:d} bytes\t" "Fragments: {:d}" . format ( len ( data ) , n_frags ) ) for i_frag in range ( n_frags ) : # Is this the last_fragment? more_frags = ( i_frag + 1 ) < n_frags # Byte range of the data to send on this Blocksat packet s_byte = i_frag * MAX_PAYLOAD # starting byte e_byte = ( i_frag + 1 ) * MAX_PAYLOAD # ending byte # Packetize pkt = BlocksatPkt ( seq_num , i_frag , chan_num , more_frags , data [ s_byte : e_byte ] ) # Add to fragment map self . append ( pkt )