Ich habe mich schlecht ausgedrückt.
0x00 0x00 ist die Antwort von CT_data mit den Werten aus deinem Code. Der Aufruf kehrt auch sofort erflogreich zurück, mit und ohne Karte.
CT_init liefert immer OK, egal was für eine pn ich wähle.
Entweder mache ich etwas grundsätzlich falsch, oder die ct32.dll funktioniert einfach nicht richtig.
Code: Alles auswählen
from ctypes import *
ctn = c_ushort(0)
pn = c_ushort(0)
print windll.ct32.CT_init(ctn, pn)
dad = c_ubyte(0x01)
sad = c_ubyte(0x02)
lenc = c_ushort(7)
commandType = c_ushort * 7
command = commandType(
0x20,
0x12,
0x01,
0x01,
0x01,
0x0a, # waiting time
0x00
)
lenr = c_ushort(256)
responseType = c_ubyte * 256
response = responseType()
print windll.ct32.CT_data(ctn, dad, sad, byref(lenc), command, byref(lenr), response)
for i in range(lenr.value):
print "0x%02x" % response[i],
print
print windll.ct32.CT_close(ctn)
Das ist der PythonCode mit dem ich teste mit der Ausgabe.