CardReader

Forum help and suggestions to improve this forum.

Moderator: Rathinagiri

User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

If you send me the part (ej. eIDNative.prg) that is implemented with eIDNative gridding pair and between the characters
/ * you want to do * /
so that way see the steps you are doing well and correct their mistakes.

the steps are.
1 - bring readers online x list.
2 - to Seed reader x name.
3 - initialize the card.
3 - is eIDcard?
4 - first of all bring a missing data for the next step.
5 - now if. ReadAddress ()
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

Serge :
una pregunta, ¿ sabe trabajas con Classes ?
de esa forma sería trabajar mejor con eID library.

Serge:
a question, do you know working with Classes?
that way it would work better with eID library.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CardReader

Post by serge_girard »

Daniel,

I have done all the steps succesfully, except the ReadAddress function.
This because of the CLASSes which I'm not familiar with.


Thx,

Serge
There's nothing you can do that can't be done...
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

serge_girard wrote:Daniel,

I have done all the steps succesfully, except the ReadAddress function.
This because of the CLASSes which I'm not familiar with.


Thx,

Serge
Hello Serge. I've just come home.
I can tell you ReadAddress need to send a data to return the value you need (callback). so I need to know with a simple example of what you are sending to the eIDReader.dll to understand that you are missing.
that way it will be easier for me.
this is because here we do not use that kind of reader identity.

the class you need is EIDIdentity, this would return the values


Visual Basic Example :

Code: Select all

Type EIDIdentity
      CardNumber As String * EID_MAX_CARD_NUMBER_LEN
      chipNumber As String * EID_MAX_CHIP_NUMBER_LEN
      ValidityDateBegin As String * EID_MAX_DATE_BEGIN_LEN
      ValidityDateEnd As String * EID_MAX_DATE_END_LEN
      municipality As String * EID_MAX_DELIVERY_MUNICIPALITY_LEN
      nationalNumber As String * EID_MAX_NATIONAL_NUMBER_LEN
      Name As String * EID_MAX_NAME_LEN
      firstName1 As String * EID_MAX_FIRST_NAME1_LEN
      firstName2 As String * EID_MAX_FIRST_NAME2_LEN
      nationality As String * EID_MAX_NATIONALITY_LEN
      birthLocation As String * EID_MAX_BIRTHPLACE_LEN
      BirthDate As String * EID_MAX_BIRTHDATE_LEN
      Sex As String * EID_MAX_SEX_LEN
      nobleCondition As String * EID_MAX_NOBLE_CONDITION_LEN
      documentType As Long
      whiteCane As Boolean
      yellowCane As Boolean
      extendedMinority As Boolean
End Type

Code: Select all

Function ReadIDData Lib "EIDReader.dll" (ByRef Data As EIDIdentity) As Boolean

this is sent &EIDIdentity and returns all values ​​in the.


Code: Select all

Type EIDAddress
      street As String * EID_MAX_STREET_LEN
      zip As String * EID_MAX_ZIP_LEN
      municipality As String * EID_MAX_MUNICIPALITY_LEN
End Type
sends EIDAddress and returns the result in the.

Code: Select all

Function ReadAddress Lib "EIDReader.dll" (ByRef pData As EIDAddress) As Boolean
of course this must be done in Harbour so I need the font that is building in this way to prevent this issue extends far.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CardReader

Post by serge_girard »

Daniel,

This the program is as it is now:

ReadAddress is the problem and so is GetReadersList (always 0)

Code: Select all

#Include "hmg.ch"




Function main()
/**********************/
Local cSelectName := ''
Local cFunction   := ''
Local aNames      := {}
Local nLenNames   := 0


n = 0
CallDll32( 'InitReader' , 'EIDReader.dll', n )

cGetReaderName			:= space(20)
nReaderNameLen			:= 20
nIndexReaderNameLen	:= 0


CallDll32( 'GetReaderName' , 'EIDReader.dll', nIndexReaderNameLen, cGetReaderName, nReaderNameLen )
msginfo(cGetReaderName , 'GetReaderName')		// ok --> OMNIKEY CardMan 3x21 --> Correct!



lc = CallDll32('GetReadersList', 'EIDReader.dll', aNames, nLenNames )
msginfo(VALTYPE(lc)  , '1-VALTYPE-lc')		// Numeric
msginfo(str(lc,11,2) , '1-STR-lc')			// 2289604		??
nLenNames  = len(aNames)
If nLenNames = 0
   MsgInfo( ' No GetReadersList ' , ' Message Information ' )		// always 0, so this message
Endif
for a = 1 to nLenNames	// zero, so nothing
   MsgInfo( aNames[a] , ' Message Information ' )
next a



cSelectName := alltrim(cGetReaderName) 
cFunction   := 'SelectReader(0)'
msginfo(cFunction , 'cFunction')
CallDll32( cFunction , 'EIDReader.dll' )

LC = CallDll32( 'ReaderConnectedToCard' , 'EIDReader.dll' )
IF LC == -1
	msginfo('ReaderConnectedToCard : CARD present' , 'OK')		// Correct: this one is OK
ELSE
   msginfo('ReaderConnectedToCard : NO CARD present' , 'NOK')
ENDIF
 


LC = CallDll32( 'IsEIDCard' , 'EIDReader.dll' )
IF LC == -1
   msginfo('IsEIDCard' , 'OK')											// Correct: this one is OK
ELSE
   msginfo('NO IsEIDCard' , 'NOK')
ENDIF


LC = CallDll32( 'IsSISCard' , 'EIDReader.dll' )
IF LC == -1
   msginfo('IsSISCard' , 'OK')
ELSE
   msginfo('NO IsSISCard' , 'NOK')										// Correct: this one is OK
ENDIF

LC = CallDll32( 'GetReadersCount' , 'EIDReader.dll' )
msginfo(str(lc,3,0) + ' GetReadersCount' , 'OK')					// Correct: this one: 1



x		:= {'','',''}
cFunction   := 'ReadAddress("' + x[1] + '")'
msginfo(cFunction , 'cFunction')
lc := CallDll32(cFunction, 'EIDReader.dll', n ) 

msginfo(VALTYPE(lc), 'VALTYPE-lc')					// Numeric
msginfo(VALTYPE(n) , 'VALTYPE-n')					// Numeric
msginfo(VALTYPE(x) , 'VALTYPE-x')					// a 
msginfo(str(Len( x ),11,2) , 'STR(len)-x')		// 3 which is normal
msginfo(x[1] , 'x[1]')									// nothing

CallDll32("DoneReader", "EIDReader.dll")			// ok
msginfo('DoneReader' , 'ok')

Return Nil
Thanks for helping!

S
There's nothing you can do that can't be done...
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

Hi Serge:
eIDReader arm to wrap it in the papers has to work.
eIDReader.prg is the main program
eIDNative.prg is where functions and classes to connect with EIDReader.dll it fail and some features that are operated only thing to do is improve eIDNative.prg
I hope it works and will serve
eIDReader.rar
(142.96 KiB) Downloaded 345 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

danielmaximiliano wrote:Hi Serge:
eIDReader arm to wrap it in the papers has to work.
eIDReader.prg is the main program
eIDNative.prg is where functions and classes to connect with EIDReader.dll it fail and some features that are operated only thing to do is improve eIDNative.prg
I hope it works and will serve
eIDReader.rar
Serge:
if you have problems try to remove the "&" and try again

Guys, if anyone has worked with classes and can review the code if it's okay I would appreciate.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

Hola a Todos / Hi Everyone:
Agregando la interfaz grafica me encuentro que una parte del programa falla.
Adding the GUI I find that part of the program fails.
el manual de referencia dice / reference manual says :
eID Native Library C++ edition_2012-12-11_02-05-48.jpg
eID Native Library C++ edition_2012-12-11_02-05-48.jpg (37.12 KiB) Viewed 6019 times

el codigo que genera ese error es este / the code that generates the error is this

Code: Select all

/*********************************************************************/   
Procedure ReadDataCard()
/*********************************************************************/      
 Local lLogical := ReadIDDataCard(  oeIDIdentity )
  msginfo( VALTYPE( lLogical )  , 'lLogical') 
    If lLogical
       eIDReader.cReadData.Value := 'Read identity information from Belgian eID card is OK'
       /*oeIDIdentity
       */
       eIDReader.cName.Value := oeIDIdentity:cName
       SavePhotoAsJpegCard( 'image' )
	   eIDReader.eIDImage.Picture := 'image.jpg'
       
    ELSE
       msginfo('Read identity information from Belgian eID card' , 'False')
    ENDIF

Return 

la funcion es esta. / function is this.

Code: Select all

Function ReadIDDataCard( DATA )
/*===============================================================================
' Name:    Function ReadIDData
' Input:
' ByRef Data As EIDIdentity - EID Identity information
' Output:
' TRUE when information is successfully received from the card;
' otherwise returns FALSE
' Purpose:
' Read identity information from Belgian eID card
' Remarks: None
'===============================================================================*/
Return ( CallDll32( 'ReadIDData' , cDll , DATA ) )
aqui la imagen del error. / Here the image of the error.
eIDnative Library to access the Belgian Electronic Id and SIS Card.jpg
eIDnative Library to access the Belgian Electronic Id and SIS Card.jpg (71.39 KiB) Viewed 6019 times
tengo una variable NUMERICA antes que un variable LOGICA, no encuentro el error, algunas de las funciones retornan valores correctos y eso me hace perder y dudar que estoy haciendo mal.

esta es la aplicacion completa
eIDReader.rar
(188.39 KiB) Downloaded 334 times
gracias por la ayuda.

I have a numeric variable rather than a logical variable, can not find the error, some of the functions return correct values ​​and that makes me doubt lose and I'm doing wrong.

This is the complete application
[attachment = 0] eIDReader.rar [/ attachment]

thanks for the help.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: CardReader

Post by srvet_claudio »

danielmaximiliano wrote:

Code:
Function ReadIDDataCard( DATA )
/*===============================================================================
' Name:    Function ReadIDData
' Input:
' ByRef Data As EIDIdentity - EID Identity information
' Output:
' TRUE when information is successfully received from the card;
' otherwise returns FALSE
' Purpose:
' Read identity information from Belgian eID card
' Remarks: None
'===============================================================================*/
Return ( CallDll32( 'ReadIDData' , cDll , DATA ) )
Hola Daniel.
No se si será de ayuda pero la función CallDll32() no permite el paso de parámetros por referencia.
Un abrazo,
Claudio.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

srvet_claudio wrote: Hola Daniel.
No se si será de ayuda pero la función CallDll32() no permite el paso de parámetros por referencia.
Un abrazo,
Claudio.
Hola Claudio:
Como decia anteriormente, "Algunas funciones trabajan nomarmelte"

Code: Select all

/*********************************************************************/   
Procedure ReaderName()
/*********************************************************************/   
    CallDll32( 'GetReaderName' , cDll , nReaderConnect - 1 , cGetReaderName , nReaderNameLen )
    
    If  ( nReaderConnect == 1 .or.  nReaderConnect = 1 )
    
    eIDReader.cReaderName.Value := 'Reader Name : ' + cGetReaderName       
              // ok --> OMNIKEY CardMan 3x21 --> ¡¡ Correct !!
    SelectReaderCardbyNumber( nReaderConnect - 1 )
    Endif 
Return

Procedure ReaderListCard()

Return
lei un poco de c++ ayer para empaparme , sin embargo no comprendo esto
"4.- Paso de parámetros por valor y por referencia" , PDF

en Pascal trabajo comodamente pero en c++ se me complica un poco a pesar de ser estructurado los 2 no llego a comprenderlo
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Post Reply