]> git.neil.brown.name Git - plato.git/commitdiff
gsmd: fix the force_state command.
authorNeilBrown <neilb@suse.de>
Sat, 29 Dec 2012 20:52:02 +0000 (07:52 +1100)
committerNeilBrown <neilb@suse.de>
Sat, 29 Dec 2012 20:52:02 +0000 (07:52 +1100)
It didn't reset 'lastrun', so it didn't really work.

gsm/gsmd.py

index 06e1a0d3e5cfc0411cf1f2917b113fe66615ea0d..893d6ce0352cc6518ee7308a167022a834c1f1d0 100644 (file)
@@ -439,6 +439,7 @@ control['flight'] = [
 
 control['reset'] = [
     # turning power off just kills everything!!!
+    AtAction(at='_ORESET', critical = False),
     PowerAction('reopen'),
     #PowerAction('off'),
     AtAction(at='E0', timeout=30000),
@@ -749,6 +750,8 @@ class GsmD(AtChannel):
         log("Force state to", state);
         self.cancel_timeout()
         self.nextstate = []
+        n = len(control[state])
+        self.lastrun = n * [0]
         self.gstate = state
 
     def advance(self):