Home > database >  Pb9.0 and the second generation id card communication problems
Pb9.0 and the second generation id card communication problems

Time:09-18

Wants to use pb to produce a medical certificate of birth, parents need to input the id information, bought a company of the second generation id card reader, the main problem is how to achieve the interface problem of pb with this device, in order to realize the credit card id information filling automatically when the corresponding position, and ideas, please

CodePudding user response:

Ask hardware developers to interface, not to change the hardware,

CodePudding user response:

There are all sorts of language DEMO hardware developers

CodePudding user response:

General hardware vendors offer interface

CodePudding user response:

This is I used to do a project used to obtain id information,
The following is the interface of equipment provide

1. Preface
This application program interface (API) used in the verification of the second generation certificate authentication system terminal application system development,

2. System requirements
Use this API PC, must meet the following conditions:
? Windows 98, Windows 2000 Pro, Windows 2000 Server, WinXP
? At least 32 million memory (32 MB RAM or Larger)
? At least 10 million Free Disk Space (10 m Free Hard Disk Space or Larger)
? At least one spare ordinary a serial port or USB port (depending on user requirements),
3. The API list
Application function development include the following documents:
Cardapi. Lib API function of VC development kit
Cardapi. H API function declaration
Cardapi. DLL API function of dynamic link library
Dependence on stdapi. DLL cardapi. DLL dynamic link library
Dependence on WltRS. DLL cardapi. DLL dynamic link library

Serial number function name functional description
1. CheckCardReaderValid check card reader works
2. GetImagePath get save photo file path
3. GetPersonMsg to obtain the basic information of the id card
4. GetNewAddress update address information
5. ResetCardReader reset card reader

4. The API details
4.1 checkCardReaderValid

Check the card reader can work normally,
Char * checkCardReaderValid (int iPort);

Parameter description:
Int iPort
0 for automatically detecting
1-16 for a serial port 1-16 mouth
1001-1016 for USB1-16 mouth

Returns a string
value:The first character is' 1 ', said the card reader can work normally;
The first character in '0', said testing failure;
The first character immediately after testing the success or failure of product description,

4.2 getImagePath

From card. Ini gets access to save photos file path,
Char * getImagePath ();

Parameters: no

Returns a string
value:Save picture file directory path,

4.3 getPersonMsg

Read the id of the basic information,
Char * getPersonMsg (int iPort);

Parameter description:
Int iPort
0 for automatically detecting
1-16 for a serial port 1-16 mouth
1001-1016 for USB1-16 mouth


Returns a string
value:The first character is' 1 ', said success to the id card information, then immediately id information;
The first character is' 0 ', said failed to get id card information, followed by reason of the failure shortly described in Chinese;
Id information includes: name national | | | gender date of birth (format as YYYY - MM - DD) issued by institutions | | | | id number address effective starting time (YYYY - MM - DD) | effective termination time (YYYY - MM - DD or long-term), information items to characters' | 'space,
4.4 getNewAddress

Read the update address information,
Char * getNewAddress (int iPort);

Parameter description:
Int iPort
0 for automatically detecting
1-16 for a serial port 1-16 mouth
1001-1016 for USB1-16 mouth

Returns a string
value:The first character is' 1 ', said the success to update address information, then immediately address information;
The first character is' 0 ', said failed to get update address information, followed by reason of the failure shortly described in Chinese;
4.5 resetCardReader

Reset the card reader, when id stay on effective reading range of id card reader, at this time and need continuous read id information or update address information, then you need to insert reset operation between the two read operations,
Void resetCardReader (int iPort);

Parameter description:
Int iPort
0 for automatically detecting
1-16 for a serial port 1-16 mouth
1001-1016 for USB1-16 mouth return values: no

5. The API calls that
5.1 API calls order
Please first call the test card reader interface checkCardReaderValid (), card reader interface will automatically detect the current equipment designated by the port, after a successful call again read id information interface getPersonMsg (),
5.2 photo description
Photo file naming rules is: P + id number. BMP,
The default photo save the path for the currently running under the path of BMP subdirectories,
Can also be through a configuration file CARDII. INI save the specified path, CARDII. INI placed in the current running directory, content as follows, namely photos save path for d: \ CARDII \ BMP directory,
[Save]
SavePath=d: \ CardII \ BMP \
5.3 sample code

VC example code:

Variable definitions:
The static HINSTANCE DLLInst=NULL;
Definition: a function pointer
Char * (__stdcall * checkCardReaderValid) (int iPort);
Dynamic load:
DLLInst=LoadLibrary (" cardapi. DLL ");
(__stdcall checkCardReaderValid=(char * *) (int)) GetProcAddress call ((HMODULE) DLLInst, "checkCardReaderValid");
Using the function:
Ret=checkCardReaderValid (0);
After release of use:
If (DLLInst!=NULL)
FreeLibrary (DLLInst);

VB sample code:
Disclaimer:
Declare the Function checkCardReaderValid Lib "cardapi. DLL" (ByVal lPort As Long) As String
Declare the Function getImagePath Lib "cardapi. DLL () As String
Declare the Function getPersonMsg Lib "cardapi. DLL" (ByVal iPort As Long) As String
Declare the Function getNewAddress Lib "cardapi. DLL" (ByVal iPort As Long) As String
Declare Sub resetCardReader Lib "cardapi. DLL" (ByVal iPort As Long)
Use:
Dim sRtn As String
...
SRtn=checkCardReaderValid (glPortNo)


CodePudding user response:

In order to make the government is mainly related to technical department of technical support. Because of the CPU chip encryption, producers don't know

CodePudding user response:

General hardware factory has specially interface

CodePudding user response:

Manufacturers have interface function, also can download online

CodePudding user response:

General hardware factory has specially interface

CodePudding user response:

See the demo, cancelled according to demand,

CodePudding user response:

Which manufacturer model: the average score of the following is the new new
Function definitions:

//////////////////////////////////////////////////////////////////////////
//SAM port function
//
//////////////////////////////////////////////////////////////////////////
The function int Syn_SetMaxRFByte (int iPort, int ucByte, int bIfOpen) library "SynIDCardAPI. Dll
"The function int Syn_GetCOMBaud (int iPort, ref UnSignedLong puiBaudRate) library "SynIDCardAPI. Dll
"The function int Syn_SetCOMBaud (int iPort, UnSignedLong uiCurrBaud, UnSignedLong uiSetBaud) library "SynIDCardAPI. Dll
"The function int Syn_OpenPort (int iPort) library "SynIDCardAPI. Dll
"The function int Syn_ClosePort (int iPort) library "SynIDCardAPI. Dll
"nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related