def to_bytearray(self):
        """
        Convert this frame into its bytearray representation.

        :return: bytearray representation of this frame.
        """
        header = bytearray(struct.pack(
            '>HHHBB',
            self.transaction_id,
            self.protocol_id,
            self.length,
            self.unit_id,
            self.fcode
        ))
        return header + self.data
def to_bytearray ( self ) : header = bytearray ( struct . pack ( '>HHHBB' , self . transaction_id , self . protocol_id , self . length , self . unit_id , self . fcode ) ) return header + self . data
Convert this frame into its bytearray representation.

        :return: bytearray representation of this frame.