def apdu(self, pdu): ret = self.__trancieve("t%.2x1f02%s"%(len(pdu) + 1, bin2asc(pdu))) bin = asc2bin(ret) if len(bin) < 4: raise ACG_IOError("Bad PDU response: %s"%ret) bin = bin[2:] return (bin[:-2], ord(bin[-2:-1]), ord(bin[-1:]))
def multi_select(self): uid = self.__serio.tx("m\r") uid = self.__rx('m\r') ret = [] while len(uid) > 2: t = self.__parse_tag("m\r", asc2bin(uid)) ret.append(t) uid = self.__rx('m\r') return ret
def continuous_read(self): if not self.__cont_read: self.__serio.tx("c") self.__cont_read = True uid = self.__rx('c') if uid == 'S': self.__cont_read = False return None return self.__parse_tag('c', asc2bin(uid))
def select(self, stag = None): if stag == None: cmd = "s" else: cmd = "m%s\r"%stag.serial_str uid = asc2bin(self.__trancieve(cmd)) t = self.__parse_tag(cmd, uid) if stag != None and t != stag: raise ACG_NoTagInField return t