def mavlink_packet(self, m):
        '''handle an incoming mavlink packet'''
        if m.get_type() == 'SERIAL_CONTROL':
            data = m.data[:m.count]
            if m.count > 0:
                s = ''.join(str(chr(x)) for x in data)
                if self.mpstate.system == 'Windows':
                    # strip nsh ansi codes
                    s = s.replace("\033[K","")
                sys.stdout.write(s)
                self.last_packet = time.time()
def mavlink_packet ( self , m ) : if m . get_type ( ) == 'SERIAL_CONTROL' : data = m . data [ : m . count ] if m . count > 0 : s = '' . join ( str ( chr ( x ) ) for x in data ) if self . mpstate . system == 'Windows' : s = s . replace ( "\033[K" , "" ) sys . stdout . write ( s ) self . last_packet = time . time ( )
handle an incoming mavlink packet