

Then AddLogMemo ( 'SCardDisconnect succeeded.' ) else AddLogMemo ( 'SCardDisconnect failed: ' + PCSCErrorToString (PCSCResult )) // Release context SCardDisconnect (hCard, SCARD_LEAVE_CARD ) if PCSCResult = SCARD_S_SUCCESS OutString := outString + chr (outBuffer ) AddLogMemo (outString ) // Disconnect OutString := '' for i := 0 to outSize - 3 do Then AddLogMemo ( 'SCardTransmit succeeded.' ) else AddLogMemo ( 'SCardTransmit failed: ' + PCSCErrorToString (PCSCResult )) SetLength (outBuffer, outSize ) AddLogMemo ( 'Received (' + IntToStr (outSize ) + ' bytes): ' + BufferToHexString (outBuffer )) InBuffer := HexStringToBuffer ( '00 00 00 00' ) Then AddLogMemo ( 'SCardTransmit succeeded.' ) else AddLogMemo ( 'SCardTransmit failed: ' + PCSCErrorToString (PCSCResult )) SetLength (outBuffer, outSize ) AddLogMemo ( 'Received (' + IntToStr (outSize ) + ' bytes): ' + BufferToHexString (outBuffer )) // Send test command

SCardTransmit (hCard, pioSendPCI, Pointer (inBuffer ), length (inBuffer ), pioRecvPCI, Pointer (outBuffer ), outSize ) if PCSCResult = SCARD_S_SUCCESS OutSize := 258 SetLength (outBuffer, outSize )

PioRecvPCI := nil if dwActiveProtocol = SCARD_PROTOCOL_T0 Then AddLogMemo ( 'SCardConnect succeeded.' ) else AddLogMemo ( 'SCardConnect failed: ' + PCSCErrorToString (PCSCResult )) // Send Select Applet command SCARD_PROTOCOL_Tx, hCard, dwActiveProtocol ) if PCSCResult = SCARD_S_SUCCESS SCardConnect (hContext, pReaders, SCARD_SHARE_SHARED , Then AddLogMemo ( 'SCardListReaders succeeded.' ) else AddLogMemo ( 'SCardListReaders failed: ' + PCSCErrorToString (PCSCResult )) // Use the first readerĪddLogMemo ( 'Using: ' + pReaders ) // Connect to the card SCardListReaders (hContext, nil, pReaders, SizeReaders ) if PCSCResult = SCARD_S_SUCCESS Then AddLogMemo ( 'SCardListReaders succeeded.' ) else AddLogMemo ( 'SCardListReaders failed: ' + PCSCErrorToString (PCSCResult )) GetMem (pReaders, SizeReaders ) SCardListReaders (hContext, nil, nil, SizeReaders ) if PCSCResult = SCARD_S_SUCCESS Then AddLogMemo ( 'SCardEstablishContext succeeded.' ) else AddLogMemo ( 'SCardEstablishContext failed: ' + PCSCErrorToString (PCSCResult )) // List readers SCardEstablishContext (SCARD_SCOPE_SYSTEM, nil, nil, hContext ) if PCSCResult = SCARD_S_SUCCESS

PioSendPCI, pioRecvPCI : pSCardIORequest įPCSCRaw. MD_PCSCRaw, MD_PCSCDef, MD_Tools type procedure TForm1. You copy the files MD_Events.pas, MD_PCSC.pas, MD_PCSCDef.pas, MD_PCSCRaw.pas and MD_Tools.pas.Ĭlasses, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls ,
Lazarus free pascal lazarus project file license#
In general it is a bad idea to re-invent a new license text. For example the terms of use does not explicitly allow modification of the source code, and the use is allowed only for legal purpose. The terms of use is different from the license available on the github project. The Pascal PC/SC Sample is freeware and can be used for any purpose.īy downloading the Pascal PC/SC Sample you agree to the terms of use. The license is custom but could be enough. I reported the issue at Fix build on GNU/Linux: CheckOSError() is for Windows.
Lazarus free pascal lazarus project file code#
Unfortunately the more recent version has Windows specific code and can't be used on GNU/Linux. This program is also available at in a more recent version. I found a Pascal PC/SC Sample code for PCSC with Lazarus at. It has variety of components ready for use and a graphical form designer to easily create complex graphical user interfaces. Lazarus is a Delphi compatible cross-platform IDE for Rapid Application Development. Here is a new PCSC sample in Free Pascal language I promised in PC/SC sample in different languages.
