def mavlink_packet(self, m):
        '''handle mavlink packets'''
        if m.get_type() == 'SYSTEM_TIME':
            if self.system_time_settings.verbose:
                print("ST: Received from (%u/%u): %s" %
                      (m.get_srcSystem(), m.get_srcComponent(), m))
        if m.get_type() == 'TIMESYNC':
            if m.tc1 == 0:
                # this is a request for a timesync response
                time_ns = time.time() * 1000000000
                time_ns += 1234
                if True or self.system_time_settings.verbose:
                    if self.system_time_settings.verbose:
                        print("ST: received timesync; sending response: %u" %
                              (time_ns))
                    self.master.mav.timesync_send(time_ns,
                                                  m.ts1)
            else:
                if m.ts1 == self.last_sent_ts1:
                    # we sent this one!
                    now_ns = time.time() * 1000000000
                    now_ns += 1234
                    if self.system_time_settings.verbose:
                        print("ST: timesync response: sysid=%u latency=%fms" %
                              (m.get_srcSystem(),
                               (now_ns-self.last_sent_ts1)/1000000.0))