code: 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(f 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()
docs: handle an incoming mavlink packet