当前位置: 首页>>代码示例>>Python>>正文


Python MobileDevice.set_mode_domain方法代码示例

本文整理汇总了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)
开发者ID:oier,项目名称:mobile-manager,代码行数:33,代码来源:MobileDeviceNovatel.py

示例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)
开发者ID:oier,项目名称:mobile-manager,代码行数:33,代码来源:MobileDeviceSierra.py

示例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
开发者ID:oier,项目名称:mobile-manager,代码行数:35,代码来源:MobileDeviceHuawei.py

示例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
开发者ID:oier,项目名称:mobile-manager,代码行数:11,代码来源:MobileDeviceOption.py

示例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
开发者ID:oier,项目名称:mobile-manager,代码行数:41,代码来源:MobileDeviceZTE.py


注:本文中的MobileDevice.MobileDevice.set_mode_domain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。