Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
    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
    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