當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。