Esempio n. 1
0
def cardListResultHandler(result):
    if result == None or len(result) == 0:
        Executer.printOnShell("no item available")
        return
    
    i = 1
    for c in result:
        Executer.printOnShell("card "+str(i)+" : "+toHexString(c.atr) + " connected on reader <" + str(c.reader)+">")
Esempio n. 2
0
    def update( self, cardconnection, ccevent ):
        #TODO parfois l'affichage colle les bytes :/
        
        if "connect" == ccevent.type:
            Executer.printOnShell("connecting to " +str(cardconnection.getReader()))

        elif "disconnect" == ccevent.type:
            Executer.printOnShell("disconnecting from " +str(cardconnection.getReader()))

        elif "command" == ccevent.type:
            Executer.printOnShell("> "+ toHexString( ccevent.args[0] ))

        elif "response" == ccevent.type:
            if []==ccevent.args[0]:
                Executer.printOnShell("< [] " + "%-2X %-2X" % tuple(ccevent.args[-2:]))
            else:
                Executer.printOnShell("< " + toHexString(ccevent.args[0]) + "%-2X %-2X" % tuple(ccevent.args[-2:]))
Esempio n. 3
0
def cardListResultHandler(result):
    if result == None or len(result) == 0:
        Executer.printOnShell("no item available")
        return

    i = 1
    for c in result:
        Executer.printOnShell("card " + str(i) + " : " + toHexString(c.atr) +
                              " connected on reader <" + str(c.reader) + ">")
Esempio n. 4
0
    def update(self, cardconnection, ccevent):
        #TODO parfois l'affichage colle les bytes :/

        if "connect" == ccevent.type:
            Executer.printOnShell("connecting to " +
                                  str(cardconnection.getReader()))

        elif "disconnect" == ccevent.type:
            Executer.printOnShell("disconnecting from " +
                                  str(cardconnection.getReader()))

        elif "command" == ccevent.type:
            Executer.printOnShell("> " + toHexString(ccevent.args[0]))

        elif "response" == ccevent.type:
            if [] == ccevent.args[0]:
                Executer.printOnShell("< [] " +
                                      "%-2X %-2X" % tuple(ccevent.args[-2:]))
            else:
                Executer.printOnShell("< " + toHexString(ccevent.args[0]) +
                                      "%-2X %-2X" % tuple(ccevent.args[-2:]))