def received_message(self,message): json_data = rpc.unpack(message.data) self.proxy.handler(json_data)
r.execute('UtaMsCallPsInitialize') r.execute('UtaMsSsInit') r.execute('UtaMsSimOpenReq') rpc.do_fcc_unlock(r) # disable aeroplane mode if had been FCC-locked. first and second args are probably don't-cares rpc.UtaModeSet(r, 1) r.execute('UtaMsCallPsAttachApnConfigReq', rpc.pack_UtaMsCallPsAttachApnConfigReq(cfg.apn), is_async=True) attach = r.execute('UtaMsNetAttachReq', rpc.pack_UtaMsNetAttachReq(), is_async=True) _, status = rpc.unpack('nn', attach['body']) if status == 0xffffffff: logging.info("Attach failed - waiting to see if we just weren't ready") while not r.attach_allowed: r.pump() attach = r.execute('UtaMsNetAttachReq', rpc.pack_UtaMsNetAttachReq(), is_async=True) _, status = rpc.unpack('nn', attach['body']) if status == 0xffffffff: logging.error("Attach failed again, giving up") sys.exit(1)
def received_message(self, message): json_data = rpc.unpack(message.data) self.proxy.handler(json_data)