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


Python MobileDevice.actions_on_open_port方法代码示例

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

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

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

示例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
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:63,代码来源:MobileDeviceHuawei.py


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