AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

CT - Api / Chipkarten

Ein Thema von skullcrusher · begonnen am 22. Okt 2003 · letzter Beitrag vom 28. Okt 2003
Antwort Antwort
Benutzerbild von Wormid
Wormid

Registriert seit: 26. Aug 2003
Ort: Steinfurt
292 Beiträge
 
Delphi XE2 Professional
 
#1

Re: CT - Api / Chipkarten

  Alt 22. Okt 2003, 13:44
Ich riskiere hier jetzt einfach mal nen Blindschuss... ich habe kein CardTerminal und deshalb auch keine ct-api... Und da das SDK kostenpflichtig zu sein scheint, ist es irgendwie auch nicht so einfach, nähere Informationen zu bekommen.

Das was ich jetzt hier mal testweise zusammengefummelt habe, fusst alles auf Informationen aus diesem Dokument.

Delphi-Quellcode:
// Ich vermute, die Funktionen müssten so oder so ähnlich deklariert sein bzw. werden
function CT_Init(const ctn, pn: Word): ShortInt;
function CT_Data(const ctn: Word; var dad, sad: Byte; const lenc: Word; command: Pointer; var lenr: Word; response: Pointer): ShortInt;
function CT_Close(const ctn: Word): ShortInt;

procedure TestCT;
const OK = 0; // Fehlercodes stehen noch mehr im Dokument
var ctn, lenr: Word;
    dad, sad: Byte;
    command: Array of Byte;
    response: Array[0..1000] of Byte;
    Res: ShortInt;
begin
  ctn := 1;
  // Terminal 1 an Comport 2...
  if CT_Init(ctn, 2) = OK then
  begin
    sad := 2; // Source = Host
    dad := 1; // Destination = Terminal
    lenr := SizeOf(response);
    command[0] := $20; // Commandobytes
    command[1] := $12;
    {...usw...}
    Res := CT_Data(ctn, dad, sad, SizeOf(command), @command, lenr, @response);

    CT_Close(ctn);
  end;
end;
Wie gesagt, ist ein "kalt" geschriebenes Programm, da ich es nicht testen kann.
Ich hoffe, das das eher hilfreich als verwirrend ist - mich würde dann am Ende auch mal interessieren, wie weit ich denn nun daneben lag.

Gruß

Wormid
Debuggers don't remove Bugs, they only show them in Slow-Motion.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:33 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz