?? surehope_api.pas
字號:
unit surehope_api;
interface
const
SURE_HOPE_OK=0; //操作正確
SURE_HOPE_VERIFYORERROR=1; //校驗和錯誤
SURE_HOPE_NOCARD=2; //無卡
SURE_HOPE_CARDNOPOWER=3; //卡未上電
SURE_HOPE_COMERROR=4; //串口錯誤
SURE_HOPE_QUITCARDERROR=5; //退卡錯誤
SURE_HOPE_ZONEERROR=6; //區域錯誤
SURE_HOPE_PAGENUMBERERROR=7; //頁號錯誤
SURE_HOPE_ADDRESSERROR=8; //地址錯誤
SURE_HOPE_DATALENGTHERROR=9; //數據長度錯誤
SURE_HOPE_DATAERROR=10; //數據錯誤
SURE_HOPE_PASSWORDERROR=11; //密碼錯誤
SURE_HOPE_ERASEPASSWORDERROR=12; //擦除密碼錯誤
SURE_HOPE_ERASEPASSWORDCOUNTERTOZERO=13; //擦除密碼計數器為零
SURE_HOPE_CARDBAD=14; //卡損壞錯誤
SURE_HOPE_COMMANDFORMATERROR=15; //命令格式錯誤
SURE_HOPE_CARDTYPEERROR=16; //卡型錯誤
SURE_HOPE_NOMEMORY=17; //內存不足
//初始化端口,串口選擇.返回值: 0:正確; 4:串口錯誤;
function init_com(Port: integer): integer; stdcall; external 'SURE32WC.DLL';
//卡型選擇,返回值: 0:正確
function sele_card(crdno: integer): integer; stdcall; external 'SURE32WC.DLL';
//給卡上電,返回值: 0: 正確;2: 無卡;4:串口錯誤;
function power_on: integer; stdcall; external 'SURE32WC.DLL';
//卡下電, 同時退卡,返回值: 0: 正確;2: 無卡;4:串口錯誤;
function power_off: integer; stdcall; external 'SURE32WC.DLL';
//關閉串口,返回值: 0:正確; 4:串口錯誤;
function close_com: integer; stdcall; external 'SURE32WC.DLL';
//讀卡中HEX碼數據,返回值: 3: 無卡;4: 串口錯誤;9:長度超出錯誤;(apz:區號)
function rd_asc(apz, address, Length: integer; buffer: pchar): integer; stdcall;external 'SURE32WC.DLL';
//將HEX碼數據寫入卡中,返回值: 0: 正確;2: 無卡;3:未上電;4:串口錯誤;9:長度超出錯誤;
function wr_asc(apz, address, Length: integer; buffer: pchar): integer; stdcall;external 'SURE32WC.DLL';
//讀卡中ASCII碼數據,返回值: 3: 無卡;4: 串口錯誤;9:長度超出錯誤;(apz:區號)
function rd_str(apz, address, Length: integer; buffer: pchar): integer; stdcall;external 'SURE32WC.DLL';
//將ASCII碼數據寫入卡中,返回值: 0: 正確;2: 無卡;3:未上電;4:串口錯誤;9:長度超出錯誤;
function wr_str(apz, address, Length: integer; buffer: pchar): integer; stdcall;external 'SURE32WC.DLL';
//取讀寫機對卡操作的歷史狀態,返回值: 0: 正確;4:串口錯誤;
function inquire(buffer:pchar):integer;stdcall;external 'sure32wc.dll';
//用DES算法加密8字節ASCII碼或返回值: 無;
function des_str(buffer,des_str:pchar):integer;stdcall;external'sure32wc.dll';
//把用DES算法加密8字節ASCII碼密文轉換為8字節ASCII碼或明文,返回值: 無;
function undes_str(buffer,des_str:pchar):integer;stdcall;external'sure32wc.dll';
//用DES算法加密16字節HEX碼數據,返回值: 無;
function des_asc(buffer,des_str:pchar):integer;stdcall;external'sure32wc.dll';
//把用DES算法加密16字節HEX碼密文轉換為16字節HEX碼或明文,返回值: 無;
function undes_asc(buffer,des_str:pchar):integer;stdcall;external'sure32wc.dll';
//----------------以上是通用接口函數-------------------------------
//寫HEX碼數據到卡的相應單元, 若相同則保護位寫0(永久保留);
//返回值: 0: 正確;2:無卡;3:未上電;4:串口錯誤;9:長度超出錯誤;16:卡型錯誤;
function cpwr_asc(apz,address,length:integer;buffer:pchar):integer;stdcall;external'sure32wc.dll';
//寫ASCII碼數據到卡的相應單元, 若相同則保護位寫0(永久保留);
//返回值: 0: 正確;2:無卡;3:未上電;4:串口錯誤;9:長度超出錯誤;16:卡型錯誤;
function cpwr_str(apz,address,length:integer;buffer:pchar):integer;stdcall;external'sure32wc.dll';
//讀卡保護位
//返回值: 0:正確, 2:無卡;3:未上電;4:串口錯誤;9:長度超出錯誤;16:卡型錯誤;正確則返回讀出的HEX碼保護位, 每保護位對應一個字符;
function rd_pm(apz,address,length:integer;buffer:pchar):integer;stdcall;external'sure32wc.dll';
//----------------以上是SIEMENS卡專用接口函數-------------------------------
//核對密碼,返回值: 0:正確;2:無卡;3:未上電;4:串口錯誤;9:數據長度錯誤;11:密碼錯誤;14:卡已損壞;
function chk_sc(apz, length: Integer; buffer: pchar): integer; stdcall; external 'SURE32WC.DLL';
//----------------以上是所有加密卡專用接口函數----------------------------------
//讀卡密碼區(sle4442)
//返回值:0:正確; 2:無;3:未上電;4:串口錯誤;16:卡型錯誤;
//正確則返回讀出的一個字節錯碼計數和三字節密碼;
function rd_sm(password_Str: pchar): integer; stdcall; external 'SURE32WC.DLL';
//改寫密碼 (sle4428)
function wr_sc(password_Str: pchar): integer; stdcall; external 'SURE32WC.DLL';
//----------------以上是SIEMENS 4442卡專用接口函數------------------------------
implementation
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -