]> git.neil.brown.name Git - plato.git/commitdiff
gsmd2: register engine: only CFUN if we are 'on'.
authorNeilBrown <neil@brown.name>
Tue, 24 Mar 2015 03:52:58 +0000 (14:52 +1100)
committerNeilBrown <neil@brown.name>
Tue, 24 Mar 2015 03:52:58 +0000 (14:52 +1100)
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 <neil@brown.name>
gsm/gsmd2.py

index b7a5f5e6b35e7fd26e6f132794a3f23f5975567e..118ac5072e8bc688605f48d2d223cbdfd81d3eb3 100644 (file)
@@ -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):