From 9143db6e6a0a07a8dbd5f1ddff46f72cb873135a Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 12 Jan 2017 22:29:31 +1100 Subject: [PATCH] mavutil: wait_heartbeat takes a timeout --- mavutil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mavutil.py b/mavutil.py index 762a861f1..018bb1e20 100644 --- a/mavutil.py +++ b/mavutil.py @@ -389,9 +389,9 @@ def setup_logfile_raw(self, logfile, mode='w'): '''start logging raw bytes to the given logfile, without timestamps''' self.logfile_raw = open(logfile, mode=mode) - def wait_heartbeat(self, blocking=True): + def wait_heartbeat(self, blocking=True, timeout=None): '''wait for a heartbeat so we know the target system IDs''' - return self.recv_match(type='HEARTBEAT', blocking=blocking) + return self.recv_match(type='HEARTBEAT', blocking=blocking, timeout=timeout) def param_fetch_all(self): '''initiate fetch of all parameters'''