國騰身份證閱讀器GTICR100-01termb.dll應用開發使用手冊_第1頁
國騰身份證閱讀器GTICR100-01termb.dll應用開發使用手冊_第2頁
國騰身份證閱讀器GTICR100-01termb.dll應用開發使用手冊_第3頁
國騰身份證閱讀器GTICR100-01termb.dll應用開發使用手冊_第4頁
國騰身份證閱讀器GTICR100-01termb.dll應用開發使用手冊_第5頁
已閱讀5頁,還剩17頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、第二代居民身份證閱讀器函數包使用手冊GTICR-100成都國騰2005.4第二代居民身份證閱讀器 GTICR-100函數包使用手冊文檔控制文檔更新記錄文檔編號:編制單位產品部本次修改日期:2005.04.19審核單位總工辦歷史修改累記:2審核主管技術總監地址:成都市高新西區國騰園3號樓3樓電話:(028) 87825723傳真:(028)87825734郵編:611731http: /E mail: szgt 第3頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊1 概述42 定義 43 函數列表 44 函數調用流程65 函數說明66 用戶信息函數組使用時的調用順序說明 127

2、 一個完整的示例: 131概述本手冊是操作身份證閱讀器應用函數的定義格式、調用方法和返回值的說明。1. 使用USB接口則請先安裝對應系統的USB驅動;2. termb.dll 是主 DLL, WltRS.dll 被 termb.dll 調用;用戶可不必關心 WltRS.dll 但2個DLL要求要放在同一個目錄下;3. termb.dll 和WltRS.dll同時拷貝到調用此Dll的應用軟件Exe文件所在目錄下。4. termb.dll輸出的文件放在調用者(*.exe)所在目錄;2定義應用函數開發包含在下列文件:termb.dllAPI函數的動態聯接庫(termb.dll的輸出文件放在調用者所在

3、目錄中)適用操作系統:NT 3.1版或以后版本Windows 98、Windows 2000 或以后版本及以后版本及以后版本及以后版本及以后版本Windows NT:需要Win dows:需要適用開發語言:Visual C+ 5.0Visual Basic 5.0DELPHI 3.0PowerBuilder 6.03 函數列表序號函數定義函數功能1.Int stdcall InitComm(int Port)初始化串口 ;2.int stdcall CloseComm()關閉串口 ;3.int stdcall Authe nticate()卡認證;4.int stdcall Read Co n

4、ten t(i nt Active)讀卡操作。5.int stdcall GetPeopleName(char *strTmp, int strLe n)得到姓名信息6.int stdcall GetPeopleSex(char *strTmp, int strLe n)得到性別信息:7.int stdcall GetPeopleNati on( char *strTmp, int strLe n)得到民族信息8.int stdcall GetPeopleBirthday(char *strTmp, int strLe n)得到出生日期9.int stdcall GetPeopleAddres

5、s(char *strTmp, int strLe n)得到地址信息10.int stdcall GetPeopleIDCode(char *strTmp, i nt strLe n)得到卡號信息11.int stdcall GetDepartme nt(char *strTmp, int strLe n)得到發證機關信息12.int stdcall GetStartDate(char *strTmp, i nt strLe n)得到有效啟始日期13.int stdcall GetE ndDate(char *strTmp, int strLe n)得到有效截止日期14.int _stdcal

6、l GetReserve(char *strTmp, int strLe n)得到保留信息15.int _stdcall SetBaseData(char *TxtFileName)設置基本信息16.int _stdcall SetPhotoData(char *WltFileName)設置照片WLT信息地址:成都市高新西區國騰園3號樓3樓電話:(028) 87825723傳真:(028)87825734郵編:611731http: /E mail: szgt 第7頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊地址:成都市高新西區國騰園3號樓3樓電話:(028) 87825

7、723傳真:(028)87825734郵編:611731http: /E mail: szgt 第#頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊4函數調用流程開始Jr初始化串口1r讀卡器認證1r讀卡信息1關閉串口結束地址:成都市高新西區國騰園3號樓3樓電話:(028) 87825723傳真:(028)87825734郵編:611731http: /E mail: szgt 第#頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊地址:成都市高新西區國騰園3號樓3樓電話:(028) 87825723傳真:(028)87825734郵編:611731http:

8、/E mail: szgt 第#頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊5 函數說明5.1初始化串口原型:int InitComm (int Port)說明:本函數用于計算機的設備初始化。參 數:Port:設置設備號地址:成都市高新西區國騰園3號樓3樓電話:(028) 87825723傳真:(028)87825734郵編:611731http: /E mail: szgt 第#頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊值意義1串口 12串口 23串口 34串口 4o o o16串口 161001USB11002USB21003USB31004U

9、SB4o o o1016USB16返回值:地址:成都市高新西區國騰園3號樓3樓電話:(028) 87825723傳真:(028)87825734郵編:611731http: /E mail: szgt 第9頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊值意義值意義地址:成都市高新西區國騰園3號樓3樓電話:(028) 87825723傳真:(028)87825734郵編:611731http: /E mail: szgt 第#頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊1正確其它錯誤示 例:#in elude <termb.h> int ma

10、i n()int li_ret=0;int li_Port=1;li_ret=I ni tComm(li_Port); return li_ret;5.2關閉串口原型:int CloseComm(void)說明:本函數用于關閉計算機已經打開的串口。參 數:無返回值:值意義1正確其它錯誤示 例:#in clude <termb.h> int mai n() int li_ret=0;li_ret= CloseComm() return li_ret;5.3卡認證原 型:int Authenticate (void)說明:本函數用于讀卡器和卡片之間的合法身份確認。參數:無返回值:值意義

11、說明1正確卡片正確放置時其它錯誤未放卡或卡片放置不正確時注意:若卡片放置后發生認證錯誤時,應移走卡片重新放置。示 例:#in elude <termb.h> int mai n()int li_ret=0;li_ret= authe nticate ()return li_ret;注意:若采用查詢方式自動判斷卡片是否放置,則間隔時間建議大于300ms。5.4讀卡操作原型:int Read_Content(int Active);說明:本函數用于通過讀卡器從非接觸卡中讀取相應信息。參數:Active 讀取信息類型Active 值意義說明1讀基本信息形成文字信息文件 WZ.TXT、相片

12、文件 XP.WLT和ZP.BMP2只讀文字信息形成文字信息文件 WZ.TXT和相片文件XP.WLT3讀最新住址信息形成最新住址文件 NEWADD.TXT5讀芯片管理號形成二進制文件 IINSNDN.bin返回值:值意義1正確0讀卡錯誤-1相片解碼錯誤-2wlt文件后綴錯誤-3wlt文件打開錯誤-4wlt文件格式錯誤-5軟件未授權-6設備連接失敗注意:1、讀完基本信息后,若需要立即讀取最新住址信息或芯片管理號,在未移走卡片的情況下可以不用卡認證;2、單獨讀取最新住址信息或芯片管理號時,需要先進行卡認證;3、若卡片放置后發生讀卡錯誤時,應移走卡片重新放置。地址:成都市高新西區國騰園3號樓3樓郵編:

13、611731電話:(028) 87825723http :/傳真:(028) 87825734E mail: szgt 第11頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊成都市高新西區國騰園3號樓3樓(028) 87825723028) 87825734郵編:611731http: /E mail: szgt 第13頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊地址電話傳真成都市高新西區國騰園3號樓3樓(028) 87825723028) 87825734郵編:611731http: /E mail: szgt 第#頁共17頁第二代居民身份證閱讀器 G

14、TICR-100函數包使用手冊文字信息采用 GB 13000的UCS-2進行存儲,各項目分配如下:項目長度(字節)說明姓名30漢字性別2代碼民族4代碼出生16年月日:YYYYMMDD住址70漢字和數字公民身份號碼36數字簽發機關30漢字有效期起始日期16年月日:YYYYMMDD有效期截止日期16年月日:YYYYMMDD 有效期為長期時存儲“長期”預留區36保留信息最新住址70漢字和數字芯片管理號分配如下:項目長度(字節)說明IIN4SN8DN165.5用戶信息函數組該組函數用于讀取當前系統緩沖中的二代證卡內信息。該組函數具有如下特點:得到的字符信息全部為 ANSI編碼方式;可以直接用來顯示;得

15、到的字符信息已經按照相關標準作了相應轉換;將性別編碼轉換成了相應的文字信息(如1-“男”),將民族編碼轉換成了相應的文字信息(如04-“藏”);該組函數返回值表示一致,含義如下:0:表示取到的字符信息不完整,增大strTmp參數分配的內存,就可完整讀出信息;用戶信息各字段的長度定義見下表)非0 :表示讀出的字節總數;用戶信息各字段的長度定義(單位:字節)姓名30性別2民族4出生日期16住址70身份號碼36簽發機關30有效啟始日期16有效截止日期16保留36A 讀取卡內姓名信息原 型:int STDCALL GetPeopleName(char *strTmp, unsigned int str

16、Len);說明:本函數用于讀取 ANSI字符編碼方式的姓名信息;參數:out strTmp 讀到的信息;in strLen 表示strTmp參數分配的內存空間大小(單位:字節)B 其他函數原型如下: 讀性別信息:int _stdcall GetPeopleSex(char *strTmp, un sig ned int strLe n); 讀民族信息:int _stdcall GetPeopleNati on( char *strTmp, un sig ned int strLe n); 讀出生日期:int _stdcall GetPeopleBirthday(char *strTmp, un

17、 sig ned int strLe n); 讀住址信息:int _stdcall GetPeopleAddress(char *strTmp, un sig ned int strLe n); 讀身份號碼:int _stdcall GetPeoplelDCode(char *strTmp, un sig ned int strLe n); 讀簽發機關:int _stdcall GetDepartme nt(char *strTmp, un sig ned int strLe n); 讀有效啟始日期:int _stdcall GetStartDate(char *strTmp, un sig

18、ned int strLe n); 讀有效截止日期:int _stdcall GetE ndDate(char *strTmp, un sig ned int strLe n); 讀保留信息:int _stdcall GetReserve(char *strTmp, un sig ned int strLe n);讀照片信息:int _stdcall GetPhotoBMP(char *Photo, unsigned int Len);5.6數據解析函數以下兩個函數主要是用在無卡狀態下解析保存在文件中的歷史二代證信息;將人員基本信息文件名(帶全路徑)通過 SetBaseData函數送入term

19、b.dll中后, 該Dll將解析人員基本信息; 外部程序可通過調用 “讀用戶信息函數組” 中的函數 得到想要的信息;將人員WLT類型的照片文件名(帶全路徑)通過SetPhoteData函數送入termb.dll后,在二代證機具聯機狀態下(不需要卡),該 dll將 WLT文件解壓成 BMP文件, 地址:成都市高新西區國騰園3號樓3樓郵編:611731電話:(028) 87825723http : /傳真:(028) 87825734E mail: szgt 外部程序可通過調用“讀用戶信息函數組”中的GetPhotoBMP函數得到BMP文件的內容信息;參數說明:in Fn ame文件的全路徑名;返

20、回值說明:1表示正確執行了功能;0表示文件已損壞,或非標準格式,或文件大小過大;A. 設置人員基本信息int _stdcall SetBaseData(char *FName);B. 設置人員照片信息;int _stdcall SetPhoteData(char *FName);6用戶信息函數組使用時的調用順序說明6. 1聯機工作狀態下:6. 2無卡時對保存在文件中的信息進行解析時:第17頁共17頁第二代居民身份證閱讀器 GTICR-100函數包使用手冊調用用戶信息函數 組中的函數;備注:上述兩種應用場景可靈活的動態切換。7一個完整的示例:DELPHI調用示例:unit Un it1;in t

21、erfaceusesWin dows. Messages, SysUtils, Classes, Graphics, Con trols, Forms, Dialogs,StdCtrls, Butto ns, ExtCtrls;typeTForm1 = class(TForm)BitBt n1: TBitBt n;Button2: TButton;Button3: TButton;Image1: TImage;procedure FormClose(Se nder: TObject; var Action: TCloseAct ion);procedure BitBt n1Click(Se n

22、der: TObject);procedure FormCreate(Sender: TObject);procedure Butto n3Click(Se nder: TObject);procedure Butto n2Click(Se nder: TObject);private Private declarati onspublic Public declarati ons en d;varForm1: TForm1;mln itComm:F un ctio n(Port:in teger):i nteger;Stdcall; mCloseComm:F un ctio n:i nteg

23、er;stdcall; mAuthe nticate:F unction:i nteger;stdcall;mRead_C on te nt:F un ctio n( Active:i nteger):i nteger;stdcall;GetName:F un ctio n(i nfo:pchar;le n:in teger):i nteger;stdcall;GetSex:F unction (i nfo:pchar;le n:i nteger):i nteger;stdcall;GetNatio n:F un ctio n(i nfo:pchar;le n:i nteger):i nteg

24、er;stdcall;GetAddress:F un cti on (i nfo:pchar;le n:i nteger):i nteger;stdcall;GetBirthday:F un ctio n(i nfo:pchar;le n:i nteger):i nteger;stdcall; GetCode:F unction (i nfo:pchar;le n:i nteger):i nteger;stdcall; GetDepartme nt:F unction (i nfo:pchar;le n:i nteger):i nteger;stdcall; GetStartDate:F un

25、ction (i nfo:pchar;le n:i nteger):i nteger;stdcall;GetE ndDate:F un ctio n(in fo:pchar;le n:i nteger):i nteger;stdcall; GetReserve:F un ctio n(i nfo:pchar;le n:in teger):i nteger;stdcall; GetPhotoBMP:F un ctio n(i nfo:pchar;le n:in teger):i nteger;stdcall; SetBaseData:F un ctio n(file name:stri ng):

26、i nteger;stdcall;SetPhotoData:F un ctio n(file name:stri ng):i nteger;stdcall;DLLHa ndle:l nteger;impleme ntati on$R *.DFMprocedure TForm1.FormCreate(Se nder: TObject);var i:i nteger;DLLPath:Stri ng;beginDLLPath:=ExtractFiledir(Applicati on. exeName);DLLPath:=DLLPath+'termb.dll'DLLHa ndle:=L

27、oadLibrary(Pchar(DLLPath);ml ni tComm:=GetProcAddress(DLLHa ndle,'l ni tComm'); mCloseComm:=GetProcAddress(DLLHa ndle,'CloseComm'); mAuthe nticate:=GetProcAddress(DLLHa ndle,'Authe nticate');mRead_Co nten t:=GetProcAddress(DLLHa ndle,'Read_Co nte nt');GetName:=GetProc

28、Address(DLLHa ndle,'GetPeopleName'); GetSex:=GetProcAddress(DLLHa ndle,'GetPeopleSex'); GetNatio n:=GetProcAddress(DLLHa ndle,'GetPeopleNatio n'); GetAddress:=GetProcAddress(DLLHa ndle,'GetPeopleAddress'); GetBirthday:=GetProcAddress(DLLHa ndle,'GetPeopleBirthday&

29、#39;); GetCode:=GetProcAddress(DLLHa ndle,'GetPeoplelDCode');地址 電話 傳真GetDepartme nt:=GetProcAddress(DLLHa ndle,'GetDepartme nt');GetStartDate:=GetProcAddress(DLLHa ndle,'GetStartDate');GetE ndDate:=GetProcAddress(DLLHa ndle,'GetE ndDate');GetReserve:=GetProcAddress(DL

30、LHa ndle,'GetReserve');GetPhotoBMP:=GetProcAddress(DLLHa ndle,'GetPhotoBMP');SetBaseData:=GetProcAddress(DLLHa ndle,'SetBaseData'); SetPhotoData:=GetProcAddress(DLLHa ndle,'SetPhotoData');en d;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);begin

31、if DLLHa ndle<> null the nfreeLibrary(DLLHa ndle);en d;procedure TForm1.BitBt n1Click(Se nder: TObject);beginmini tComm(1);sleep(1000);mAuthe nticate;sleep(2000);mRead_Co nten t(1);sleep(2000);Butto n3Click(self);Applicati on .ProcessMessages;mRead_Co nten t(2);sleep(2000);mRead_Co nten t(3);s

32、leep(1000);mRead_Co nten t(5);sleep(1000);mCloseComm;en d;procedure TForm1.Butt on 3Click(Se nder: TObject);var in fo:array1.100 of char;photo:array1.102400 of char;fileHa ndle:THa ndle;Len:i nteger;beginfillchar(i nfo,100,#0);GetName(info11,100);showmessage(i nfo);fillchar(i nfo,100,#0);GetSex(i nfo1,100);showmessage(i nfo);fillchar(i nfo,100,#0);GetNatio n( i nfo1,100);showmessage(i nfo);fillchar(i nfo,100,#0);GetAddress(i nfo1,100);showmessage(i nfo);fillchar(i nfo,100,#0);GetBirthday(i nfo1,100);showmessage(i nfo);fillchar(i nfo,100,#0);GetCo

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論