Exemplo n.º 1
0
 def processResult(self, errorCode, text):
   if isinstance(super(checkModemFwVer,self).processResult(errorCode,text), opResultSuccess):
     if text.find(self.version) >= 0:
       self.printToLog ('Modem firmware version matches expected value', 5)
       return opResultSuccess()
     else:
       self.printToLog ('FAIL: Modem firmware version does not match %s' % self.version, 0)
       return opResultUnexpected()
   else:
     self.printToLog ('FAIL: Unable to get modem firmware version', 0 )
     return opResultUnexpected()
Exemplo n.º 2
0
 def processResult(self, errorCode, text):
     if super(readPCID, self).processResult(errorCode, text):
         str_pcid = text.strip().split('\n')
         if len(str_pcid) < 2:
             self.printToLog('FAIL: Unable to get modem PCID', 0)
             return opResultUnexpected()
         else:
             pcid = str_pcid[2].strip()
             pcid_len = len(pcid)
             mdm_pcid = pcid[8:pcid_len]
             self.printToLog('Modem PCID: %s' % (mdm_pcid), 1)
             return opResultSuccess()
     else:
         self.printToLog('FAIL: Unable to get modem PCID', 0)
         return opResultUnexpected()
Exemplo n.º 3
0
 def processResult(self, errorCode, text):
     if isinstance(
             super(readModemFwVer, self).processResult(errorCode, text),
             opResultSuccess):
         str_fw = text.split('\n')
         if len(str_fw) < 4:
             self.printToLog('FAIL: Unable to get modem firmware version',
                             0)
             return opResultUnexpected()
         else:
             self.printToLog('Modem firmware version: %s' % (str_fw[4]), 1)
             return opResultSuccess()
     else:
         self.printToLog('FAIL: Unable to get modem firmware version', 0)
         return opResultUnexpected()
Exemplo n.º 4
0
 def do(self):
     if not hasattr(self.factoryStation, 'fuseImage'):
         self.printToLog('WARNING: Fuse image not provided', 0)
         return opResultUnexpected()
     else:
         self.ATcmd = 'AT%IFUSEIMAGE=' + self.factoryStation.fuseImage
         return super(modemFusing, self).do()
Exemplo n.º 5
0
 def processResult(self, errorCode, atReply):  # if bad result, do retries
     result = super(sendATCommand, self).processResult(errorCode, atReply)
     if isinstance(result,
                   opResultSuccess) and atReply.find(self.ATcmd) >= 0:
         return result
     else:
         return opResultUnexpected()
Exemplo n.º 6
0
 def processResult(self, errorCode, text):
     if isinstance(
             super(readModemFwId, self).processResult(errorCode, text),
             opResultSuccess):
         str_fwid = text.split('\n')
         if len(str_fwid) < 2:
             self.printToLog('FAIL: Unable to get modem firmware id', 0)
             return opResultUnexpected()
         else:
             mdm_fwid = str_fwid[1]
             fwid_len = len(mdm_fwid)
             mdm_fwid = mdm_fwid[11:fwid_len]
             self.printToLog('Modem firmware ID: %s' % (mdm_fwid), 1)
             return opResultSuccess()
     else:
         self.printToLog('FAIL: Unable to get modem firmware id', 0)
         return opResultUnexpected()
Exemplo n.º 7
0
    def processResult(self, errorCode, gotExpectedOutput, reply):
        if not errorCode == 0:
            if errorCode > 0:
                self.printToLog('FAIL:' + hex(errorCode), 0)
            else:
                self.printToLog('FAIL:' + hex(errorCode & 0xffffffff), 0)
            return opResultUnexpected()

        return opResultSuccess()
Exemplo n.º 8
0
    def processResult(self, errorCode, text=''):
        '''Return a operationResult object'''
        result = opResultSuccess()
        if errorCode == -1:
            result = opResultSubprocessFail()
        if not text.find(self.successKeyword) >= 0:
            result = opResultUnexpected()

        return result
Exemplo n.º 9
0
    def do(self):  # might not know full AT command until "do()" time
        self.args = [self.ATtool, self.ATcmd]
        for i in range(self.attempts):
            self.printToLog('Retrying...', 3) if not (i == 0) else None

            result = super(sendATCommand, self).do()
            if not isinstance(result, opResultSuccess):
                time.sleep(5)
            else:
                return result

        return opResultUnexpected()