code: def mavlink_packet(self, m):
          '''handle a mavlink packet'''
          mtype = m.get_type()
          if mtype == "DEVICE_OP_READ_REPLY":
              if m.result != 0:
                  print("Operation %u failed: %u" % (m.request_id, m.result))
              else:
                  print("Operation %u OK: %u bytes" % (m.request_id, m.count))
                  self.read_show_reply(m)
  
          if mtype == "DEVICE_OP_WRITE_REPLY":
              if m.result != 0:
                  print("Operation %u failed: %u" % (m.request_id, m.result))
              else:
                  print("Operation %u OK" % m.request_idf mavlink_packet(self, m):
          '''handle a mavlink packet'''
          mtype = m.get_type()
          if mtype == "DEVICE_OP_READ_REPLY":
              if m.result != 0:
                  print("Operation %u failed: %u" % (m.request_id, m.result))
              else:
                  print("Operation %u OK: %u bytes" % (m.request_id, m.count))
                  self.read_show_reply(m)
  
          if mtype == "DEVICE_OP_WRITE_REPLY":
              if m.result != 0:
                  print("Operation %u failed: %u" % (m.request_id, m.result))
              else:
                  print("Operation %u OK" % m.request_id)
docs: handle a mavlink packet