habe lange nichts mehr von mir hören lassen aber das hat ganz eigene Gründe....
Ich programmiere momentan eine Routine zum Lesen der eGK. Oder eher versuche ich es....
Habe mich an dem im Forum zu findenden Thread orientiert.
Mir stehen zum testen ein Orga 920M (Mobilgerät) und ein Gemalto GCR 5600-D zur Verfügung.
DLL öffnen geht
CT-Init geht (anscheinend)
weitere Funktionsaufrufe (reset, request etc.) scheitern.
Habe mal den Quellcode beigefügt. Irgendwo scheine ich einen Denkfehler zu haben.....
Für Hilfe wäre ich sehr dankbar...
Gruß Stefan
Code: Alles auswählen
*** nDll := DllLoad( "ctorg32.DLL" )
nDll := DllLoad( "ct_gem.DLL" )
//** hier wird '49546216' zurckgegeben
if(nDll != 0)
//-- DLL-Init
iCtn := 1 //-- Logical card terminal number
iPN := 5 //-- Port COM1
nInit:= dllCall( nDll, DLL_STDCALL, "CT_init",iCtn, iPN)
//** Rckgabewert '0'
@ 1,0 say nInit
//-- RESET
nReturn := resetCT ( nDll, iCtn )
@ 2,0 say nReturn
//** Rckgabewert '-4096'
if nReturn=0
//-- REQUEST
nReturn := requestCT ( nDll, iCtn )
@ 3,0 say nReturn
FUNCTION resetCT ( nDll, iCtn )
LOCAL nData := 0
LOCAL cDad := 0x01 //-- destination address (receiver)
LOCAL cSad := 0x02 //-- source address (sender)
LOCAL iLenc := 127 //-- length command
LOCAL cCommand := SPACE(127) //-- ICC or CT command.
LOCAL iLenr := 1031 //-- length response
LOCAL cResponse := SPACE(1031) //-- Response to the command
cCommand := Chr(0x20)+Chr(0x11)+Chr(0x00)+Chr(0x00)+Chr(0x00)
iLenc := LEN(cCommand)
iLenr := 1031
cResponse:= replicate(Chr(0x00),iLenr)
nData:= dllCall( nDll, DLL_STDCALL, "CT_data",iCtn, @cDad, @cSad, iLenc,;
@cCommand, @iLenr, @cResponse)
if(nData == 0)
if ((iLenr >= 2).And.(iLenr <= 1031)).And.;
(cResponse[iLenr-1] == Chr(0x90) ).And.;
(cResponse[iLenr] == Chr(0x00) )
cLog := cLog + "STATE: RESET CT successful!"+cEol
//? "STATE: RESET CT successful!"
else
cLog := cLog + "STATE: RESET CT unsuccessful!"+cEol
//? "STATE: RESET CT unsuccessful!"
endif
endif
@ 5,0 say clog
RETURN nData
FUNCTION requestCT ( nDll, iCtn )
LOCAL nData := 0
LOCAL cDad := 0x01 //-- destination address (receiver)
LOCAL cSad := 0x02 //-- source address (sender)
LOCAL iLenc := 127 //-- length command
LOCAL cCommand := SPACE(127) //-- ICC or CT command.
LOCAL iLenr := 1031 //-- length response
LOCAL cResponse := SPACE(1031) //-- Response to the command
cCommand := Chr(0x20)+Chr(0x12)+Chr(0x01)+Chr(0x00)
iLenc := LEN(cCommand)
iLenr := 1031
cResponse:= replicate(Chr(0x00),iLenr)
nData:= dllCall( nDll, DLL_STDCALL, "CT_data",iCtn, @cDad, @cSad, iLenc,;
@cCommand, @iLenr, @cResponse)
RETURN nData