From: NeilBrown Date: Tue, 24 Mar 2015 03:52:58 +0000 (+1100) Subject: gsmd2: register engine: only CFUN if we are 'on'. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=79ba921e195df24bf908b8c69c21c807efcfcef6;p=plato.git gsmd2: register engine: only CFUN if we are 'on'. If the the GSM module should not be active - e.g. airplane mode - don't check that the modem is on when we wake up. Signed-off-by: NeilBrown --- diff --git a/gsm/gsmd2.py b/gsm/gsmd2.py index b7a5f5e..118ac50 100644 --- a/gsm/gsmd2.py +++ b/gsm/gsmd2.py @@ -606,8 +606,10 @@ class register(Engine): def wake_retry(self, handle): log("Woke!") - self.block() - at_queue('+CFUN?', self.got_wake_line, 8000) + global state + if state.on: + self.block() + at_queue('+CFUN?', self.got_wake_line, 8000) return True def got_wake_line(self, line):