elif self.cmd == "off":
record('carrier', '')
record('cell', '')
- record('signal_strength','0/32')
+ record('signal_strength','-/32')
channel.disconnect()
channel.altchan.disconnect()
elif self.cmd == 'reopen':
+ record('status','')
+ record('incoming','')
+ record('carrier', '')
+ record('cell', '')
+ record('signal_strength','-/32')
+ calllog_end('incoming')
+ calllog_end('outgoing')
channel.disconnect()
channel.altchan.disconnect()
channel.connect()
if channel.last_reset + 100 < time.time():
channel.last_reset = time.time()
- channel.set_state('reset')
+ channel.set_state('refresh')
return
def data_handle(channel, line, m):
if channel.data_APN:
# We still want a connection
if failed:
- channel.set_state('reset')
+ channel.set_state('refresh')
return
elif channel.next_data_call <= time.time():
channel.next_data_call = (time.time() +
BlockSuspendAction(False),
]
+control['refresh'] = [
+ # Soft reset: just use CFUN to turn off/on
+ # also reopen to clear status and just in case.
+ AtAction(at='+CFUN=0',critical=False, retries=0),
+ BlockSuspendAction(False),
+ PowerAction('reopen'),
+ BlockSuspendAction(True),
+ AtAction(at='E0', timeout=30000),
+ ChangeStateAction('init1'),
+ ]
+
control['reset'] = [
- # turning power off just kills everything!!!
- #AtAction(at='_ORESET', critical = False),
- AtAction(at='$QCPWRDN', critical = False, retries = 0),
+ # Harder reset - use _ORESET and re-open devices.
+ # Don't block suspend if we cannot re-open.
+ AtAction(at='_ORESET', critical = False),
+ #AtAction(at='$QCPWRDN', critical = False, retries = 0),
+ BlockSuspendAction(False),
PowerAction('reopen'),
- #PowerAction('off'),
+ BlockSuspendAction(True),
AtAction(at='E0', timeout=30000),
ChangeStateAction('init1'),
]