auotest: wait for a heartbeat when creating connection

until we receive a heartbeat we won't "lock on" to a target, and that has implications for validating received packets
This commit is contained in:
Peter Barker 2023-05-29 12:56:03 +10:00 committed by Peter Barker
parent 8724e222bd
commit bfaf024fc3
1 changed files with 4 additions and 0 deletions

View File

@ -7734,6 +7734,10 @@ Also, ignores heartbeats not from our target system'''
self.mav.mav.set_send_callback(self.send_message_hook, self)
self.mav.idle_hooks.append(self.idle_hook)
# we need to wait for a heartbeat here. If we don't then
# self.mav.target_system will be zero because it hasn't
# "locked on" to a target system yet.
self.wait_heartbeat()
self.set_streamrate(self.sitl_streamrate())
def show_test_timings_key_sorter(self, t):