###
# location
# when service, monitor cellid etc.
+
+# CREG? -> CREG:N,M
+# Async is _CREG: M,lac,cellid
+# N is 0=GSM, 1=GSM compact, 2=UTRAN, 3=GSM/EPGRS, 4=UTRAN/HSDPA
+# 5=UTRAN/HSUPA 6=UTRAN/HSDUPA, 7=EUTRAN
+# I seem to get '2'.
+# M is 0=notreg, 1=home-net 2=searching, 3=denied, 4=unknown,
+# 5=roaming 6=home/SMS-only 7=roam/SMS-only 8=emergency only
+# 9=CSFB-not-preferred home net 10=CSFB-not-prefered roaming
+
class Cellid(Engine):
def __init__(self):
Engine.__init__(self)
return False
def async(self, line):
- m = re.match('\+CREG: ([012])(,"([^"]*)","([^"]*)")?$', line)
+ m = re.match('\+CREG: ([0125])(,"([^"]*)","([^"]*)")?$', line)
if m:
- if m.group(1) == '1' and m.group(2):
+ if m.group(1) in ['1','5'] and m.group(2):
self.record(m)
self.retry()
if m.group(1) == '0':