def is_alive(self): if not BulkPipe.is_alive(self): return False self.send(str(CCID(bSeq=self.next_seq())/PC_to_RDR_XfrBlock()/APDU())) data = self.receive(100) if len(data) < 1: print "Device not responding!" return False reply = CCID(data) if reply.bSeq != self._seq: print "Sequence number mismatch %u != %u!" % (reply.bSeq, self._seq) return False if RDR_to_PC_DataBlock in reply or RDR_to_PC_SlotStatus in reply: return True print "Failed is_alive() test!" reply.show2() if Raw in reply: print self.hex_dump(str(reply[Raw])) return False
def is_alive(self): if not BulkPipe.is_alive(self): return False try: self.send(MSCCBW(ReqTag=self.next_tag())/Read10()) reply = self.read_reply() except USBException as e: print "%s in BOMSC.is_alive()!" % e return False return self.check_status(reply)
def is_alive(self): if not BulkPipe.is_alive(self): return False try: self.send(MSCCBW(ReqTag=self.next_tag()) / Read10()) reply = self.read_reply() except USBException as e: print "%s in BOMSC.is_alive()!" % e return False return self.check_status(reply)
def is_alive(self): if not BulkPipe.is_alive(self): return False try: self.send(Container()/Operation(OpCode=OpCodes["Skip"], TransactionID=0xdeadbeef)) response = self.read_response(0xdeadbeef) except USBException as e: print "%s in MTP.is_alive()!" % e return False if len(response) == 0: print "Device not responding in MTP.is_alive()!" return False return True
def is_alive(self): if not BulkPipe.is_alive(self): return False try: self.send( Container() / Operation(OpCode=OpCodes["Skip"], TransactionID=0xdeadbeef)) response = self.read_response(0xdeadbeef) except USBException as e: print "%s in MTP.is_alive()!" % e return False if len(response) == 0: print "Device not responding in MTP.is_alive()!" return False return True
def is_alive(self): if not BulkPipe.is_alive(self): return False self.send(QCDMFrame()/Command(code=0)) res = self.receive_response() if QCDMFrame not in res: print "Device not responding to DIAG commands!" print self.hex_dump(str(res)) return False if ord(str(res.payload)[0]) == 0: return True print "Device responed in an unexpected way!" print self.hex_dump(str(res.payload)) return False
def is_alive(self): if not BulkPipe.is_alive(self): return False self.send(QCDMFrame() / Command(code=0)) res = self.receive_response() if QCDMFrame not in res: print "Device not responding to DIAG commands!" print self.hex_dump(str(res)) return False if ord(str(res.payload)[0]) == 0: return True print "Device responed in an unexpected way!" print self.hex_dump(str(res.payload)) return False