mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 02:06:27 +08:00
mavlink_{shell,ulog_streaming}.py: send heartbeat
This is helpful, so that a connected partner can switch from broadcasting to a 'connected' state.
This commit is contained in:
@@ -68,7 +68,18 @@ class MavlinkLogStreaming():
|
||||
''' main loop reading messages '''
|
||||
measure_time_start = timer()
|
||||
measured_data = 0
|
||||
|
||||
next_heartbeat_time = timer()
|
||||
while True:
|
||||
|
||||
# handle heartbeat sending
|
||||
heartbeat_time = timer()
|
||||
if heartbeat_time > next_heartbeat_time:
|
||||
self.debug('sending heartbeat')
|
||||
self.mav.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_GCS,
|
||||
mavutil.mavlink.MAV_AUTOPILOT_GENERIC, 0, 0, 0)
|
||||
next_heartbeat_time = heartbeat_time + 1
|
||||
|
||||
m, first_msg_start, num_drops = self.read_message()
|
||||
if m is not None:
|
||||
self.process_streamed_ulog_data(m, first_msg_start, num_drops)
|
||||
|
||||
Reference in New Issue
Block a user