本文整理匯總了Python中MobileDevice.MobileDevice.set_mode_domain方法的典型用法代碼示例。如果您正苦於以下問題:Python MobileDevice.set_mode_domain方法的具體用法?Python MobileDevice.set_mode_domain怎麽用?Python MobileDevice.set_mode_domain使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MobileDevice.MobileDevice
的用法示例。
在下文中一共展示了MobileDevice.set_mode_domain方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: set_mode_domain
# 需要導入模塊: from MobileDevice import MobileDevice [as 別名]
# 或者: from MobileDevice.MobileDevice import set_mode_domain [as 別名]
def set_mode_domain(self, mode, domain):
rmode = None
rdomain = None
if mode == CARD_TECH_SELECTION_GPRS :
rmode = "1"
elif mode == CARD_TECH_SELECTION_UMTS :
rmode = "2"
elif mode == CARD_TECH_SELECTION_GRPS_PREFERED :
rmode = "1"
elif mode == CARD_TECH_SELECTION_UMTS_PREFERED :
rmode = "2"
elif mode == CARD_TECH_SELECTION_AUTO :
rmode = "0"
else:
rmode = "0"
if domain == CARD_DOMAIN_CS:
rdomain = "0"
elif domain == CARD_DOMAIN_PS:
rdomain = "1"
elif domain == CARD_DOMAIN_CS_PS :
rdomain = "2"
elif domain == CARD_DOMAIN_ANY:
rdomain = "2"
else:
rdomain = "2"
res = self.send_at_command("AT$NWRAT=%s,%s" % (rmode, rdomain))
self.dbg_msg ("SET DOMAIN : %s" % res)
MobileDevice.set_mode_domain(self, mode, domain)
示例2: set_mode_domain
# 需要導入模塊: from MobileDevice import MobileDevice [as 別名]
# 或者: from MobileDevice.MobileDevice import set_mode_domain [as 別名]
def set_mode_domain(self, mode, domain):
if mode == CARD_TECH_SELECTION_GPRS :
res = self.send_at_command("AT!SELRAT=02")
elif mode == CARD_TECH_SELECTION_UMTS :
res = self.send_at_command("AT!SELRAT=01")
elif mode == CARD_TECH_SELECTION_GRPS_PREFERED :
res = self.send_at_command("AT!SELRAT=04")
elif mode == CARD_TECH_SELECTION_UMTS_PREFERED :
res = self.send_at_command("AT!SELRAT=03")
elif mode == CARD_TECH_SELECTION_AUTO :
res = self.send_at_command("AT!SELRAT=00")
else:
self.dbg_msg ("SET MODE DOMAIN : CRASH")
return False
self.dbg_msg ("SET MODE : %s" % res)
if domain == CARD_DOMAIN_CS:
real_domain = 00
elif domain == CARD_DOMAIN_PS:
real_domain = 01
elif domain == CARD_DOMAIN_CS_PS :
real_domain = 02
elif domain == CARD_DOMAIN_ANY:
real_domain = 02
else:
real_domain = 02
res = self.send_at_command("AT!SELMODE=%s" % real_domain)
self.dbg_msg ("SET DOMAIN : %s" % res)
MobileDevice.set_mode_domain(self, mode, domain)
示例3: set_mode_domain
# 需要導入模塊: from MobileDevice import MobileDevice [as 別名]
# 或者: from MobileDevice.MobileDevice import set_mode_domain [as 別名]
def set_mode_domain(self, mode, domain):
if domain == CARD_DOMAIN_CS:
real_domain = 0
elif domain == CARD_DOMAIN_PS:
real_domain = 1
elif domain == CARD_DOMAIN_CS_PS :
real_domain = 2
elif domain == CARD_DOMAIN_ANY:
real_domain = 3
else:
real_domain = 2
if mode == CARD_TECH_SELECTION_GPRS :
res = self.send_at_command("AT^SYSCFG=13,0,3FFFFFFF,1,%s" % real_domain)
elif mode == CARD_TECH_SELECTION_UMTS :
res = self.send_at_command("AT^SYSCFG=14,0,3FFFFFFF,1,%s" % real_domain)
elif mode == CARD_TECH_SELECTION_GRPS_PREFERED :
res = self.send_at_command("AT^SYSCFG=2,1,3FFFFFFF,1,%s" % real_domain)
elif mode == CARD_TECH_SELECTION_UMTS_PREFERED :
res = self.send_at_command("AT^SYSCFG=2,2,3FFFFFFF,1,%s" % real_domain)
elif mode == CARD_TECH_SELECTION_AUTO :
res = self.send_at_command("AT^SYSCFG=2,0,3FFFFFFF,1,%s" % real_domain)
else:
self.dbg_msg ("SET MODE DOMAIN : CRASH")
return False
if res[2] == 'OK' :
self.dbg_msg ("SET MODE DOMAIN : %s" % res)
MobileDevice.set_mode_domain(self, mode, domain)
return True
else:
self.dbg_msg ("SET MODE DOMAIN (CRASH) : %s" % res)
return False
示例4: set_mode_domain
# 需要導入模塊: from MobileDevice import MobileDevice [as 別名]
# 或者: from MobileDevice.MobileDevice import set_mode_domain [as 別名]
def set_mode_domain(self, mode, domain):
res = self.send_at_command("AT_OPSYS=%s,%s" % (mode,domain))
if res[2] == 'OK' :
self.dbg_msg ("SET MODE DOMAIN : %s" % res)
MobileDevice.set_mode_domain(self, mode, domain)
return True
else:
self.dbg_msg ("SET MODE DOMAIN (CRASH) : %s" % res)
return False
示例5: set_mode_domain
# 需要導入模塊: from MobileDevice import MobileDevice [as 別名]
# 或者: from MobileDevice.MobileDevice import set_mode_domain [as 別名]
def set_mode_domain(self, mode, domain):
if domain == CARD_DOMAIN_CS:
real_domain = 0
elif domain == CARD_DOMAIN_PS:
real_domain = 1
elif domain == CARD_DOMAIN_CS_PS :
real_domain = 2
else:
self.dbg_msg ("SET DOMAIN : (CRASH)")
return False
res = self.send_at_command("AT+ZCSPS=%s" % real_domain)
if res[2] == 'OK' :
self.dbg_msg ("SET DOMAIN : %s" % res)
else:
self.dbg_msg ("SET DOMAIN (CRASH) : %s" % res)
return False
if mode == CARD_TECH_SELECTION_GPRS :
res = self.send_at_command("AT+ZSNT=1,0,0")
elif mode == CARD_TECH_SELECTION_UMTS :
res = self.send_at_command("AT+ZSNT=2,0,0")
elif mode == CARD_TECH_SELECTION_GRPS_PREFERED :
res = self.send_at_command("AT+ZSNT=0,0,1")
elif mode == CARD_TECH_SELECTION_UMTS_PREFERED :
res = self.send_at_command("AT+ZSNT=0,0,2")
elif mode == CARD_TECH_SELECTION_AUTO :
res = self.send_at_command("AT+ZSNT=0,0,0")
else:
self.dbg_msg ("SET MODE : CRASH")
return False
if res[2] == 'OK' :
self.dbg_msg ("SET MODE : %s" % res)
MobileDevice.set_mode_domain(self, mode, domain)
return True
else:
self.dbg_msg ("SET MODE (CRASH) : %s" % res)
return False