本文整理汇总了Python中MobileDevice.MobileDevice.actions_on_open_port方法的典型用法代码示例。如果您正苦于以下问题:Python MobileDevice.actions_on_open_port方法的具体用法?Python MobileDevice.actions_on_open_port怎么用?Python MobileDevice.actions_on_open_port使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MobileDevice.MobileDevice
的用法示例。
在下文中一共展示了MobileDevice.actions_on_open_port方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: actions_on_open_port
# 需要导入模块: from MobileDevice import MobileDevice [as 别名]
# 或者: from MobileDevice.MobileDevice import actions_on_open_port [as 别名]
def actions_on_open_port(self):
ret = MobileDevice.actions_on_open_port(self)
if ret == False :
return False
dev = (self.dev_props["usb_device.product_id"],
self.dev_props["usb_device.vendor_id"])
self.serial.write("AT+CPMS?\r")
self.dbg_msg ("Send : AT+CPMS?")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" :
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res != "OK" :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
示例2: actions_on_open_port
# 需要导入模块: from MobileDevice import MobileDevice [as 别名]
# 或者: from MobileDevice.MobileDevice import actions_on_open_port [as 别名]
def actions_on_open_port(self):
io = MobileDeviceIO(self.get_property("data-device"))
io.open()
io.write("AT$NWDMAT=1\r")
self.dbg_msg ("Send to DATA PORT : AT$NWDMAT=1")
attempts = 5
res = io.readline()
while attempts != 0 :
self.dbg_msg ("Recv to DATA PORT: %s" % res)
if res == "OK" :
break
elif res == None :
attempts = attempts - 1
res = io.readline()
if res != "OK" :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
io.close()
return False
io.close()
ret = MobileDevice.actions_on_open_port(self)
if ret == False :
return False
self.serial.write("AT\r")
self.dbg_msg ("Send : AT")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" :
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res != "OK" :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
self.dbg_msg ("ACTIONS ON OPEN PORT END --------")
return True
示例3: actions_on_open_port
# 需要导入模块: from MobileDevice import MobileDevice [as 别名]
# 或者: from MobileDevice.MobileDevice import actions_on_open_port [as 别名]
def actions_on_open_port(self):
ret = MobileDevice.actions_on_open_port(self)
if ret == False :
return False
dev = (self.dev_props["usb_device.product_id"],
self.dev_props["usb_device.vendor_id"])
self.serial.write("ATZ\r")
self.dbg_msg ("Send : ATZ")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" :
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res != "OK" :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
self.serial.write("AT^PORTSEL=1\r")
self.dbg_msg ("Send : AT^PORTSEL=1")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" :
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res != "OK" :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
self.serial.write("AT+COPS=3,0\r")
self.dbg_msg ("Send : AT+COPS=3,0")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" or res == "ERROR" or "ERROR" in res:
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res == None :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
if dev == (0x1406,0x12d1) :
self.serial.write("AT^CURC=0\r")
self.dbg_msg ("Send : AT^CURC")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" :
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res != "OK" :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
self.dbg_msg ("ACTIONS ON OPEN PORT END --------")
return True
示例4: actions_on_open_port
# 需要导入模块: from MobileDevice import MobileDevice [as 别名]
# 或者: from MobileDevice.MobileDevice import actions_on_open_port [as 别名]
def actions_on_open_port(self):
ret = MobileDevice.actions_on_open_port(self)
if ret == False :
return False
self.serial.write("ATZ\r")
self.dbg_msg ("Send : ATZ")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" :
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res != "OK" :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
self.serial.write("AT^PORTSEL=1\r")
self.dbg_msg ("Send : AT^PORTSEL=1")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" :
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res != "OK" :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
self.serial.write("AT+COPS=3,0\r")
self.dbg_msg ("Send : AT+COPS=3,0")
attempts = 5
res = self.serial.readline()
while attempts != 0 :
self.dbg_msg ("Recv : %s" % res)
if res == "OK" or res == "ERROR" or "ERROR" in res:
break
elif res == None :
attempts = attempts - 1
res = self.serial.readline()
if res == None :
self.dbg_msg ("ACTIONS ON OPEN PORT END FAILED--------")
return False
self.dbg_msg ("ACTIONS ON OPEN PORT END --------")
return True