Commit 40a8bc327cc15f222226f68cfb7cd04b79814365
1 parent
68043366
feat(doc):添加脱机交易卡片相关文档
添加脱机交易卡片相关文档,该文档用以说明卡片相关改动。
Showing
62 changed files
with
4726 additions
and
0 deletions
Too many changes to show.
To preserve performance only 62 of 442 files are displayed.
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vb6.0/Form1.frm
0 → 100644
1 | +VERSION 5.00 | |
2 | +Begin VB.Form Form1 | |
3 | + Caption = "Form1" | |
4 | + ClientHeight = 4890 | |
5 | + ClientLeft = 60 | |
6 | + ClientTop = 450 | |
7 | + ClientWidth = 7740 | |
8 | + LinkTopic = "Form1" | |
9 | + ScaleHeight = 4890 | |
10 | + ScaleWidth = 7740 | |
11 | + StartUpPosition = 3 'Windows Default | |
12 | + Begin VB.TextBox Text4 | |
13 | + Height = 375 | |
14 | + Left = 1800 | |
15 | + TabIndex = 12 | |
16 | + Top = 600 | |
17 | + Width = 615 | |
18 | + End | |
19 | + Begin VB.TextBox Text3 | |
20 | + Height = 495 | |
21 | + Left = 2160 | |
22 | + MaxLength = 8 | |
23 | + TabIndex = 11 | |
24 | + Top = 3960 | |
25 | + Width = 4335 | |
26 | + End | |
27 | + Begin VB.ListBox List1 | |
28 | + Height = 1815 | |
29 | + Left = 2160 | |
30 | + TabIndex = 10 | |
31 | + Top = 1920 | |
32 | + Width = 4335 | |
33 | + End | |
34 | + Begin VB.TextBox Text2 | |
35 | + Height = 285 | |
36 | + Left = 5160 | |
37 | + TabIndex = 9 | |
38 | + Top = 1410 | |
39 | + Width = 615 | |
40 | + End | |
41 | + Begin VB.TextBox Text1 | |
42 | + Height = 285 | |
43 | + Left = 3360 | |
44 | + TabIndex = 7 | |
45 | + Top = 1410 | |
46 | + Width = 495 | |
47 | + End | |
48 | + Begin VB.CommandButton Command6 | |
49 | + Caption = "Exit" | |
50 | + Height = 495 | |
51 | + Left = 5880 | |
52 | + TabIndex = 5 | |
53 | + Top = 1200 | |
54 | + Width = 975 | |
55 | + End | |
56 | + Begin VB.CommandButton Command5 | |
57 | + Caption = "Write Data" | |
58 | + Height = 495 | |
59 | + Left = 960 | |
60 | + TabIndex = 4 | |
61 | + Top = 3960 | |
62 | + Width = 1095 | |
63 | + End | |
64 | + Begin VB.CommandButton Command4 | |
65 | + Caption = "Read Data" | |
66 | + Height = 495 | |
67 | + Left = 960 | |
68 | + TabIndex = 3 | |
69 | + Top = 1320 | |
70 | + Width = 1095 | |
71 | + End | |
72 | + Begin VB.CommandButton Command3 | |
73 | + Caption = "Find Multi Card" | |
74 | + Height = 495 | |
75 | + Left = 5640 | |
76 | + TabIndex = 2 | |
77 | + Top = 480 | |
78 | + Width = 1455 | |
79 | + End | |
80 | + Begin VB.CommandButton Command2 | |
81 | + Caption = "Find Single Card" | |
82 | + Height = 495 | |
83 | + Left = 3960 | |
84 | + TabIndex = 1 | |
85 | + Top = 480 | |
86 | + Width = 1575 | |
87 | + End | |
88 | + Begin VB.CommandButton Command1 | |
89 | + Caption = "Init" | |
90 | + Height = 495 | |
91 | + Left = 960 | |
92 | + TabIndex = 0 | |
93 | + Top = 480 | |
94 | + Width = 735 | |
95 | + End | |
96 | + Begin VB.Label Label3 | |
97 | + Caption = "PortNo(0~19,100)" | |
98 | + Height = 255 | |
99 | + Left = 2520 | |
100 | + TabIndex = 13 | |
101 | + Top = 600 | |
102 | + Width = 1335 | |
103 | + End | |
104 | + Begin VB.Label Label2 | |
105 | + Caption = "BlockNum(1~10)" | |
106 | + Height = 255 | |
107 | + Left = 3960 | |
108 | + TabIndex = 8 | |
109 | + Top = 1440 | |
110 | + Width = 1215 | |
111 | + End | |
112 | + Begin VB.Label Label1 | |
113 | + Caption = "StartAddr(0~27)" | |
114 | + Height = 255 | |
115 | + Left = 2160 | |
116 | + TabIndex = 6 | |
117 | + Top = 1440 | |
118 | + Width = 1215 | |
119 | + End | |
120 | +End | |
121 | +Attribute VB_Name = "Form1" | |
122 | +Attribute VB_GlobalNameSpace = False | |
123 | +Attribute VB_Creatable = False | |
124 | +Attribute VB_PredeclaredId = True | |
125 | +Attribute VB_Exposed = False | |
126 | +Dim icdev As Long | |
127 | + | |
128 | +Private Sub Command1_Click() | |
129 | +If icdev > 0 Then | |
130 | + st = dc_exit(icdev) | |
131 | + icdev = 0 | |
132 | +End If | |
133 | + | |
134 | +If icdev < 0 Then | |
135 | + icdev = dc_init(CInt(Text4.Text), 115200) 'init com1£¬baud rate is 115200MHZ | |
136 | +End If | |
137 | + | |
138 | +If icdev < 0 Then | |
139 | + List1.AddItem ("Init port Error!") | |
140 | + | |
141 | + Exit Sub | |
142 | +End If | |
143 | +List1.AddItem ("Init port OK!") | |
144 | + | |
145 | + st = dc_config_card(icdev, &H31) 'find 15693 card,&H31 can be exchanged by 49 | |
146 | + If st <> 0 Then | |
147 | + List1.AddItem ("config card Error!") | |
148 | + Exit Sub | |
149 | + End If | |
150 | +End Sub | |
151 | + | |
152 | +Private Sub Command2_Click() 'find single card | |
153 | +Dim rlen As Byte | |
154 | + st = dc_inventory_hex(icdev, &H36, 0, 0, rlen, UID) | |
155 | + If st <> 0 Then | |
156 | + | |
157 | + List1.AddItem ("Find single card ERROR!") | |
158 | + | |
159 | + Exit Sub | |
160 | + End If | |
161 | + | |
162 | + List1.AddItem (UID) | |
163 | + | |
164 | +End Sub | |
165 | + | |
166 | +Private Sub Command3_Click() 'find multi card | |
167 | +Dim rlen As Byte | |
168 | +st = dc_inventory_hex(icdev, &H16, 0, 0, rlen, UID) | |
169 | + If st <> 0 Then | |
170 | + | |
171 | + List1.AddItem ("Find multi card ERROR!") | |
172 | + | |
173 | + | |
174 | + Exit Sub | |
175 | + End If | |
176 | + List1.AddItem (UID) | |
177 | + | |
178 | +End Sub | |
179 | + | |
180 | +Private Sub Command4_Click() 'read data | |
181 | +Dim i As Integer | |
182 | +Dim rlen As Byte | |
183 | +Dim rbuffer As String * 256 | |
184 | +m = CInt(Text1.Text) 'start addresss | |
185 | +n = CInt(Text2.Text) 'block number | |
186 | +st = dc_readblock_hex(icdev, &H22, m, n, Mid(UID, 3, 16), rlen, rbuffer) 'get datas except the front one byte,two datas | |
187 | +If st <> 0 Then | |
188 | +st = dc_exit(icdev) | |
189 | + List1.AddItem ("Read data ERROR!") | |
190 | + st = dc_exit(icdev) | |
191 | + Exit Sub | |
192 | +End If | |
193 | +If m + n > 28 Then | |
194 | + n = n - ((m + n) - 28) | |
195 | +End If | |
196 | +For i = 0 To n - 1 | |
197 | + | |
198 | + List1.AddItem ("BlockAddr" & m + i & ":" & Mid(rbuffer, 1 + i * 8, 8)) | |
199 | + | |
200 | +Next i | |
201 | +End Sub | |
202 | + | |
203 | +Private Sub Command5_Click() | |
204 | +Dim rbuffer As String * 8 'write data from the start address CInt(Text1.Text) | |
205 | +rbuffer = Text3.Text | |
206 | +st = dc_writeblock_hex(icdev, &H22, CInt(Text1.Text), 1, Mid(UID, 3, 16), 4, CStr(rbuffer)) | |
207 | +If st <> 0 Then | |
208 | + st = dc_exit(icdev) | |
209 | + List1.AddItem ("Write data ERROR") | |
210 | + | |
211 | + Exit Sub | |
212 | +End If | |
213 | + List1.AddItem ("Write data OK") | |
214 | +End Sub | |
215 | + | |
216 | +Private Sub Command6_Click() 'exit | |
217 | +If icdev > 0 Then | |
218 | + st = dc_exit(icdev) | |
219 | + icdev = 0 | |
220 | + End If | |
221 | + Unload Me | |
222 | +End Sub | |
223 | + | |
224 | +Private Sub Form_Load() | |
225 | + icdev = -1 | |
226 | +End Sub | |
227 | + | |
228 | +Private Sub Form_Unload(Cancel As Integer) | |
229 | +If icdev > 0 Then | |
230 | + dc_exit (icdev) | |
231 | +End If | |
232 | + | |
233 | +End Sub | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vb6.0/Module1.bas
0 → 100644
1 | +Attribute VB_Name = "Module1" | |
2 | +Option Explicit | |
3 | +Global icdev As Long | |
4 | +Global st As Integer | |
5 | +Global UID As String * 256 | |
6 | +Declare Function dc_init Lib "dcrf32.dll" (ByVal port%, ByVal baud As Long) As Long | |
7 | +Declare Function dc_exit Lib "dcrf32.dll" (ByVal icdev As Long) As Integer | |
8 | +Declare Function dc_config_card Lib "dcrf32.dll" (ByVal icdev As Long, ByVal cardtype As Byte) As Integer | |
9 | +Declare Function dc_inventory Lib "dcrf32.dll" (ByVal icdev As Long, ByVal flags As Byte, ByVal AFI As Byte, ByVal masklen As Byte, ByRef rlen As Byte, ByVal rbuffer$) As Integer | |
10 | +Declare Function dc_inventory_hex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal flags As Byte, ByVal AFI As Byte, ByVal masklen As Byte, ByRef rlen As Byte, ByVal rbuffer$) As Integer | |
11 | +Declare Function dc_readblock Lib "dcrf32.dll" (ByVal icdev As Long, ByVal flags As Byte, ByVal startblock%, ByVal blocknum%, ByVal UID$, ByRef rlen As Byte, ByVal rbuffer$) As Integer | |
12 | +Declare Function dc_readblock_hex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal flags As Byte, ByVal startblock%, ByVal blocknum%, ByVal UID$, ByRef rlen As Byte, ByVal rbuffer$) As Integer | |
13 | +Declare Function dc_writeblock_hex Lib "dcrf32.dll" (ByVal icdev As Long, ByVal flags As Byte, ByVal startblock%, ByVal blocknum%, ByVal UID$, ByVal rlen As Byte, ByVal rbuffer$) As Integer | |
14 | +Declare Function dc_writeblock Lib "dcrf32.dll" (ByVal icdev As Long, ByVal flags As Byte, ByVal startblock%, ByVal blocknum%, ByVal UID$, ByVal rlen As Byte, ByVal rbuffer$) As Integer | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vb6.0/Project1.vbp
0 → 100644
1 | +Type=Exe | |
2 | +Form=Form1.frm | |
3 | +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation | |
4 | +Module=Module1; Module1.bas | |
5 | +IconForm="Form1" | |
6 | +Startup="Form1" | |
7 | +Command32="" | |
8 | +Name="ICODE" | |
9 | +HelpContextID="0" | |
10 | +CompatibleMode="0" | |
11 | +MajorVer=1 | |
12 | +MinorVer=0 | |
13 | +RevisionVer=0 | |
14 | +AutoIncrementVer=0 | |
15 | +ServerSupportFiles=0 | |
16 | +VersionCompanyName="KBD" | |
17 | +CompilationType=0 | |
18 | +OptimizationType=0 | |
19 | +FavorPentiumPro(tm)=0 | |
20 | +CodeViewDebugInfo=0 | |
21 | +NoAliasing=0 | |
22 | +BoundsCheck=0 | |
23 | +OverflowCheck=0 | |
24 | +FlPointCheck=0 | |
25 | +FDIVCheck=0 | |
26 | +UnroundedFP=0 | |
27 | +StartMode=0 | |
28 | +Unattended=0 | |
29 | +Retained=0 | |
30 | +ThreadPerObject=0 | |
31 | +MaxNumberOfThreads=1 | |
32 | + | |
33 | +[MS Transaction Server] | |
34 | +AutoRefresh=1 | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vb6.0/Project1.vbw
0 → 100644
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODE.clw
0 → 100644
1 | +; CLW file contains information for the MFC ClassWizard | |
2 | + | |
3 | +[General Info] | |
4 | +Version=1 | |
5 | +LastClass=CICODEDlg | |
6 | +LastTemplate=CDialog | |
7 | +NewFileInclude1=#include "stdafx.h" | |
8 | +NewFileInclude2=#include "ICODE.h" | |
9 | + | |
10 | +ClassCount=3 | |
11 | +Class1=CICODEApp | |
12 | +Class2=CICODEDlg | |
13 | +Class3=CAboutDlg | |
14 | + | |
15 | +ResourceCount=3 | |
16 | +Resource1=IDD_ABOUTBOX | |
17 | +Resource2=IDR_MAINFRAME | |
18 | +Resource3=IDD_ICODE_DIALOG | |
19 | + | |
20 | +[CLS:CICODEApp] | |
21 | +Type=0 | |
22 | +HeaderFile=ICODE.h | |
23 | +ImplementationFile=ICODE.cpp | |
24 | +Filter=N | |
25 | + | |
26 | +[CLS:CICODEDlg] | |
27 | +Type=0 | |
28 | +HeaderFile=ICODEDlg.h | |
29 | +ImplementationFile=ICODEDlg.cpp | |
30 | +Filter=D | |
31 | +BaseClass=CDialog | |
32 | +VirtualFilter=dWC | |
33 | +LastObject=IDC_EDIT3 | |
34 | + | |
35 | +[CLS:CAboutDlg] | |
36 | +Type=0 | |
37 | +HeaderFile=ICODEDlg.h | |
38 | +ImplementationFile=ICODEDlg.cpp | |
39 | +Filter=D | |
40 | + | |
41 | +[DLG:IDD_ABOUTBOX] | |
42 | +Type=1 | |
43 | +Class=CAboutDlg | |
44 | +ControlCount=4 | |
45 | +Control1=IDC_STATIC,static,1342177283 | |
46 | +Control2=IDC_STATIC,static,1342308480 | |
47 | +Control3=IDC_STATIC,static,1342308352 | |
48 | +Control4=IDOK,button,1342373889 | |
49 | + | |
50 | +[DLG:IDD_ICODE_DIALOG] | |
51 | +Type=1 | |
52 | +Class=CICODEDlg | |
53 | +ControlCount=14 | |
54 | +Control1=IDCANCEL,button,1342242816 | |
55 | +Control2=IDC_BUTTON1,button,1342242816 | |
56 | +Control3=IDC_FIND_SINGLE,button,1342242816 | |
57 | +Control4=IDC_FIND_MULTI,button,1342242816 | |
58 | +Control5=IDC_READ,button,1342242816 | |
59 | +Control6=IDC_WRITE,button,1342242816 | |
60 | +Control7=IDC_LIST1,listbox,1352728833 | |
61 | +Control8=IDC_EDIT1,edit,1350631552 | |
62 | +Control9=IDC_EDIT2,edit,1350566016 | |
63 | +Control10=IDC_start,static,1342308352 | |
64 | +Control11=IDC_STATIC,static,1342177280 | |
65 | +Control12=IDC_EDIT3,edit,1350631552 | |
66 | +Control13=IDC_EDIT4,edit,1350631552 | |
67 | +Control14=IDC_STATIC,static,1342308352 | |
68 | + | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODE.cpp
0 → 100644
1 | +// ICODE.cpp : Defines the class behaviors for the application. | |
2 | +// | |
3 | + | |
4 | +#include "stdafx.h" | |
5 | +#include "ICODE.h" | |
6 | +#include "ICODEDlg.h" | |
7 | + | |
8 | +#ifdef _DEBUG | |
9 | +#define new DEBUG_NEW | |
10 | +#undef THIS_FILE | |
11 | +static char THIS_FILE[] = __FILE__; | |
12 | +#endif | |
13 | + | |
14 | +///////////////////////////////////////////////////////////////////////////// | |
15 | +// CICODEApp | |
16 | + | |
17 | +BEGIN_MESSAGE_MAP(CICODEApp, CWinApp) | |
18 | + //{{AFX_MSG_MAP(CICODEApp) | |
19 | + // NOTE - the ClassWizard will add and remove mapping macros here. | |
20 | + // DO NOT EDIT what you see in these blocks of generated code! | |
21 | + //}}AFX_MSG | |
22 | + ON_COMMAND(ID_HELP, CWinApp::OnHelp) | |
23 | +END_MESSAGE_MAP() | |
24 | + | |
25 | +///////////////////////////////////////////////////////////////////////////// | |
26 | +// CICODEApp construction | |
27 | + | |
28 | +CICODEApp::CICODEApp() | |
29 | +{ | |
30 | + // TODO: add construction code here, | |
31 | + // Place all significant initialization in InitInstance | |
32 | +} | |
33 | + | |
34 | +///////////////////////////////////////////////////////////////////////////// | |
35 | +// The one and only CICODEApp object | |
36 | + | |
37 | +CICODEApp theApp; | |
38 | + | |
39 | +///////////////////////////////////////////////////////////////////////////// | |
40 | +// CICODEApp initialization | |
41 | + | |
42 | +BOOL CICODEApp::InitInstance() | |
43 | +{ | |
44 | + AfxEnableControlContainer(); | |
45 | + | |
46 | + // Standard initialization | |
47 | + // If you are not using these features and wish to reduce the size | |
48 | + // of your final executable, you should remove from the following | |
49 | + // the specific initialization routines you do not need. | |
50 | + | |
51 | +#ifdef _AFXDLL | |
52 | + Enable3dControls(); // Call this when using MFC in a shared DLL | |
53 | +#else | |
54 | + Enable3dControlsStatic(); // Call this when linking to MFC statically | |
55 | +#endif | |
56 | + | |
57 | + CICODEDlg dlg; | |
58 | + m_pMainWnd = &dlg; | |
59 | + int nResponse = dlg.DoModal(); | |
60 | + if (nResponse == IDOK) | |
61 | + { | |
62 | + // TODO: Place code here to handle when the dialog is | |
63 | + // dismissed with OK | |
64 | + } | |
65 | + else if (nResponse == IDCANCEL) | |
66 | + { | |
67 | + // TODO: Place code here to handle when the dialog is | |
68 | + // dismissed with Cancel | |
69 | + } | |
70 | + | |
71 | + // Since the dialog has been closed, return FALSE so that we exit the | |
72 | + // application, rather than start the application's message pump. | |
73 | + return FALSE; | |
74 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODE.dsp
0 → 100644
1 | +# Microsoft Developer Studio Project File - Name="ICODE" - Package Owner=<4> | |
2 | +# Microsoft Developer Studio Generated Build File, Format Version 6.00 | |
3 | +# ** DO NOT EDIT ** | |
4 | + | |
5 | +# TARGTYPE "Win32 (x86) Application" 0x0101 | |
6 | + | |
7 | +CFG=ICODE - Win32 Debug | |
8 | +!MESSAGE This is not a valid makefile. To build this project using NMAKE, | |
9 | +!MESSAGE use the Export Makefile command and run | |
10 | +!MESSAGE | |
11 | +!MESSAGE NMAKE /f "ICODE.mak". | |
12 | +!MESSAGE | |
13 | +!MESSAGE You can specify a configuration when running NMAKE | |
14 | +!MESSAGE by defining the macro CFG on the command line. For example: | |
15 | +!MESSAGE | |
16 | +!MESSAGE NMAKE /f "ICODE.mak" CFG="ICODE - Win32 Debug" | |
17 | +!MESSAGE | |
18 | +!MESSAGE Possible choices for configuration are: | |
19 | +!MESSAGE | |
20 | +!MESSAGE "ICODE - Win32 Release" (based on "Win32 (x86) Application") | |
21 | +!MESSAGE "ICODE - Win32 Debug" (based on "Win32 (x86) Application") | |
22 | +!MESSAGE | |
23 | + | |
24 | +# Begin Project | |
25 | +# PROP AllowPerConfigDependencies 0 | |
26 | +# PROP Scc_ProjName "" | |
27 | +# PROP Scc_LocalPath "" | |
28 | +CPP=cl.exe | |
29 | +MTL=midl.exe | |
30 | +RSC=rc.exe | |
31 | + | |
32 | +!IF "$(CFG)" == "ICODE - Win32 Release" | |
33 | + | |
34 | +# PROP BASE Use_MFC 6 | |
35 | +# PROP BASE Use_Debug_Libraries 0 | |
36 | +# PROP BASE Output_Dir "Release" | |
37 | +# PROP BASE Intermediate_Dir "Release" | |
38 | +# PROP BASE Target_Dir "" | |
39 | +# PROP Use_MFC 6 | |
40 | +# PROP Use_Debug_Libraries 0 | |
41 | +# PROP Output_Dir "Release" | |
42 | +# PROP Intermediate_Dir "Release" | |
43 | +# PROP Target_Dir "" | |
44 | +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c | |
45 | +# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /c | |
46 | +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | |
47 | +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | |
48 | +# ADD BASE RSC /l 0x804 /d "NDEBUG" /d "_AFXDLL" | |
49 | +# ADD RSC /l 0x804 /d "NDEBUG" /d "_AFXDLL" | |
50 | +BSC32=bscmake.exe | |
51 | +# ADD BASE BSC32 /nologo | |
52 | +# ADD BSC32 /nologo | |
53 | +LINK32=link.exe | |
54 | +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 | |
55 | +# ADD LINK32 /nologo /subsystem:windows /machine:I386 | |
56 | + | |
57 | +!ELSEIF "$(CFG)" == "ICODE - Win32 Debug" | |
58 | + | |
59 | +# PROP BASE Use_MFC 6 | |
60 | +# PROP BASE Use_Debug_Libraries 1 | |
61 | +# PROP BASE Output_Dir "Debug" | |
62 | +# PROP BASE Intermediate_Dir "Debug" | |
63 | +# PROP BASE Target_Dir "" | |
64 | +# PROP Use_MFC 6 | |
65 | +# PROP Use_Debug_Libraries 1 | |
66 | +# PROP Output_Dir "Debug" | |
67 | +# PROP Intermediate_Dir "Debug" | |
68 | +# PROP Target_Dir "" | |
69 | +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c | |
70 | +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c | |
71 | +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 | |
72 | +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 | |
73 | +# ADD BASE RSC /l 0x804 /d "_DEBUG" /d "_AFXDLL" | |
74 | +# ADD RSC /l 0x804 /d "_DEBUG" /d "_AFXDLL" | |
75 | +BSC32=bscmake.exe | |
76 | +# ADD BASE BSC32 /nologo | |
77 | +# ADD BSC32 /nologo | |
78 | +LINK32=link.exe | |
79 | +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept | |
80 | +# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept | |
81 | + | |
82 | +!ENDIF | |
83 | + | |
84 | +# Begin Target | |
85 | + | |
86 | +# Name "ICODE - Win32 Release" | |
87 | +# Name "ICODE - Win32 Debug" | |
88 | +# Begin Group "Source Files" | |
89 | + | |
90 | +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" | |
91 | +# Begin Source File | |
92 | + | |
93 | +SOURCE=.\ICODE.cpp | |
94 | +# End Source File | |
95 | +# Begin Source File | |
96 | + | |
97 | +SOURCE=.\ICODE.rc | |
98 | +# End Source File | |
99 | +# Begin Source File | |
100 | + | |
101 | +SOURCE=.\ICODEDlg.cpp | |
102 | +# End Source File | |
103 | +# Begin Source File | |
104 | + | |
105 | +SOURCE=.\StdAfx.cpp | |
106 | +# ADD CPP /Yc"stdafx.h" | |
107 | +# End Source File | |
108 | +# Begin Source File | |
109 | + | |
110 | +SOURCE=.\dcrf32.lib | |
111 | +# End Source File | |
112 | +# End Group | |
113 | +# Begin Group "Header Files" | |
114 | + | |
115 | +# PROP Default_Filter "h;hpp;hxx;hm;inl" | |
116 | +# Begin Source File | |
117 | + | |
118 | +SOURCE=.\dcrf32.h | |
119 | +# End Source File | |
120 | +# Begin Source File | |
121 | + | |
122 | +SOURCE=.\ICODE.h | |
123 | +# End Source File | |
124 | +# Begin Source File | |
125 | + | |
126 | +SOURCE=.\ICODEDlg.h | |
127 | +# End Source File | |
128 | +# Begin Source File | |
129 | + | |
130 | +SOURCE=.\Resource.h | |
131 | +# End Source File | |
132 | +# Begin Source File | |
133 | + | |
134 | +SOURCE=.\StdAfx.h | |
135 | +# End Source File | |
136 | +# End Group | |
137 | +# Begin Group "Resource Files" | |
138 | + | |
139 | +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" | |
140 | +# Begin Source File | |
141 | + | |
142 | +SOURCE=.\res\ICODE.ico | |
143 | +# End Source File | |
144 | +# Begin Source File | |
145 | + | |
146 | +SOURCE=.\res\ICODE.rc2 | |
147 | +# End Source File | |
148 | +# End Group | |
149 | +# Begin Source File | |
150 | + | |
151 | +SOURCE=.\ReadMe.txt | |
152 | +# End Source File | |
153 | +# End Target | |
154 | +# End Project | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODE.dsw
0 → 100644
1 | +Microsoft Developer Studio Workspace File, Format Version 6.00 | |
2 | +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! | |
3 | + | |
4 | +############################################################################### | |
5 | + | |
6 | +Project: "ICODE"=".\ICODE.dsp" - Package Owner=<4> | |
7 | + | |
8 | +Package=<5> | |
9 | +{{{ | |
10 | +}}} | |
11 | + | |
12 | +Package=<4> | |
13 | +{{{ | |
14 | +}}} | |
15 | + | |
16 | +############################################################################### | |
17 | + | |
18 | +Global: | |
19 | + | |
20 | +Package=<5> | |
21 | +{{{ | |
22 | +}}} | |
23 | + | |
24 | +Package=<3> | |
25 | +{{{ | |
26 | +}}} | |
27 | + | |
28 | +############################################################################### | |
29 | + | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODE.h
0 → 100644
1 | +// ICODE.h : main header file for the ICODE application | |
2 | +// | |
3 | + | |
4 | +#if !defined(AFX_ICODE_H__55AC27EE_DCC7_47A5_8428_175FE0B009C7__INCLUDED_) | |
5 | +#define AFX_ICODE_H__55AC27EE_DCC7_47A5_8428_175FE0B009C7__INCLUDED_ | |
6 | + | |
7 | +#if _MSC_VER > 1000 | |
8 | +#pragma once | |
9 | +#endif // _MSC_VER > 1000 | |
10 | + | |
11 | +#ifndef __AFXWIN_H__ | |
12 | + #error include 'stdafx.h' before including this file for PCH | |
13 | +#endif | |
14 | + | |
15 | +#include "resource.h" // main symbols | |
16 | + | |
17 | +///////////////////////////////////////////////////////////////////////////// | |
18 | +// CICODEApp: | |
19 | +// See ICODE.cpp for the implementation of this class | |
20 | +// | |
21 | + | |
22 | +class CICODEApp : public CWinApp | |
23 | +{ | |
24 | +public: | |
25 | + CICODEApp(); | |
26 | + | |
27 | +// Overrides | |
28 | + // ClassWizard generated virtual function overrides | |
29 | + //{{AFX_VIRTUAL(CICODEApp) | |
30 | + public: | |
31 | + virtual BOOL InitInstance(); | |
32 | + //}}AFX_VIRTUAL | |
33 | + | |
34 | +// Implementation | |
35 | + | |
36 | + //{{AFX_MSG(CICODEApp) | |
37 | + // NOTE - the ClassWizard will add and remove member functions here. | |
38 | + // DO NOT EDIT what you see in these blocks of generated code ! | |
39 | + //}}AFX_MSG | |
40 | + DECLARE_MESSAGE_MAP() | |
41 | +}; | |
42 | + | |
43 | + | |
44 | +///////////////////////////////////////////////////////////////////////////// | |
45 | + | |
46 | +//{{AFX_INSERT_LOCATION}} | |
47 | +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. | |
48 | + | |
49 | +#endif // !defined(AFX_ICODE_H__55AC27EE_DCC7_47A5_8428_175FE0B009C7__INCLUDED_) | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODE.opt
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODE.plg
0 → 100644
1 | +<html> | |
2 | +<body> | |
3 | +<pre> | |
4 | +<h1>Build Log</h1> | |
5 | +<h3> | |
6 | +--------------------Configuration: ICODE - Win32 Release-------------------- | |
7 | +</h3> | |
8 | +<h3>Command Lines</h3> | |
9 | +Creating command line "rc.exe /l 0x804 /fo"Release/ICODE.res" /d "NDEBUG" /d "_AFXDLL" "D:\install-15693-en\15693_Examples\Vc6.0\ICODE.rc"" | |
10 | +Creating temporary file "C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\RSP4F.tmp" with contents | |
11 | +[ | |
12 | +/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR"Release/" /Fp"Release/ICODE.pch" /Yu"stdafx.h" /Fo"Release/" /Fd"Release/" /FD /c | |
13 | +"D:\install-15693-en\15693_Examples\Vc6.0\ICODEDlg.cpp" | |
14 | +] | |
15 | +Creating command line "cl.exe @C:\DOCUME~1\LENOVO~1\LOCALS~1\Temp\RSP4F.tmp" | |
16 | +Creating command line "link.exe /nologo /subsystem:windows /incremental:no /pdb:"Release/ICODE.pdb" /machine:I386 /out:"Release/ICODE.exe" ".\Release\ICODE.obj" ".\Release\ICODEDlg.obj" ".\Release\StdAfx.obj" ".\Release\ICODE.res" ".\dcrf32.lib" " | |
17 | +<h3>Output Window</h3> | |
18 | +Compiling resources... | |
19 | +Compiling... | |
20 | +ICODEDlg.cpp | |
21 | +Linking... | |
22 | +Creating command line "bscmake.exe /nologo /o"Release/ICODE.bsc" ".\Release\StdAfx.sbr" ".\Release\ICODE.sbr" ".\Release\ICODEDlg.sbr"" | |
23 | +Creating browse info file... | |
24 | +<h3>Output Window</h3> | |
25 | + | |
26 | + | |
27 | + | |
28 | +<h3>Results</h3> | |
29 | +ICODE.exe - 0 error(s), 0 warning(s) | |
30 | +</pre> | |
31 | +</body> | |
32 | +</html> | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODE.rc
0 → 100644
1 | +//Microsoft Developer Studio generated resource script. | |
2 | +// | |
3 | +#include "resource.h" | |
4 | + | |
5 | +#define APSTUDIO_READONLY_SYMBOLS | |
6 | +///////////////////////////////////////////////////////////////////////////// | |
7 | +// | |
8 | +// Generated from the TEXTINCLUDE 2 resource. | |
9 | +// | |
10 | +#include "afxres.h" | |
11 | + | |
12 | +///////////////////////////////////////////////////////////////////////////// | |
13 | +#undef APSTUDIO_READONLY_SYMBOLS | |
14 | + | |
15 | +///////////////////////////////////////////////////////////////////////////// | |
16 | +// Chinese (P.R.C.) resources | |
17 | + | |
18 | +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) | |
19 | +#ifdef _WIN32 | |
20 | +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED | |
21 | +#pragma code_page(936) | |
22 | +#endif //_WIN32 | |
23 | + | |
24 | +#ifdef APSTUDIO_INVOKED | |
25 | +///////////////////////////////////////////////////////////////////////////// | |
26 | +// | |
27 | +// TEXTINCLUDE | |
28 | +// | |
29 | + | |
30 | +1 TEXTINCLUDE DISCARDABLE | |
31 | +BEGIN | |
32 | + "resource.h\0" | |
33 | +END | |
34 | + | |
35 | +2 TEXTINCLUDE DISCARDABLE | |
36 | +BEGIN | |
37 | + "#include ""afxres.h""\r\n" | |
38 | + "\0" | |
39 | +END | |
40 | + | |
41 | +3 TEXTINCLUDE DISCARDABLE | |
42 | +BEGIN | |
43 | + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" | |
44 | + "#define _AFX_NO_OLE_RESOURCES\r\n" | |
45 | + "#define _AFX_NO_TRACKER_RESOURCES\r\n" | |
46 | + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" | |
47 | + "\r\n" | |
48 | + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)\r\n" | |
49 | + "#ifdef _WIN32\r\n" | |
50 | + "LANGUAGE 4, 2\r\n" | |
51 | + "#pragma code_page(936)\r\n" | |
52 | + "#endif //_WIN32\r\n" | |
53 | + "#include ""res\\ICODE.rc2"" // non-Microsoft Visual C++ edited resources\r\n" | |
54 | + "#include ""l.chs\\afxres.rc"" // Standard components\r\n" | |
55 | + "#endif\r\n" | |
56 | + "\0" | |
57 | +END | |
58 | + | |
59 | +#endif // APSTUDIO_INVOKED | |
60 | + | |
61 | + | |
62 | +///////////////////////////////////////////////////////////////////////////// | |
63 | +// | |
64 | +// Icon | |
65 | +// | |
66 | + | |
67 | +// Icon with lowest ID value placed first to ensure application icon | |
68 | +// remains consistent on all systems. | |
69 | +IDR_MAINFRAME ICON DISCARDABLE "res\\ICODE.ico" | |
70 | + | |
71 | +///////////////////////////////////////////////////////////////////////////// | |
72 | +// | |
73 | +// Dialog | |
74 | +// | |
75 | + | |
76 | +IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 | |
77 | +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | |
78 | +CAPTION "关于 ICODE" | |
79 | +FONT 9, "宋体" | |
80 | +BEGIN | |
81 | + ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 | |
82 | + LTEXT "ICODE 1.0 版",IDC_STATIC,40,10,119,8,SS_NOPREFIX | |
83 | + LTEXT "版权所有 (C) 2006",IDC_STATIC,40,25,119,8 | |
84 | + DEFPUSHBUTTON "确定",IDOK,178,7,50,14,WS_GROUP | |
85 | +END | |
86 | + | |
87 | +IDD_ICODE_DIALOG DIALOGEX 0, 0, 291, 200 | |
88 | +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | |
89 | +EXSTYLE WS_EX_APPWINDOW | |
90 | +CAPTION "ICODE" | |
91 | +FONT 9, "宋体" | |
92 | +BEGIN | |
93 | + PUSHBUTTON "Exit",IDCANCEL,213,53,39,20 | |
94 | + PUSHBUTTON "Init",IDC_BUTTON1,13,18,37,21 | |
95 | + PUSHBUTTON "Find Single Card",IDC_FIND_SINGLE,140,17,68,22 | |
96 | + PUSHBUTTON "Find Multi Card",IDC_FIND_MULTI,212,17,72,24 | |
97 | + PUSHBUTTON "Read Data",IDC_READ,14,52,48,22 | |
98 | + PUSHBUTTON "Write Data",IDC_WRITE,13,162,47,21 | |
99 | + LISTBOX IDC_LIST1,72,77,182,79,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | | |
100 | + WS_TABSTOP | |
101 | + EDITTEXT IDC_EDIT1,84,59,49,14,ES_AUTOHSCROLL | |
102 | + EDITTEXT IDC_EDIT2,153,59,54,16,ES_AUTOHSCROLL | NOT WS_TABSTOP | |
103 | + LTEXT "StartAddr",IDC_start,83,47,50,10 | |
104 | + LTEXT "BlockNum",IDC_STATIC,153,46,52,9,NOT WS_GROUP | |
105 | + EDITTEXT IDC_EDIT3,71,164,182,20,ES_AUTOHSCROLL | |
106 | + EDITTEXT IDC_EDIT4,53,21,19,16,ES_AUTOHSCROLL | |
107 | + LTEXT "PortNo(0~19,100)",IDC_STATIC,75,22,65,13 | |
108 | +END | |
109 | + | |
110 | + | |
111 | +#ifndef _MAC | |
112 | +///////////////////////////////////////////////////////////////////////////// | |
113 | +// | |
114 | +// Version | |
115 | +// | |
116 | + | |
117 | +VS_VERSION_INFO VERSIONINFO | |
118 | + FILEVERSION 1,0,0,2 | |
119 | + PRODUCTVERSION 1,0,0,2 | |
120 | + FILEFLAGSMASK 0x3fL | |
121 | +#ifdef _DEBUG | |
122 | + FILEFLAGS 0x1L | |
123 | +#else | |
124 | + FILEFLAGS 0x0L | |
125 | +#endif | |
126 | + FILEOS 0x4L | |
127 | + FILETYPE 0x1L | |
128 | + FILESUBTYPE 0x0L | |
129 | +BEGIN | |
130 | + BLOCK "StringFileInfo" | |
131 | + BEGIN | |
132 | + BLOCK "080404b0" | |
133 | + BEGIN | |
134 | + VALUE "Comments", "Update 2006-9-5\0" | |
135 | + VALUE "CompanyName", "\0" | |
136 | + VALUE "FileDescription", "ICODE Microsoft 基础类应用程序\0" | |
137 | + VALUE "FileVersion", "1, 0, 0, 2\0" | |
138 | + VALUE "InternalName", "ICODE\0" | |
139 | + VALUE "LegalCopyright", "版权所有 (C) 2006\0" | |
140 | + VALUE "LegalTrademarks", "\0" | |
141 | + VALUE "OriginalFilename", "ICODE.EXE\0" | |
142 | + VALUE "PrivateBuild", "\0" | |
143 | + VALUE "ProductName", "ICODE 应用程序\0" | |
144 | + VALUE "ProductVersion", "1, 0, 0, 2\0" | |
145 | + VALUE "SpecialBuild", "\0" | |
146 | + END | |
147 | + END | |
148 | + BLOCK "VarFileInfo" | |
149 | + BEGIN | |
150 | + VALUE "Translation", 0x804, 1200 | |
151 | + END | |
152 | +END | |
153 | + | |
154 | +#endif // !_MAC | |
155 | + | |
156 | + | |
157 | +///////////////////////////////////////////////////////////////////////////// | |
158 | +// | |
159 | +// DESIGNINFO | |
160 | +// | |
161 | + | |
162 | +#ifdef APSTUDIO_INVOKED | |
163 | +GUIDELINES DESIGNINFO DISCARDABLE | |
164 | +BEGIN | |
165 | + IDD_ABOUTBOX, DIALOG | |
166 | + BEGIN | |
167 | + LEFTMARGIN, 7 | |
168 | + RIGHTMARGIN, 228 | |
169 | + TOPMARGIN, 7 | |
170 | + BOTTOMMARGIN, 48 | |
171 | + END | |
172 | + | |
173 | + IDD_ICODE_DIALOG, DIALOG | |
174 | + BEGIN | |
175 | + LEFTMARGIN, 7 | |
176 | + RIGHTMARGIN, 284 | |
177 | + TOPMARGIN, 7 | |
178 | + BOTTOMMARGIN, 193 | |
179 | + END | |
180 | +END | |
181 | +#endif // APSTUDIO_INVOKED | |
182 | + | |
183 | + | |
184 | +///////////////////////////////////////////////////////////////////////////// | |
185 | +// | |
186 | +// String Table | |
187 | +// | |
188 | + | |
189 | +STRINGTABLE DISCARDABLE | |
190 | +BEGIN | |
191 | + IDS_ABOUTBOX "关于 ICODE(&A)..." | |
192 | +END | |
193 | + | |
194 | +#endif // Chinese (P.R.C.) resources | |
195 | +///////////////////////////////////////////////////////////////////////////// | |
196 | + | |
197 | + | |
198 | + | |
199 | +#ifndef APSTUDIO_INVOKED | |
200 | +///////////////////////////////////////////////////////////////////////////// | |
201 | +// | |
202 | +// Generated from the TEXTINCLUDE 3 resource. | |
203 | +// | |
204 | +#define _AFX_NO_SPLITTER_RESOURCES | |
205 | +#define _AFX_NO_OLE_RESOURCES | |
206 | +#define _AFX_NO_TRACKER_RESOURCES | |
207 | +#define _AFX_NO_PROPERTY_RESOURCES | |
208 | + | |
209 | +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) | |
210 | +#ifdef _WIN32 | |
211 | +LANGUAGE 4, 2 | |
212 | +#pragma code_page(936) | |
213 | +#endif //_WIN32 | |
214 | +#include "res\ICODE.rc2" // non-Microsoft Visual C++ edited resources | |
215 | +#include "l.chs\afxres.rc" // Standard components | |
216 | +#endif | |
217 | + | |
218 | +///////////////////////////////////////////////////////////////////////////// | |
219 | +#endif // not APSTUDIO_INVOKED | |
220 | + | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODEDlg.cpp
0 → 100644
1 | +// ICODEDlg.cpp : implementation file | |
2 | +// | |
3 | + | |
4 | +#include "stdafx.h" | |
5 | +#include "ICODE.h" | |
6 | +#include "ICODEDlg.h" | |
7 | +#include "dcrf32.h" | |
8 | +#ifdef _DEBUG | |
9 | +#define new DEBUG_NEW | |
10 | +#undef THIS_FILE | |
11 | +static char THIS_FILE[] = __FILE__; | |
12 | +#endif | |
13 | + | |
14 | +///////////////////////////////////////////////////////////////////////////// | |
15 | +// CAboutDlg dialog used for App About | |
16 | + | |
17 | +class CAboutDlg : public CDialog | |
18 | +{ | |
19 | +public: | |
20 | + CAboutDlg(); | |
21 | + | |
22 | +// Dialog Data | |
23 | + //{{AFX_DATA(CAboutDlg) | |
24 | + enum { IDD = IDD_ABOUTBOX }; | |
25 | + //}}AFX_DATA | |
26 | + | |
27 | + // ClassWizard generated virtual function overrides | |
28 | + //{{AFX_VIRTUAL(CAboutDlg) | |
29 | + protected: | |
30 | + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support | |
31 | + //}}AFX_VIRTUAL | |
32 | + | |
33 | +// Implementation | |
34 | +protected: | |
35 | + //{{AFX_MSG(CAboutDlg) | |
36 | + //}}AFX_MSG | |
37 | + DECLARE_MESSAGE_MAP() | |
38 | +}; | |
39 | + | |
40 | +CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) | |
41 | +{ | |
42 | + //{{AFX_DATA_INIT(CAboutDlg) | |
43 | + //}}AFX_DATA_INIT | |
44 | +} | |
45 | + | |
46 | +void CAboutDlg::DoDataExchange(CDataExchange* pDX) | |
47 | +{ | |
48 | + CDialog::DoDataExchange(pDX); | |
49 | + //{{AFX_DATA_MAP(CAboutDlg) | |
50 | + //}}AFX_DATA_MAP | |
51 | +} | |
52 | + | |
53 | +BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) | |
54 | + //{{AFX_MSG_MAP(CAboutDlg) | |
55 | + // No message handlers | |
56 | + //}}AFX_MSG_MAP | |
57 | +END_MESSAGE_MAP() | |
58 | + | |
59 | +///////////////////////////////////////////////////////////////////////////// | |
60 | +// CICODEDlg dialog | |
61 | + | |
62 | +CICODEDlg::CICODEDlg(CWnd* pParent /*=NULL*/) | |
63 | + : CDialog(CICODEDlg::IDD, pParent) | |
64 | +{ | |
65 | + //{{AFX_DATA_INIT(CICODEDlg) | |
66 | + m_StaAddr = 0; | |
67 | + m_Blockno = 0; | |
68 | + m_write = _T(""); | |
69 | + m_port = 0; | |
70 | + //}}AFX_DATA_INIT | |
71 | + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 | |
72 | + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); | |
73 | +} | |
74 | + | |
75 | +void CICODEDlg::DoDataExchange(CDataExchange* pDX) | |
76 | +{ | |
77 | + CDialog::DoDataExchange(pDX); | |
78 | + //{{AFX_DATA_MAP(CICODEDlg) | |
79 | + DDX_Control(pDX, IDC_LIST1, m_list1); | |
80 | + DDX_Text(pDX, IDC_EDIT1, m_StaAddr); | |
81 | + DDV_MinMaxInt(pDX, m_StaAddr, 0, 27); | |
82 | + DDX_Text(pDX, IDC_EDIT2, m_Blockno); | |
83 | + DDV_MinMaxInt(pDX, m_Blockno, 1, 10); | |
84 | + DDX_Text(pDX, IDC_EDIT3, m_write); | |
85 | + DDV_MaxChars(pDX, m_write, 8); | |
86 | + DDX_Text(pDX, IDC_EDIT4, m_port); | |
87 | + DDV_MinMaxInt(pDX, m_port, 0, 100); | |
88 | + //}}AFX_DATA_MAP | |
89 | +} | |
90 | + | |
91 | +BEGIN_MESSAGE_MAP(CICODEDlg, CDialog) | |
92 | + //{{AFX_MSG_MAP(CICODEDlg) | |
93 | + ON_WM_SYSCOMMAND() | |
94 | + ON_WM_PAINT() | |
95 | + ON_WM_QUERYDRAGICON() | |
96 | + ON_BN_CLICKED(IDC_BUTTON1, OnINIT) | |
97 | + ON_BN_CLICKED(IDC_FIND_SINGLE, OnFindSingle) | |
98 | + ON_BN_CLICKED(IDC_FIND_MULTI, OnFindMulti) | |
99 | + ON_BN_CLICKED(IDC_READ, OnRead) | |
100 | + ON_BN_CLICKED(IDC_WRITE, OnWrite) | |
101 | + //}}AFX_MSG_MAP | |
102 | +END_MESSAGE_MAP() | |
103 | + | |
104 | +///////////////////////////////////////////////////////////////////////////// | |
105 | +// CICODEDlg message handlers | |
106 | + | |
107 | +BOOL CICODEDlg::OnInitDialog() | |
108 | +{ | |
109 | + CDialog::OnInitDialog(); | |
110 | + | |
111 | + // Add "About..." menu item to system menu. | |
112 | + | |
113 | + // IDM_ABOUTBOX must be in the system command range. | |
114 | + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); | |
115 | + ASSERT(IDM_ABOUTBOX < 0xF000); | |
116 | + | |
117 | + CMenu* pSysMenu = GetSystemMenu(FALSE); | |
118 | + if (pSysMenu != NULL) | |
119 | + { | |
120 | + CString strAboutMenu; | |
121 | + strAboutMenu.LoadString(IDS_ABOUTBOX); | |
122 | + if (!strAboutMenu.IsEmpty()) | |
123 | + { | |
124 | + pSysMenu->AppendMenu(MF_SEPARATOR); | |
125 | + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); | |
126 | + } | |
127 | + } | |
128 | + | |
129 | + // Set the icon for this dialog. The framework does this automatically | |
130 | + // when the application's main window is not a dialog | |
131 | + SetIcon(m_hIcon, TRUE); // Set big icon | |
132 | + SetIcon(m_hIcon, FALSE); // Set small icon | |
133 | + | |
134 | + // TODO: Add extra initialization here | |
135 | + m_Blockno=1; | |
136 | + UpdateData(false); | |
137 | + icdev=0; | |
138 | + return TRUE; // return TRUE unless you set the focus to a control | |
139 | +} | |
140 | + | |
141 | +void CICODEDlg::OnSysCommand(UINT nID, LPARAM lParam) | |
142 | +{ | |
143 | + if ((nID & 0xFFF0) == IDM_ABOUTBOX) | |
144 | + { | |
145 | + CAboutDlg dlgAbout; | |
146 | + dlgAbout.DoModal(); | |
147 | + } | |
148 | + else | |
149 | + { | |
150 | + CDialog::OnSysCommand(nID, lParam); | |
151 | + } | |
152 | +} | |
153 | + | |
154 | +// If you add a minimize button to your dialog, you will need the code below | |
155 | +// to draw the icon. For MFC applications using the document/view model, | |
156 | +// this is automatically done for you by the framework. | |
157 | + | |
158 | +void CICODEDlg::OnPaint() | |
159 | +{ | |
160 | + if (IsIconic()) | |
161 | + { | |
162 | + CPaintDC dc(this); // device context for painting | |
163 | + | |
164 | + SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); | |
165 | + | |
166 | + // Center icon in client rectangle | |
167 | + int cxIcon = GetSystemMetrics(SM_CXICON); | |
168 | + int cyIcon = GetSystemMetrics(SM_CYICON); | |
169 | + CRect rect; | |
170 | + GetClientRect(&rect); | |
171 | + int x = (rect.Width() - cxIcon + 1) / 2; | |
172 | + int y = (rect.Height() - cyIcon + 1) / 2; | |
173 | + | |
174 | + // Draw the icon | |
175 | + dc.DrawIcon(x, y, m_hIcon); | |
176 | + } | |
177 | + else | |
178 | + { | |
179 | + CDialog::OnPaint(); | |
180 | + } | |
181 | +} | |
182 | + | |
183 | +// The system calls this to obtain the cursor to display while the user drags | |
184 | +// the minimized window. | |
185 | +HCURSOR CICODEDlg::OnQueryDragIcon() | |
186 | +{ | |
187 | + return (HCURSOR) m_hIcon; | |
188 | +} | |
189 | + | |
190 | +void CICODEDlg::OnINIT() | |
191 | +{ | |
192 | + // TODO: Add your control notification handler code here | |
193 | + UpdateData(true); | |
194 | + icdev=dc_init(m_port,115200); //init port,baud rate is 115200MHZ | |
195 | + if((int)icdev<=0) | |
196 | + { | |
197 | + AfxMessageBox("Init port ERROR!"); | |
198 | + return; | |
199 | + } | |
200 | + else | |
201 | + { | |
202 | + AfxMessageBox("Init port OK!"); | |
203 | + } | |
204 | + int st=dc_config_card(icdev,'1'); //find 15693 card | |
205 | +} | |
206 | + | |
207 | +void CICODEDlg::OnFindSingle() | |
208 | +{ | |
209 | + // TODO: Add your control notification handler code here | |
210 | + UpdateData(true); | |
211 | + int st; | |
212 | + unsigned char rlen[17]={0}; | |
213 | + unsigned char rbuffer[256]; | |
214 | + st= dc_inventory_hex(icdev,0x36,0,0,rlen,rbuffer); //find single card | |
215 | + if(st) | |
216 | + { | |
217 | + AfxMessageBox("Find single card ERROR!"); | |
218 | + return; | |
219 | + } | |
220 | + m_list1.AddString((char *)rbuffer); | |
221 | + | |
222 | + | |
223 | + | |
224 | +} | |
225 | + | |
226 | +void CICODEDlg::OnFindMulti() | |
227 | +{ | |
228 | + // TODO: Add your control notification handler code here | |
229 | + int st; | |
230 | + unsigned char rlen[256]; | |
231 | + unsigned char rbuffer[256]; | |
232 | + st= dc_inventory_hex(icdev,0x16,0,0,rlen,rbuffer); //find multi card | |
233 | + if(st) | |
234 | + { | |
235 | + AfxMessageBox("Find multi card ERROR!"); | |
236 | + return; | |
237 | + } | |
238 | + m_list1.AddString((char *)rbuffer); | |
239 | +} | |
240 | + | |
241 | +void CICODEDlg::OnRead() | |
242 | +{ | |
243 | + int st; | |
244 | + UpdateData(true); | |
245 | + unsigned char UID[256]; | |
246 | + unsigned char rlen[256]; | |
247 | + unsigned char rbuffer[256]; | |
248 | + st=dc_inventory(icdev,0x36,0,0,rlen,UID); | |
249 | + if(st) | |
250 | + { | |
251 | + AfxMessageBox("ERROR1!"); | |
252 | + return; | |
253 | + } | |
254 | + st=dc_readblock(icdev,0x22,m_StaAddr,m_Blockno,&UID[1],rlen,rbuffer); //read block data | |
255 | + if(st) | |
256 | + { | |
257 | + AfxMessageBox("Read data ERROR!"); | |
258 | + return; | |
259 | + } | |
260 | + unsigned char tmp[256]; | |
261 | + for(int i=0;i<m_Blockno;i++) | |
262 | + { | |
263 | + if(m_StaAddr+m_Blockno>28) | |
264 | + { | |
265 | + m_Blockno=m_Blockno-((m_StaAddr+m_Blockno)-28); | |
266 | + } | |
267 | + sprintf((char *)tmp,"BlockAddr:[%2d] Data:[%02X %02X %02X %02X]",m_StaAddr+i,rbuffer[i*4],rbuffer[i*4+1],rbuffer[i*4+2],rbuffer[i*4+3]); | |
268 | + m_list1.AddString((const char *)tmp); | |
269 | + } | |
270 | +} | |
271 | + | |
272 | +void CICODEDlg::OnWrite() | |
273 | +{ | |
274 | + // TODO: Add your control notification handler code here | |
275 | + int st; | |
276 | + unsigned char rlen[256]; | |
277 | + UpdateData(true); | |
278 | + unsigned char UID[256]; | |
279 | + BYTE len=10; | |
280 | + unsigned char WriteBuf[256]; | |
281 | + len=Str2Hex(m_write,(char *)WriteBuf); | |
282 | + if(len==0) | |
283 | + { | |
284 | + AfxMessageBox("Write Block¡¡ERROR!"); | |
285 | + return; | |
286 | + } | |
287 | + st=dc_inventory(icdev,0x36,0,0,rlen,UID); | |
288 | + if(st) | |
289 | + { | |
290 | + AfxMessageBox("ERROR1!"); | |
291 | + return; | |
292 | + } | |
293 | + st=dc_writeblock(icdev,0x22,m_StaAddr,1,&UID[1],4,WriteBuf); | |
294 | + /*unsigned char data[16]; | |
295 | + CString Str; | |
296 | + GetDlgItem(IDC_EDIT3)->GetWindowText(Str); | |
297 | + memcpy(data,Str,Str.GetLength()); | |
298 | + st=dc_writeblock_hex(icdev,0x22,m_StaAddr,1,&UID[3],4,data); //write block 1*/ | |
299 | + if(st) | |
300 | + { | |
301 | + AfxMessageBox("Write data ERROR!"); | |
302 | + return; | |
303 | + } | |
304 | + else | |
305 | + { | |
306 | + AfxMessageBox("Write data OK!"); | |
307 | + } | |
308 | + | |
309 | + | |
310 | + | |
311 | +} | |
312 | +HexChar(char c) | |
313 | +{ | |
314 | + if((c>='0')&&(c<='9')) | |
315 | + return c-0x30; | |
316 | + else if((c>='A')&&(c<='F')) | |
317 | + return c-'A'+10; | |
318 | + else if((c>='a')&&(c<='f')) | |
319 | + return c-'a'+10; | |
320 | + else | |
321 | + return 0x10; | |
322 | +} | |
323 | + | |
324 | +int CICODEDlg::Str2Hex(CString str, char *data) | |
325 | +{ int t,t1; | |
326 | + int rlen=0,len=str.GetLength(); | |
327 | + //data.SetSize(len/2); | |
328 | + for(int i=0;i<len;) | |
329 | + { | |
330 | + char l,h=str[i]; | |
331 | + if(h==' ') | |
332 | + { | |
333 | + i++; | |
334 | + continue; | |
335 | + } | |
336 | + i++; | |
337 | + if(i>=len) | |
338 | + break; | |
339 | + l=str[i]; | |
340 | + t=HexChar(h); | |
341 | + t1=HexChar(l); | |
342 | + if((t==16)||(t1==16)) | |
343 | + break; | |
344 | + else | |
345 | + t=t*16+t1; | |
346 | + i++; | |
347 | + data[rlen]=(char)t; | |
348 | + rlen++; | |
349 | + } | |
350 | + return rlen; | |
351 | + | |
352 | + | |
353 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ICODEDlg.h
0 → 100644
1 | +// ICODEDlg.h : header file | |
2 | +// | |
3 | + | |
4 | +#if !defined(AFX_ICODEDLG_H__EA4D59ED_4960_43BE_BDA7_162CB3C7FACA__INCLUDED_) | |
5 | +#define AFX_ICODEDLG_H__EA4D59ED_4960_43BE_BDA7_162CB3C7FACA__INCLUDED_ | |
6 | + | |
7 | +#if _MSC_VER > 1000 | |
8 | +#pragma once | |
9 | +#endif // _MSC_VER > 1000 | |
10 | + | |
11 | +///////////////////////////////////////////////////////////////////////////// | |
12 | +// CICODEDlg dialog | |
13 | + | |
14 | +class CICODEDlg : public CDialog | |
15 | +{ | |
16 | +// Construction | |
17 | +public: | |
18 | + int Str2Hex(CString str,char *data); | |
19 | + CICODEDlg(CWnd* pParent = NULL); // standard constructor | |
20 | + | |
21 | +// Dialog Data | |
22 | + //{{AFX_DATA(CICODEDlg) | |
23 | + enum { IDD = IDD_ICODE_DIALOG }; | |
24 | + CListBox m_list1; | |
25 | + int m_StaAddr; | |
26 | + int m_Blockno; | |
27 | + CString m_write; | |
28 | + int m_port; | |
29 | + //}}AFX_DATA | |
30 | + | |
31 | + // ClassWizard generated virtual function overrides | |
32 | + //{{AFX_VIRTUAL(CICODEDlg) | |
33 | + protected: | |
34 | + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support | |
35 | + //}}AFX_VIRTUAL | |
36 | + | |
37 | +// Implementation | |
38 | +protected: | |
39 | + HICON m_hIcon; | |
40 | + HANDLE icdev; | |
41 | + // Generated message map functions | |
42 | + //{{AFX_MSG(CICODEDlg) | |
43 | + virtual BOOL OnInitDialog(); | |
44 | + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); | |
45 | + afx_msg void OnPaint(); | |
46 | + afx_msg HCURSOR OnQueryDragIcon(); | |
47 | + afx_msg void OnINIT(); | |
48 | + afx_msg void OnFindSingle(); | |
49 | + afx_msg void OnFindMulti(); | |
50 | + afx_msg void OnRead(); | |
51 | + afx_msg void OnWrite(); | |
52 | + //}}AFX_MSG | |
53 | + DECLARE_MESSAGE_MAP() | |
54 | +}; | |
55 | + | |
56 | +//{{AFX_INSERT_LOCATION}} | |
57 | +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. | |
58 | + | |
59 | +#endif // !defined(AFX_ICODEDLG_H__EA4D59ED_4960_43BE_BDA7_162CB3C7FACA__INCLUDED_) | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/ReadMe.txt
0 → 100644
1 | +======================================================================== | |
2 | + MICROSOFT FOUNDATION CLASS LIBRARY : ICODE | |
3 | +======================================================================== | |
4 | + | |
5 | + | |
6 | +AppWizard has created this ICODE application for you. This application | |
7 | +not only demonstrates the basics of using the Microsoft Foundation classes | |
8 | +but is also a starting point for writing your application. | |
9 | + | |
10 | +This file contains a summary of what you will find in each of the files that | |
11 | +make up your ICODE application. | |
12 | + | |
13 | +ICODE.dsp | |
14 | + This file (the project file) contains information at the project level and | |
15 | + is used to build a single project or subproject. Other users can share the | |
16 | + project (.dsp) file, but they should export the makefiles locally. | |
17 | + | |
18 | +ICODE.h | |
19 | + This is the main header file for the application. It includes other | |
20 | + project specific headers (including Resource.h) and declares the | |
21 | + CICODEApp application class. | |
22 | + | |
23 | +ICODE.cpp | |
24 | + This is the main application source file that contains the application | |
25 | + class CICODEApp. | |
26 | + | |
27 | +ICODE.rc | |
28 | + This is a listing of all of the Microsoft Windows resources that the | |
29 | + program uses. It includes the icons, bitmaps, and cursors that are stored | |
30 | + in the RES subdirectory. This file can be directly edited in Microsoft | |
31 | + Visual C++. | |
32 | + | |
33 | +ICODE.clw | |
34 | + This file contains information used by ClassWizard to edit existing | |
35 | + classes or add new classes. ClassWizard also uses this file to store | |
36 | + information needed to create and edit message maps and dialog data | |
37 | + maps and to create prototype member functions. | |
38 | + | |
39 | +res\ICODE.ico | |
40 | + This is an icon file, which is used as the application's icon. This | |
41 | + icon is included by the main resource file ICODE.rc. | |
42 | + | |
43 | +res\ICODE.rc2 | |
44 | + This file contains resources that are not edited by Microsoft | |
45 | + Visual C++. You should place all resources not editable by | |
46 | + the resource editor in this file. | |
47 | + | |
48 | + | |
49 | + | |
50 | + | |
51 | +///////////////////////////////////////////////////////////////////////////// | |
52 | + | |
53 | +AppWizard creates one dialog class: | |
54 | + | |
55 | +ICODEDlg.h, ICODEDlg.cpp - the dialog | |
56 | + These files contain your CICODEDlg class. This class defines | |
57 | + the behavior of your application's main dialog. The dialog's | |
58 | + template is in ICODE.rc, which can be edited in Microsoft | |
59 | + Visual C++. | |
60 | + | |
61 | + | |
62 | +///////////////////////////////////////////////////////////////////////////// | |
63 | +Other standard files: | |
64 | + | |
65 | +StdAfx.h, StdAfx.cpp | |
66 | + These files are used to build a precompiled header (PCH) file | |
67 | + named ICODE.pch and a precompiled types file named StdAfx.obj. | |
68 | + | |
69 | +Resource.h | |
70 | + This is the standard header file, which defines new resource IDs. | |
71 | + Microsoft Visual C++ reads and updates this file. | |
72 | + | |
73 | +///////////////////////////////////////////////////////////////////////////// | |
74 | +Other notes: | |
75 | + | |
76 | +AppWizard uses "TODO:" to indicate parts of the source code you | |
77 | +should add to or customize. | |
78 | + | |
79 | +If your application uses MFC in a shared DLL, and your application is | |
80 | +in a language other than the operating system's current language, you | |
81 | +will need to copy the corresponding localized resources MFC42XXX.DLL | |
82 | +from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, | |
83 | +and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation. | |
84 | +For example, MFC42DEU.DLL contains resources translated to German.) If you | |
85 | +don't do this, some of the UI elements of your application will remain in the | |
86 | +language of the operating system. | |
87 | + | |
88 | +///////////////////////////////////////////////////////////////////////////// | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/Resource.h
0 → 100644
1 | +//{{NO_DEPENDENCIES}} | |
2 | +// Microsoft Developer Studio generated include file. | |
3 | +// Used by ICODE.rc | |
4 | +// | |
5 | +#define IDM_ABOUTBOX 0x0010 | |
6 | +#define IDD_ABOUTBOX 100 | |
7 | +#define IDS_ABOUTBOX 101 | |
8 | +#define IDD_ICODE_DIALOG 102 | |
9 | +#define IDR_MAINFRAME 128 | |
10 | +#define IDC_BUTTON1 1000 | |
11 | +#define IDC_FIND_SINGLE 1001 | |
12 | +#define IDC_FIND_MULTI 1002 | |
13 | +#define IDC_READ 1003 | |
14 | +#define IDC_WRITE 1005 | |
15 | +#define IDC_LIST1 1006 | |
16 | +#define IDC_EDIT1 1007 | |
17 | +#define IDC_EDIT2 1008 | |
18 | +#define IDC_start 1009 | |
19 | +#define IDC_EDIT3 1011 | |
20 | +#define IDC_EDIT4 1012 | |
21 | + | |
22 | +// Next default values for new objects | |
23 | +// | |
24 | +#ifdef APSTUDIO_INVOKED | |
25 | +#ifndef APSTUDIO_READONLY_SYMBOLS | |
26 | +#define _APS_NEXT_RESOURCE_VALUE 129 | |
27 | +#define _APS_NEXT_COMMAND_VALUE 32771 | |
28 | +#define _APS_NEXT_CONTROL_VALUE 1013 | |
29 | +#define _APS_NEXT_SYMED_VALUE 101 | |
30 | +#endif | |
31 | +#endif | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/StdAfx.cpp
0 → 100644
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/StdAfx.h
0 → 100644
1 | +// stdafx.h : include file for standard system include files, | |
2 | +// or project specific include files that are used frequently, but | |
3 | +// are changed infrequently | |
4 | +// | |
5 | + | |
6 | +#if !defined(AFX_STDAFX_H__EF29CD01_9189_4CF3_8CC2_DC0F6BFCC1A0__INCLUDED_) | |
7 | +#define AFX_STDAFX_H__EF29CD01_9189_4CF3_8CC2_DC0F6BFCC1A0__INCLUDED_ | |
8 | + | |
9 | +#if _MSC_VER > 1000 | |
10 | +#pragma once | |
11 | +#endif // _MSC_VER > 1000 | |
12 | + | |
13 | +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers | |
14 | + | |
15 | +#include <afxwin.h> // MFC core and standard components | |
16 | +#include <afxext.h> // MFC extensions | |
17 | +#include <afxdisp.h> // MFC Automation classes | |
18 | +#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls | |
19 | +#ifndef _AFX_NO_AFXCMN_SUPPORT | |
20 | +#include <afxcmn.h> // MFC support for Windows Common Controls | |
21 | +#endif // _AFX_NO_AFXCMN_SUPPORT | |
22 | + | |
23 | + | |
24 | +//{{AFX_INSERT_LOCATION}} | |
25 | +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. | |
26 | + | |
27 | +#endif // !defined(AFX_STDAFX_H__EF29CD01_9189_4CF3_8CC2_DC0F6BFCC1A0__INCLUDED_) | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/res/ICODE.ico
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/15693/15693_Examples/Vc6.0/res/ICODE.rc2
0 → 100644
1 | +// | |
2 | +// ICODE.RC2 - resources Microsoft Visual C++ does not edit directly | |
3 | +// | |
4 | + | |
5 | +#ifdef APSTUDIO_INVOKED | |
6 | + #error this file is not editable by Microsoft Visual C++ | |
7 | +#endif //APSTUDIO_INVOKED | |
8 | + | |
9 | + | |
10 | +///////////////////////////////////////////////////////////////////////////// | |
11 | +// Add manually edited resources here... | |
12 | + | |
13 | +///////////////////////////////////////////////////////////////////////////// | ... | ... |
doc/D3&&D8&&T10ulm开发包/15693/ISO15693 related function .pdf
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/COM/cab/comRD800.cab
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/COM/cab/test.html
0 → 100644
1 | +<HTML> | |
2 | +<HEAD><TITLE>D8读卡器测试</TITLE></HEAD> | |
3 | +<BODY> | |
4 | +<OBJECT id=rd codeBase="comRD800.cab" WIDTH="0" HEIGHT="0" classid="clsid:638B238E-EB84-4933-B3C8-854B86140668"></OBJECT> | |
5 | + | |
6 | +<script language=javascript> | |
7 | + | |
8 | + | |
9 | +function m1CardTest() | |
10 | +{ | |
11 | + | |
12 | +var st; | |
13 | +var lSnr; | |
14 | +var msg= ""; | |
15 | + | |
16 | +st = rd.dc_init(100, 115200); | |
17 | +if(st <= 0) | |
18 | +{ | |
19 | + msg+=("dc_init error!"); | |
20 | + showMsg(msg); | |
21 | + return; | |
22 | +} | |
23 | +msg+=("dc_init ok!")+"</br>"; | |
24 | + | |
25 | + rd.dc_config_card(65); | |
26 | + | |
27 | +st = rd.dc_card_double(0); | |
28 | +if(st != 0) | |
29 | +{ | |
30 | + msg+=("dc_card error!"); | |
31 | + rd.dc_exit(); | |
32 | + showMsg(msg); | |
33 | + return; | |
34 | +} | |
35 | +msg+=("dc_card ok!</br>"); | |
36 | + | |
37 | +msg+="card id is : "+(rd.get_bstrRBuffer_asc+"</br>"); | |
38 | + | |
39 | +rd.put_bstrSBuffer_asc = "FFFFFFFFFFFF"; | |
40 | +st = rd.dc_load_key(0, 0); | |
41 | +if(st != 0) | |
42 | +{ | |
43 | + msg+=("dc_load_key error!"); | |
44 | + rd.dc_exit(); | |
45 | + showMsg(msg); | |
46 | + return; | |
47 | +} | |
48 | +msg+=("dc_load_key ok!</br>"); | |
49 | + | |
50 | +st = rd.dc_authentication(0, 0); | |
51 | +if(st != 0) | |
52 | +{ | |
53 | + msg+=("dc_authentication error!"); | |
54 | + rd.dc_exit(); | |
55 | + showMsg(msg); | |
56 | + return; | |
57 | +} | |
58 | +msg+=("dc_authentication ok!</br>"); | |
59 | + | |
60 | +rd.put_bstrSBuffer_asc = "31323334353637383930313233343536"; | |
61 | +st = rd.dc_write(2); | |
62 | +if(st != 0) | |
63 | +{ | |
64 | + msg+=("dc_write error!"); | |
65 | + rd.dc_exit(); | |
66 | + showMsg(msg); | |
67 | + return; | |
68 | +} | |
69 | +msg+=("dc_write ok!</br>"); | |
70 | + | |
71 | +st = rd.dc_read(2); | |
72 | +if(st != 0) | |
73 | +{ | |
74 | + msg+=("dc_read error!"); | |
75 | + rd.dc_exit(); | |
76 | + showMsg(msg); | |
77 | + return; | |
78 | +} | |
79 | +msg+=("dc_read ok!</br>"); | |
80 | +msg+="display the infomation in the format of characters " + (rd.get_bstrRBuffer+"</br>"); | |
81 | +msg+="display the infomation in the format of bytes " + (rd.get_bstrRBuffer_asc+"</br>"); | |
82 | + | |
83 | +rd.put_bstrSBuffer_asc = "30303030303030303030303030303030"; | |
84 | +st = rd.dc_write(2); | |
85 | +if(st != 0) | |
86 | +{ | |
87 | + msg+=("dc_write error!"); | |
88 | + rd.dc_exit(); | |
89 | + showMsg(msg); | |
90 | + return; | |
91 | +} | |
92 | +msg+=("dc_write ok!</br>"); | |
93 | + | |
94 | +st = rd.dc_read(2); | |
95 | +if(st != 0) | |
96 | +{ | |
97 | + msg+=("dc_read error!"); | |
98 | + rd.dc_exit(); | |
99 | + showMsg(msg); | |
100 | + return; | |
101 | +} | |
102 | +msg+=("dc_read ok!</br>"); | |
103 | +msg+="display the infomation in the format of characters " + (rd.get_bstrRBuffer+"</br>"); | |
104 | +msg+="display the infomation in the format of bytes " + (rd.get_bstrRBuffer_asc+"</br>"); | |
105 | + | |
106 | + | |
107 | +st = rd.dc_beep(5); | |
108 | +if(st != 0) | |
109 | +{ | |
110 | + msg+=("dc_beep error!"); | |
111 | + rd.dc_exit(); | |
112 | + showMsg(msg); | |
113 | + return; | |
114 | +} | |
115 | +msg+=("dc_beep ok!</br>"); | |
116 | + | |
117 | +st = rd.dc_exit(); | |
118 | +if(st != 0) | |
119 | +{ | |
120 | + msg+=("dc_exit error!"); | |
121 | + showMsg(msg); | |
122 | + return; | |
123 | +} | |
124 | +msg+=("dc_exit ok!</br>"); | |
125 | +showMsg(msg); | |
126 | +} | |
127 | + | |
128 | +function typeATest() | |
129 | +{ | |
130 | + var st; | |
131 | + var rlen; | |
132 | + var rbuff; | |
133 | + var msg = ""; | |
134 | + | |
135 | + st = rd.dc_init(100, 115200); | |
136 | + if(st <= 0) | |
137 | + { | |
138 | + msg+="dc init error"; | |
139 | + showMsg(msg); | |
140 | + return; | |
141 | + } | |
142 | + msg+="dc init ok</br>"; | |
143 | + | |
144 | + rd.dc_config_card(65); | |
145 | + | |
146 | + st = rd.dc_card(0, rbuff); | |
147 | + if(st!=0) | |
148 | + { | |
149 | + msg+="dc card error </br>"; | |
150 | + rd.dc_exit();showMsg(msg); | |
151 | + return; | |
152 | + } | |
153 | + msg+="dc card ok </br>"; | |
154 | + | |
155 | + msg+="card id is : "+(rd.get_bstrRBuffer_asc+"</br>"); | |
156 | + | |
157 | + st = rd.dc_pro_reset(rlen); | |
158 | + if(st!=0) | |
159 | + { | |
160 | + msg+="dc pro reset error </br>"; | |
161 | + rd.dc_exit();showMsg(msg); | |
162 | + return; | |
163 | + } | |
164 | + msg+="dc pro reset ok </br>"; | |
165 | + | |
166 | + msg+="reset infomation : "+(rd.get_bstrRBuffer_asc+"</br>"); | |
167 | + | |
168 | + | |
169 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
170 | + st =rd.dc_pro_command(5,rlen); | |
171 | + if(st!=0) | |
172 | + { | |
173 | + msg+="get a random number error </br>"; | |
174 | + rd.dc_exit(); | |
175 | + showMsg(msg); | |
176 | + return; | |
177 | + } | |
178 | + msg+="get a random number ok </br>"; | |
179 | + | |
180 | + rd.dc_beep(5); | |
181 | + | |
182 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
183 | + showMsg(msg); | |
184 | + rd.dc_exit(); | |
185 | +} | |
186 | + | |
187 | +function typeBTest() | |
188 | +{ | |
189 | + var st; | |
190 | + var rlen; | |
191 | + var rbuff; | |
192 | + var msg = ""; | |
193 | + | |
194 | + st = rd.dc_init(100, 115200); | |
195 | + if(st <= 0) | |
196 | + { | |
197 | + msg+="dc init error"; | |
198 | + showMsg(msg); | |
199 | + return; | |
200 | + } | |
201 | + msg+="dc init ok</br>"; | |
202 | + | |
203 | + rd.dc_config_card(66); | |
204 | + | |
205 | + st = rd.dc_card_b(); | |
206 | + if(st!=0) | |
207 | + { | |
208 | + msg+="dc card error </br>"; | |
209 | + rd.dc_exit();showMsg(msg); | |
210 | + return; | |
211 | + } | |
212 | + msg+="dc card ok </br>"; | |
213 | + | |
214 | + msg+="card reset infomation "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
215 | + | |
216 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
217 | + st =rd.dc_pro_command(5,rlen); | |
218 | + if(st!=0) | |
219 | + { | |
220 | + msg+="get a random number error </br>"; | |
221 | + rd.dc_exit(); | |
222 | + showMsg(msg); | |
223 | + return; | |
224 | + } | |
225 | + msg+="get a random number ok </br>"; | |
226 | + | |
227 | + rd.dc_beep(5); | |
228 | + | |
229 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
230 | + showMsg(msg); | |
231 | + rd.dc_exit(); | |
232 | + | |
233 | +} | |
234 | + | |
235 | +function M4428Test() | |
236 | +{ | |
237 | + var st; | |
238 | + var rlen; | |
239 | + var rbuff; | |
240 | + var msg = ""; | |
241 | + | |
242 | + st = rd.dc_init(100, 115200); | |
243 | + if(st <= 0) | |
244 | + { | |
245 | + msg+="dc init error"; | |
246 | + showMsg(msg); | |
247 | + return; | |
248 | + } | |
249 | + msg+="dc init ok</br>"; | |
250 | + | |
251 | + st = rd.dc_setcpu(12); | |
252 | + if(st != 0) | |
253 | + { | |
254 | + msg+="dc set cpu error" | |
255 | + showmsg(msg); | |
256 | + dc_exit(); | |
257 | + return; | |
258 | + } | |
259 | + msg+="dc set cpu ok</br>"; | |
260 | + | |
261 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
262 | + st = rd.dc_read_4428(160,10); | |
263 | + if(st != 0) | |
264 | + { | |
265 | + msg+="get a random number error"; | |
266 | + showMsg(msg) | |
267 | + rd.dc_exit(); | |
268 | + return; | |
269 | + } | |
270 | + msg+="get a random number ok</br>"; | |
271 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
272 | + | |
273 | + st = rd.dc_readpincount_4428(); | |
274 | + if (st <= 0) | |
275 | + { | |
276 | + msg+="get a random number error"; | |
277 | + showMsg(msg) | |
278 | + rd.dc_exit(); | |
279 | + return; | |
280 | + } | |
281 | + | |
282 | + rd.put_bstrSBuffer_asc = "ffff"; | |
283 | + st = rd.dc_verifypin_4428(); | |
284 | + if(st != 0) | |
285 | + { | |
286 | + msg+="get a random number error"; | |
287 | + showMsg(msg) | |
288 | + rd.dc_exit(); | |
289 | + return; | |
290 | + } | |
291 | + msg+="get a random number ok</br>"; | |
292 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
293 | + | |
294 | + rd.put_bstrSBuffer_asc = "decacd1234567890ccee"; | |
295 | + st = rd.dc_write_4428(160,10); | |
296 | + if(st != 0) | |
297 | + { | |
298 | + msg+="get a random number error"; | |
299 | + showMsg(msg) | |
300 | + rd.dc_exit(); | |
301 | + return; | |
302 | + } | |
303 | + msg+="get a random number ok</br>"; | |
304 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
305 | + | |
306 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
307 | + st = rd.dc_read_4428(160,10); | |
308 | + if(st != 0) | |
309 | + { | |
310 | + msg+="get a random number error"; | |
311 | + showMsg(msg) | |
312 | + rd.dc_exit(); | |
313 | + return; | |
314 | + } | |
315 | + msg+="get a random number ok</br>"; | |
316 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
317 | + | |
318 | + rd.dc_beep(5); | |
319 | + showMsg(msg); | |
320 | + rd.dc_exit(); | |
321 | + | |
322 | +} | |
323 | + | |
324 | +function M4442Test() | |
325 | +{ | |
326 | + var st; | |
327 | + var rlen; | |
328 | + var rbuff; | |
329 | + var msg = ""; | |
330 | + | |
331 | + st = rd.dc_init(100, 115200); | |
332 | + if(st <= 0) | |
333 | + { | |
334 | + msg+="dc init error"; | |
335 | + showMsg(msg); | |
336 | + return; | |
337 | + } | |
338 | + msg+="dc init ok</br>"; | |
339 | + | |
340 | + st = rd.dc_setcpu(12); | |
341 | + if(st != 0) | |
342 | + { | |
343 | + msg+="dc set cpu error" | |
344 | + showmsg(msg); | |
345 | + dc_exit(); | |
346 | + return; | |
347 | + } | |
348 | + msg+="dc set cpu ok</br>"; | |
349 | + | |
350 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
351 | + st = rd.dc_read_4442(160,10); | |
352 | + if(st != 0) | |
353 | + { | |
354 | + msg+="get a random number error"; | |
355 | + showMsg(msg) | |
356 | + rd.dc_exit(); | |
357 | + return; | |
358 | + } | |
359 | + msg+="get a random number ok</br>"; | |
360 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
361 | + | |
362 | + st = rd.dc_readpincount_4442(); | |
363 | + if (st <= 0) | |
364 | + { | |
365 | + msg+="get a random number error"; | |
366 | + showMsg(msg) | |
367 | + rd.dc_exit(); | |
368 | + return; | |
369 | + } | |
370 | + | |
371 | + rd.put_bstrSBuffer_asc = "ffffff"; | |
372 | + st = rd.dc_verifypin_4442(); | |
373 | + if(st != 0) | |
374 | + { | |
375 | + msg+="get a random number error"; | |
376 | + showMsg(msg) | |
377 | + rd.dc_exit(); | |
378 | + return; | |
379 | + } | |
380 | + msg+="get a random number ok</br>"; | |
381 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
382 | + | |
383 | + rd.put_bstrSBuffer_asc = "decacd1234567890ccee"; | |
384 | + st = rd.dc_write_4442(160,10); | |
385 | + if(st != 0) | |
386 | + { | |
387 | + msg+="get a random number error"; | |
388 | + showMsg(msg) | |
389 | + rd.dc_exit(); | |
390 | + return; | |
391 | + } | |
392 | + msg+="get a random number ok</br>"; | |
393 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
394 | + | |
395 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
396 | + st = rd.dc_read_4442(160,10); | |
397 | + if(st != 0) | |
398 | + { | |
399 | + msg+="get a random number error"; | |
400 | + showMsg(msg) | |
401 | + rd.dc_exit(); | |
402 | + return; | |
403 | + } | |
404 | + msg+="get a random number ok</br>"; | |
405 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
406 | + | |
407 | + rd.dc_beep(5); | |
408 | + showMsg(msg); | |
409 | + rd.dc_exit(); | |
410 | + | |
411 | +} | |
412 | + | |
413 | +function contactCpuTest() | |
414 | +{ | |
415 | + var st; | |
416 | + var rlen; | |
417 | + var rbuff; | |
418 | + var msg = ""; | |
419 | + | |
420 | + st = rd.dc_init(100, 115200); | |
421 | + if(st <= 0) | |
422 | + { | |
423 | + msg+="dc init error"; | |
424 | + showMsg(msg); | |
425 | + return; | |
426 | + } | |
427 | + msg+="dc init ok</br>"; | |
428 | + | |
429 | + st = rd.dc_setcpu(12); | |
430 | + if(st != 0) | |
431 | + { | |
432 | + msg+="dc set cpu error" | |
433 | + showmsg(msg); | |
434 | + dc_exit(); | |
435 | + return; | |
436 | + } | |
437 | + msg+="dc set cpu ok</br>"; | |
438 | + | |
439 | + st = rd.dc_cpureset(rlen); | |
440 | + if(st != 0) | |
441 | + { | |
442 | + msg+="dc cpu reset error"; | |
443 | + showMsg(msg) | |
444 | + dc_exit(); | |
445 | + return; | |
446 | + } | |
447 | + msg+="dc cpu reset ok</br>"; | |
448 | + | |
449 | + msg+="reset infomation : "+(rd.get_bstrRBuffer_asc+"</br>"); | |
450 | + | |
451 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
452 | + st = rd.dc_cpuapdu(5,rlen); | |
453 | + if(st != 0) | |
454 | + { | |
455 | + msg+="get a random number error"; | |
456 | + showMsg(msg) | |
457 | + dc_exit(); | |
458 | + return; | |
459 | + } | |
460 | + msg+="get a random number ok</br>"; | |
461 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
462 | + | |
463 | + | |
464 | + rd.dc_beep(5); | |
465 | + showMsg(msg); | |
466 | + rd.dc_exit(); | |
467 | + | |
468 | +} | |
469 | + | |
470 | + | |
471 | + function idCardTest() | |
472 | + { | |
473 | + | |
474 | + var st; //主要用于返回值 | |
475 | + var lSnr; //本用于取序列号,但在javascript只是当成dc_card函数的一个临时变量 | |
476 | + var rlen; //用于取一些返回值长度,但在javascript只是当成dc_card函数的一个临时变量 | |
477 | + var i,m,n; | |
478 | + var msg = ""; | |
479 | + | |
480 | + | |
481 | + | |
482 | + st = rd.dc_init(100, 115200); | |
483 | + if(st <= 0) | |
484 | + { | |
485 | + msg+="dc init error"; | |
486 | + showMsg(msg); | |
487 | + return; | |
488 | + } | |
489 | + msg+="dc init ok</br>"; | |
490 | + | |
491 | + //****************** 身份证 ************************** | |
492 | + //alert("开始读取身份证数据!"); | |
493 | + //rd.DC_find_i_d(); | |
494 | + st = rd.DC_start_i_d(); | |
495 | + if (st < 0) | |
496 | + { | |
497 | + msg+="读取身份证信息失败"; | |
498 | + showMsg(msg); | |
499 | + return; | |
500 | + } | |
501 | + var name = rd.DC_i_d_query_name(); | |
502 | + var sex = rd.DC_i_d_query_sex(); | |
503 | + var nation = rd.DC_i_d_query_nation(); | |
504 | + var birth = rd.DC_i_d_query_birth(); | |
505 | + var address = rd.DC_i_d_query_address(); | |
506 | + var number = rd.DC_i_d_query_id_number(); | |
507 | + var department = rd.DC_i_d_query_department(); | |
508 | + var expire = rd.DC_i_d_query_expire_day(); | |
509 | + var st=rd.DC_i_d_query_photo_bmp_buffer(); | |
510 | + var bmp_data_str=rd.get_bstrRBuffer_asc; | |
511 | + rd.put_bstrSBuffer = "c:/me.bmp"; | |
512 | + st = rd.DC_i_d_query_photo_file(); | |
513 | + | |
514 | + | |
515 | + rd.DC_end_i_d(); | |
516 | + | |
517 | + msg += "姓名 : "+ name + "</br>" | |
518 | + +"性别 : "+ sex + "</br>" | |
519 | + +"民族 : "+ nation + "</br>" | |
520 | + +"生日 : "+ birth + "</br>" | |
521 | + +"地址 : "+ address +"</br>" | |
522 | + +"身份证号 : "+ number +"</br>" | |
523 | + +"身份证签发机关 : "+department +"</br>" | |
524 | + +"有效期 : "+ expire +"</br>" | |
525 | + +"照片 bmp 文件十六进制数据的显示表示:" + bmp_data_str + "</br>" | |
526 | + +'<img src="c:/me.bmp" alt="me">'; | |
527 | + showMsg(msg); | |
528 | + } | |
529 | + | |
530 | + | |
531 | + function typeATest() | |
532 | + {//typeA非接触式cpu卡测试 | |
533 | + | |
534 | + var rlen,mrandom,resetbuff,msg = ""; | |
535 | + rd.dc_reset();//复位射频 | |
536 | + | |
537 | + result = rd.dc_config_card(65);//配置为A型卡片 | |
538 | + if(result < 0) | |
539 | + { | |
540 | + return; | |
541 | + } | |
542 | + | |
543 | + result = rd.dc_card_pro(rlen);//寻卡 | |
544 | + if(result < 0) | |
545 | + { | |
546 | + msg += "寻卡失败"; | |
547 | + showMsg(msg); | |
548 | + return; | |
549 | + } | |
550 | + msg+="寻卡成功</br>"; | |
551 | + | |
552 | + result =rd. dc_pro_reset(rlen);//复位卡片 | |
553 | + if(result < 0) | |
554 | + { | |
555 | + msg += "复位失败</br>" | |
556 | + showMsg(msg); | |
557 | + return; | |
558 | + } | |
559 | + resetbuff = rd.get_bstrRBuffer_asc;//获取复位信息 | |
560 | + msg += ("复位成功" + resetbuff)+"</br>"; | |
561 | + | |
562 | + | |
563 | + rd.put_bstrSBuffer_asc = "0084000008";//传送需要发送的指令数据 | |
564 | + result = rd.dc_pro_commandlink (5,rlen, 10,56);//发送指令 | |
565 | + if(result < 0) | |
566 | + { | |
567 | + msg += "发送指令失败</br>"; | |
568 | + showMsg(msg); | |
569 | + return; | |
570 | + } | |
571 | + mrandom = rd.get_bstrRBuffer_asc ; | |
572 | + msg += "取随机数成功,</br>随机数为 :"+ mrandom+"</br>"; | |
573 | + showMsg(msg); | |
574 | + | |
575 | + | |
576 | + } | |
577 | + | |
578 | +function showMsg(msg) | |
579 | +{ | |
580 | + x=document.getElementById("demo"); | |
581 | +x.innerHTML=msg; | |
582 | +} | |
583 | + | |
584 | +function mInit() | |
585 | +{ | |
586 | + rd.dc_init(100, 115200); | |
587 | +} | |
588 | + | |
589 | +function mBeep() | |
590 | +{ | |
591 | + rd.dc_beep(2); | |
592 | +} | |
593 | + | |
594 | +function mExit() | |
595 | +{ | |
596 | + rd.dc_exit(); | |
597 | +} | |
598 | + | |
599 | +</script> | |
600 | + | |
601 | +<!-- Insert HTML here --> | |
602 | + | |
603 | +<table> | |
604 | +<tr> | |
605 | + <td><button type="button" onclick="m1CardTest()" style="width:200">m1 card test </button></td> | |
606 | + <td><button type="button" onclick="typeATest()" style="width:200">type a card test </button></td> | |
607 | + <td><button type="button" onclick="typeBTest()" style="width:200">type b card test </button></td> | |
608 | + <td><button type="button" onclick="contactCpuTest()" style="width:200">contact cpu card test</button></td> | |
609 | +</tr> | |
610 | +<tr> | |
611 | + <td><button type="button" onclick="mInit()" style="width:200">mInit </button></td> | |
612 | + <td><button type="button" onclick="M4442Test()" style="width:200">M4442Test </button></td> | |
613 | + <td><button type="button" onclick="mExit()" style="width:200">mExit </button></td> | |
614 | + <td><button type="button" onclick="M4428Test()" style="width:200">4428</button></td> | |
615 | + <td><button type="button" onclick="idCardTest()" style="width:200">idCardTest</button></td> | |
616 | + idCardTest | |
617 | +</tr> | |
618 | + | |
619 | +</table> | |
620 | + | |
621 | +<p id="demo"> | |
622 | + test log | |
623 | +</p> | |
624 | + | |
625 | +</BODY> | |
626 | +</HTML> | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/comdll/D8组件使用方法.doc
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/COM/comdll/test.html
0 → 100644
1 | +<HTML> | |
2 | +<HEAD><TITLE>D8读卡器测试</TITLE></HEAD> | |
3 | +<BODY> | |
4 | +<OBJECT id=rd codeBase="comRD800.cab" WIDTH="0" HEIGHT="0" classid="clsid:638B238E-EB84-4933-B3C8-854B86140668"></OBJECT> | |
5 | + | |
6 | +<script language=javascript> | |
7 | + | |
8 | + | |
9 | +function m1CardTest() | |
10 | +{ | |
11 | + | |
12 | +var st; | |
13 | +var lSnr; | |
14 | +var msg= ""; | |
15 | + | |
16 | +st = rd.dc_init(100, 115200); | |
17 | +if(st <= 0) | |
18 | +{ | |
19 | + msg+=("dc_init error!"); | |
20 | + showMsg(msg); | |
21 | + return; | |
22 | +} | |
23 | +msg+=("dc_init ok!")+"</br>"; | |
24 | + | |
25 | + rd.dc_config_card(65); | |
26 | + | |
27 | +st = rd.dc_card_double(0); | |
28 | +if(st != 0) | |
29 | +{ | |
30 | + msg+=("dc_card error!"); | |
31 | + rd.dc_exit(); | |
32 | + showMsg(msg); | |
33 | + return; | |
34 | +} | |
35 | +msg+=("dc_card ok!</br>"); | |
36 | + | |
37 | +msg+="card id is : "+(rd.get_bstrRBuffer_asc+"</br>"); | |
38 | + | |
39 | +rd.put_bstrSBuffer_asc = "FFFFFFFFFFFF"; | |
40 | +st = rd.dc_load_key(0, 0); | |
41 | +if(st != 0) | |
42 | +{ | |
43 | + msg+=("dc_load_key error!"); | |
44 | + rd.dc_exit(); | |
45 | + showMsg(msg); | |
46 | + return; | |
47 | +} | |
48 | +msg+=("dc_load_key ok!</br>"); | |
49 | + | |
50 | +st = rd.dc_authentication(0, 0); | |
51 | +if(st != 0) | |
52 | +{ | |
53 | + msg+=("dc_authentication error!"); | |
54 | + rd.dc_exit(); | |
55 | + showMsg(msg); | |
56 | + return; | |
57 | +} | |
58 | +msg+=("dc_authentication ok!</br>"); | |
59 | + | |
60 | +rd.put_bstrSBuffer_asc = "31323334353637383930313233343536"; | |
61 | +st = rd.dc_write(2); | |
62 | +if(st != 0) | |
63 | +{ | |
64 | + msg+=("dc_write error!"); | |
65 | + rd.dc_exit(); | |
66 | + showMsg(msg); | |
67 | + return; | |
68 | +} | |
69 | +msg+=("dc_write ok!</br>"); | |
70 | + | |
71 | +st = rd.dc_read(2); | |
72 | +if(st != 0) | |
73 | +{ | |
74 | + msg+=("dc_read error!"); | |
75 | + rd.dc_exit(); | |
76 | + showMsg(msg); | |
77 | + return; | |
78 | +} | |
79 | +msg+=("dc_read ok!</br>"); | |
80 | +msg+="display the infomation in the format of characters " + (rd.get_bstrRBuffer+"</br>"); | |
81 | +msg+="display the infomation in the format of bytes " + (rd.get_bstrRBuffer_asc+"</br>"); | |
82 | + | |
83 | +rd.put_bstrSBuffer_asc = "30303030303030303030303030303030"; | |
84 | +st = rd.dc_write(2); | |
85 | +if(st != 0) | |
86 | +{ | |
87 | + msg+=("dc_write error!"); | |
88 | + rd.dc_exit(); | |
89 | + showMsg(msg); | |
90 | + return; | |
91 | +} | |
92 | +msg+=("dc_write ok!</br>"); | |
93 | + | |
94 | +st = rd.dc_read(2); | |
95 | +if(st != 0) | |
96 | +{ | |
97 | + msg+=("dc_read error!"); | |
98 | + rd.dc_exit(); | |
99 | + showMsg(msg); | |
100 | + return; | |
101 | +} | |
102 | +msg+=("dc_read ok!</br>"); | |
103 | +msg+="display the infomation in the format of characters " + (rd.get_bstrRBuffer+"</br>"); | |
104 | +msg+="display the infomation in the format of bytes " + (rd.get_bstrRBuffer_asc+"</br>"); | |
105 | + | |
106 | + | |
107 | +st = rd.dc_beep(5); | |
108 | +if(st != 0) | |
109 | +{ | |
110 | + msg+=("dc_beep error!"); | |
111 | + rd.dc_exit(); | |
112 | + showMsg(msg); | |
113 | + return; | |
114 | +} | |
115 | +msg+=("dc_beep ok!</br>"); | |
116 | + | |
117 | +st = rd.dc_exit(); | |
118 | +if(st != 0) | |
119 | +{ | |
120 | + msg+=("dc_exit error!"); | |
121 | + showMsg(msg); | |
122 | + return; | |
123 | +} | |
124 | +msg+=("dc_exit ok!</br>"); | |
125 | +showMsg(msg); | |
126 | +} | |
127 | + | |
128 | +function typeATest() | |
129 | +{ | |
130 | + var st; | |
131 | + var rlen; | |
132 | + var rbuff; | |
133 | + var msg = ""; | |
134 | + | |
135 | + st = rd.dc_init(100, 115200); | |
136 | + if(st <= 0) | |
137 | + { | |
138 | + msg+="dc init error"; | |
139 | + showMsg(msg); | |
140 | + return; | |
141 | + } | |
142 | + msg+="dc init ok</br>"; | |
143 | + | |
144 | + rd.dc_config_card(65); | |
145 | + | |
146 | + st = rd.dc_card(0, rbuff); | |
147 | + if(st!=0) | |
148 | + { | |
149 | + msg+="dc card error </br>"; | |
150 | + rd.dc_exit();showMsg(msg); | |
151 | + return; | |
152 | + } | |
153 | + msg+="dc card ok </br>"; | |
154 | + | |
155 | + msg+="card id is : "+(rd.get_bstrRBuffer_asc+"</br>"); | |
156 | + | |
157 | + st = rd.dc_pro_reset(rlen); | |
158 | + if(st!=0) | |
159 | + { | |
160 | + msg+="dc pro reset error </br>"; | |
161 | + rd.dc_exit();showMsg(msg); | |
162 | + return; | |
163 | + } | |
164 | + msg+="dc pro reset ok </br>"; | |
165 | + | |
166 | + msg+="reset infomation : "+(rd.get_bstrRBuffer_asc+"</br>"); | |
167 | + | |
168 | + | |
169 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
170 | + st =rd.dc_pro_command(5,rlen); | |
171 | + if(st!=0) | |
172 | + { | |
173 | + msg+="get a random number error </br>"; | |
174 | + rd.dc_exit(); | |
175 | + showMsg(msg); | |
176 | + return; | |
177 | + } | |
178 | + msg+="get a random number ok </br>"; | |
179 | + | |
180 | + rd.dc_beep(5); | |
181 | + | |
182 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
183 | + showMsg(msg); | |
184 | + rd.dc_exit(); | |
185 | +} | |
186 | + | |
187 | +function typeBTest() | |
188 | +{ | |
189 | + var st; | |
190 | + var rlen; | |
191 | + var rbuff; | |
192 | + var msg = ""; | |
193 | + | |
194 | + st = rd.dc_init(100, 115200); | |
195 | + if(st <= 0) | |
196 | + { | |
197 | + msg+="dc init error"; | |
198 | + showMsg(msg); | |
199 | + return; | |
200 | + } | |
201 | + msg+="dc init ok</br>"; | |
202 | + | |
203 | + rd.dc_config_card(66); | |
204 | + | |
205 | + st = rd.dc_card_b(); | |
206 | + if(st!=0) | |
207 | + { | |
208 | + msg+="dc card error </br>"; | |
209 | + rd.dc_exit();showMsg(msg); | |
210 | + return; | |
211 | + } | |
212 | + msg+="dc card ok </br>"; | |
213 | + | |
214 | + msg+="card reset infomation "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
215 | + | |
216 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
217 | + st =rd.dc_pro_command(5,rlen); | |
218 | + if(st!=0) | |
219 | + { | |
220 | + msg+="get a random number error </br>"; | |
221 | + rd.dc_exit(); | |
222 | + showMsg(msg); | |
223 | + return; | |
224 | + } | |
225 | + msg+="get a random number ok </br>"; | |
226 | + | |
227 | + rd.dc_beep(5); | |
228 | + | |
229 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
230 | + showMsg(msg); | |
231 | + rd.dc_exit(); | |
232 | + | |
233 | +} | |
234 | + | |
235 | +function M4428Test() | |
236 | +{ | |
237 | + var st; | |
238 | + var rlen; | |
239 | + var rbuff; | |
240 | + var msg = ""; | |
241 | + | |
242 | + st = rd.dc_init(100, 115200); | |
243 | + if(st <= 0) | |
244 | + { | |
245 | + msg+="dc init error"; | |
246 | + showMsg(msg); | |
247 | + return; | |
248 | + } | |
249 | + msg+="dc init ok</br>"; | |
250 | + | |
251 | + st = rd.dc_setcpu(12); | |
252 | + if(st != 0) | |
253 | + { | |
254 | + msg+="dc set cpu error" | |
255 | + showmsg(msg); | |
256 | + dc_exit(); | |
257 | + return; | |
258 | + } | |
259 | + msg+="dc set cpu ok</br>"; | |
260 | + | |
261 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
262 | + st = rd.dc_read_4428(160,10); | |
263 | + if(st != 0) | |
264 | + { | |
265 | + msg+="get a random number error"; | |
266 | + showMsg(msg) | |
267 | + rd.dc_exit(); | |
268 | + return; | |
269 | + } | |
270 | + msg+="get a random number ok</br>"; | |
271 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
272 | + | |
273 | + st = rd.dc_readpincount_4428(); | |
274 | + if (st <= 0) | |
275 | + { | |
276 | + msg+="get a random number error"; | |
277 | + showMsg(msg) | |
278 | + rd.dc_exit(); | |
279 | + return; | |
280 | + } | |
281 | + | |
282 | + rd.put_bstrSBuffer_asc = "ffff"; | |
283 | + st = rd.dc_verifypin_4428(); | |
284 | + if(st != 0) | |
285 | + { | |
286 | + msg+="get a random number error"; | |
287 | + showMsg(msg) | |
288 | + rd.dc_exit(); | |
289 | + return; | |
290 | + } | |
291 | + msg+="get a random number ok</br>"; | |
292 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
293 | + | |
294 | + rd.put_bstrSBuffer_asc = "decacd1234567890ccee"; | |
295 | + st = rd.dc_write_4428(160,10); | |
296 | + if(st != 0) | |
297 | + { | |
298 | + msg+="get a random number error"; | |
299 | + showMsg(msg) | |
300 | + rd.dc_exit(); | |
301 | + return; | |
302 | + } | |
303 | + msg+="get a random number ok</br>"; | |
304 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
305 | + | |
306 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
307 | + st = rd.dc_read_4428(160,10); | |
308 | + if(st != 0) | |
309 | + { | |
310 | + msg+="get a random number error"; | |
311 | + showMsg(msg) | |
312 | + rd.dc_exit(); | |
313 | + return; | |
314 | + } | |
315 | + msg+="get a random number ok</br>"; | |
316 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
317 | + | |
318 | + rd.dc_beep(5); | |
319 | + showMsg(msg); | |
320 | + rd.dc_exit(); | |
321 | + | |
322 | +} | |
323 | + | |
324 | +function M4442Test() | |
325 | +{ | |
326 | + var st; | |
327 | + var rlen; | |
328 | + var rbuff; | |
329 | + var msg = ""; | |
330 | + | |
331 | + st = rd.dc_init(100, 115200); | |
332 | + if(st <= 0) | |
333 | + { | |
334 | + msg+="dc init error"; | |
335 | + showMsg(msg); | |
336 | + return; | |
337 | + } | |
338 | + msg+="dc init ok</br>"; | |
339 | + | |
340 | + st = rd.dc_setcpu(12); | |
341 | + if(st != 0) | |
342 | + { | |
343 | + msg+="dc set cpu error" | |
344 | + showmsg(msg); | |
345 | + dc_exit(); | |
346 | + return; | |
347 | + } | |
348 | + msg+="dc set cpu ok</br>"; | |
349 | + | |
350 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
351 | + st = rd.dc_read_4442(160,10); | |
352 | + if(st != 0) | |
353 | + { | |
354 | + msg+="get a random number error"; | |
355 | + showMsg(msg) | |
356 | + rd.dc_exit(); | |
357 | + return; | |
358 | + } | |
359 | + msg+="get a random number ok</br>"; | |
360 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
361 | + | |
362 | + st = rd.dc_readpincount_4442(); | |
363 | + if (st <= 0) | |
364 | + { | |
365 | + msg+="get a random number error"; | |
366 | + showMsg(msg) | |
367 | + rd.dc_exit(); | |
368 | + return; | |
369 | + } | |
370 | + | |
371 | + rd.put_bstrSBuffer_asc = "ffffff"; | |
372 | + st = rd.dc_verifypin_4442(); | |
373 | + if(st != 0) | |
374 | + { | |
375 | + msg+="get a random number error"; | |
376 | + showMsg(msg) | |
377 | + rd.dc_exit(); | |
378 | + return; | |
379 | + } | |
380 | + msg+="get a random number ok</br>"; | |
381 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
382 | + | |
383 | + rd.put_bstrSBuffer_asc = "decacd1234567890ccee"; | |
384 | + st = rd.dc_write_4442(160,10); | |
385 | + if(st != 0) | |
386 | + { | |
387 | + msg+="get a random number error"; | |
388 | + showMsg(msg) | |
389 | + rd.dc_exit(); | |
390 | + return; | |
391 | + } | |
392 | + msg+="get a random number ok</br>"; | |
393 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
394 | + | |
395 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
396 | + st = rd.dc_read_4442(160,10); | |
397 | + if(st != 0) | |
398 | + { | |
399 | + msg+="get a random number error"; | |
400 | + showMsg(msg) | |
401 | + rd.dc_exit(); | |
402 | + return; | |
403 | + } | |
404 | + msg+="get a random number ok</br>"; | |
405 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
406 | + | |
407 | + rd.dc_beep(5); | |
408 | + showMsg(msg); | |
409 | + rd.dc_exit(); | |
410 | + | |
411 | +} | |
412 | + | |
413 | +function contactCpuTest() | |
414 | +{ | |
415 | + var st; | |
416 | + var rlen; | |
417 | + var rbuff; | |
418 | + var msg = ""; | |
419 | + | |
420 | + st = rd.dc_init(100, 115200); | |
421 | + if(st <= 0) | |
422 | + { | |
423 | + msg+="dc init error"; | |
424 | + showMsg(msg); | |
425 | + return; | |
426 | + } | |
427 | + msg+="dc init ok</br>"; | |
428 | + | |
429 | + st = rd.dc_setcpu(12); | |
430 | + if(st != 0) | |
431 | + { | |
432 | + msg+="dc set cpu error" | |
433 | + showmsg(msg); | |
434 | + dc_exit(); | |
435 | + return; | |
436 | + } | |
437 | + msg+="dc set cpu ok</br>"; | |
438 | + | |
439 | + st = rd.dc_cpureset(rlen); | |
440 | + if(st != 0) | |
441 | + { | |
442 | + msg+="dc cpu reset error"; | |
443 | + showMsg(msg) | |
444 | + dc_exit(); | |
445 | + return; | |
446 | + } | |
447 | + msg+="dc cpu reset ok</br>"; | |
448 | + | |
449 | + msg+="reset infomation : "+(rd.get_bstrRBuffer_asc+"</br>"); | |
450 | + | |
451 | + rd.put_bstrSBuffer_asc = "0084000008"; | |
452 | + st = rd.dc_cpuapdu(5,rlen); | |
453 | + if(st != 0) | |
454 | + { | |
455 | + msg+="get a random number error"; | |
456 | + showMsg(msg) | |
457 | + dc_exit(); | |
458 | + return; | |
459 | + } | |
460 | + msg+="get a random number ok</br>"; | |
461 | + msg+=" the random number is "+(rd.get_bstrRBuffer_asc)+ " </br>"; | |
462 | + | |
463 | + | |
464 | + rd.dc_beep(5); | |
465 | + showMsg(msg); | |
466 | + rd.dc_exit(); | |
467 | + | |
468 | +} | |
469 | + | |
470 | + | |
471 | + function idCardTest() | |
472 | + { | |
473 | + | |
474 | + var st; //主要用于返回值 | |
475 | + var lSnr; //本用于取序列号,但在javascript只是当成dc_card函数的一个临时变量 | |
476 | + var rlen; //用于取一些返回值长度,但在javascript只是当成dc_card函数的一个临时变量 | |
477 | + var i,m,n; | |
478 | + var msg = ""; | |
479 | + | |
480 | + | |
481 | + | |
482 | + st = rd.dc_init(100, 115200); | |
483 | + if(st <= 0) | |
484 | + { | |
485 | + msg+="dc init error"; | |
486 | + showMsg(msg); | |
487 | + return; | |
488 | + } | |
489 | + msg+="dc init ok</br>"; | |
490 | + | |
491 | + //****************** 身份证 ************************** | |
492 | + //alert("开始读取身份证数据!"); | |
493 | + //rd.DC_find_i_d(); | |
494 | + st = rd.DC_start_i_d(); | |
495 | + if (st < 0) | |
496 | + { | |
497 | + msg+="读取身份证信息失败"; | |
498 | + showMsg(msg); | |
499 | + return; | |
500 | + } | |
501 | + var name = rd.DC_i_d_query_name(); | |
502 | + var sex = rd.DC_i_d_query_sex(); | |
503 | + var nation = rd.DC_i_d_query_nation(); | |
504 | + var birth = rd.DC_i_d_query_birth(); | |
505 | + var address = rd.DC_i_d_query_address(); | |
506 | + var number = rd.DC_i_d_query_id_number(); | |
507 | + var department = rd.DC_i_d_query_department(); | |
508 | + var expire = rd.DC_i_d_query_expire_day(); | |
509 | + var st=rd.DC_i_d_query_photo_bmp_buffer(); | |
510 | + var bmp_data_str=rd.get_bstrRBuffer_asc; | |
511 | + rd.put_bstrSBuffer = "c:/me.bmp"; | |
512 | + st = rd.DC_i_d_query_photo_file(); | |
513 | + | |
514 | + | |
515 | + rd.DC_end_i_d(); | |
516 | + | |
517 | + msg += "姓名 : "+ name + "</br>" | |
518 | + +"性别 : "+ sex + "</br>" | |
519 | + +"民族 : "+ nation + "</br>" | |
520 | + +"生日 : "+ birth + "</br>" | |
521 | + +"地址 : "+ address +"</br>" | |
522 | + +"身份证号 : "+ number +"</br>" | |
523 | + +"身份证签发机关 : "+department +"</br>" | |
524 | + +"有效期 : "+ expire +"</br>" | |
525 | + +"照片 bmp 文件十六进制数据的显示表示:" + bmp_data_str + "</br>" | |
526 | + +'<img src="c:/me.bmp" alt="me">'; | |
527 | + showMsg(msg); | |
528 | + } | |
529 | + | |
530 | + | |
531 | + function typeATest() | |
532 | + {//typeA非接触式cpu卡测试 | |
533 | + | |
534 | + var rlen,mrandom,resetbuff,msg = ""; | |
535 | + rd.dc_reset();//复位射频 | |
536 | + | |
537 | + result = rd.dc_config_card(65);//配置为A型卡片 | |
538 | + if(result < 0) | |
539 | + { | |
540 | + return; | |
541 | + } | |
542 | + | |
543 | + result = rd.dc_card_pro(rlen);//寻卡 | |
544 | + if(result < 0) | |
545 | + { | |
546 | + msg += "寻卡失败"; | |
547 | + showMsg(msg); | |
548 | + return; | |
549 | + } | |
550 | + msg+="寻卡成功</br>"; | |
551 | + | |
552 | + result =rd. dc_pro_reset(rlen);//复位卡片 | |
553 | + if(result < 0) | |
554 | + { | |
555 | + msg += "复位失败</br>" | |
556 | + showMsg(msg); | |
557 | + return; | |
558 | + } | |
559 | + resetbuff = rd.get_bstrRBuffer_asc;//获取复位信息 | |
560 | + msg += ("复位成功" + resetbuff)+"</br>"; | |
561 | + | |
562 | + | |
563 | + rd.put_bstrSBuffer_asc = "0084000008";//传送需要发送的指令数据 | |
564 | + result = rd.dc_pro_commandlink (5,rlen, 10,56);//发送指令 | |
565 | + if(result < 0) | |
566 | + { | |
567 | + msg += "发送指令失败</br>"; | |
568 | + showMsg(msg); | |
569 | + return; | |
570 | + } | |
571 | + mrandom = rd.get_bstrRBuffer_asc ; | |
572 | + msg += "取随机数成功,</br>随机数为 :"+ mrandom+"</br>"; | |
573 | + showMsg(msg); | |
574 | + | |
575 | + | |
576 | + } | |
577 | + | |
578 | +function showMsg(msg) | |
579 | +{ | |
580 | + x=document.getElementById("demo"); | |
581 | +x.innerHTML=msg; | |
582 | +} | |
583 | + | |
584 | +function mInit() | |
585 | +{ | |
586 | + rd.dc_init(100, 115200); | |
587 | +} | |
588 | + | |
589 | +function mBeep() | |
590 | +{ | |
591 | + rd.dc_beep(2); | |
592 | +} | |
593 | + | |
594 | +function mExit() | |
595 | +{ | |
596 | + rd.dc_exit(); | |
597 | +} | |
598 | + | |
599 | +</script> | |
600 | + | |
601 | +<!-- Insert HTML here --> | |
602 | + | |
603 | +<table> | |
604 | +<tr> | |
605 | + <td><button type="button" onclick="m1CardTest()" style="width:200">m1 card test </button></td> | |
606 | + <td><button type="button" onclick="typeATest()" style="width:200">type a card test </button></td> | |
607 | + <td><button type="button" onclick="typeBTest()" style="width:200">type b card test </button></td> | |
608 | + <td><button type="button" onclick="contactCpuTest()" style="width:200">contact cpu card test</button></td> | |
609 | +</tr> | |
610 | +<tr> | |
611 | + <td><button type="button" onclick="mInit()" style="width:200">mInit </button></td> | |
612 | + <td><button type="button" onclick="M4442Test()" style="width:200">M4442Test </button></td> | |
613 | + <td><button type="button" onclick="mExit()" style="width:200">mExit </button></td> | |
614 | + <td><button type="button" onclick="M4428Test()" style="width:200">4428</button></td> | |
615 | + <td><button type="button" onclick="idCardTest()" style="width:200">idCardTest</button></td> | |
616 | + idCardTest | |
617 | +</tr> | |
618 | + | |
619 | +</table> | |
620 | + | |
621 | +<p id="demo"> | |
622 | + test log | |
623 | +</p> | |
624 | + | |
625 | +</BODY> | |
626 | +</HTML> | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/example/asp/aspTest.asp
0 → 100644
1 | +<HTML> | |
2 | +<HEAD><TITLE>测试网站</TITLE></HEAD> | |
3 | +<BODY> | |
4 | +<OBJECT id=rd codeBase=/comRD800.dll classid="clsid:638B238E-EB84-4933-B3C8-854B86140668"></OBJECT> | |
5 | + | |
6 | +<script language=javascript> | |
7 | + | |
8 | +function OnTest() | |
9 | +{ | |
10 | +/////////////////////////////////////////////////////////////////////////////// | |
11 | +//以下为非接触式读写器函数调用例子 for javascript | |
12 | +//注意个别函数(例如dc_disp_str)只有当设备满足要求(例如有数码显示)时才有效 | |
13 | +//更详细的帮助可参照32位动态库对应的函数使用说明 | |
14 | +/////////////////////////////////////////////////////////////////////////////// | |
15 | + | |
16 | +var st; //主要用于返回值 | |
17 | +var lSnr; //本用于取序列号,但在javascript只是当成dc_card函数的一个临时变量 | |
18 | + | |
19 | +//初始化端口 | |
20 | +//第一个参数为0表示COM1,为1表示COM2,以此类推 | |
21 | +//第二个参数为通讯波特率 | |
22 | +st = rd.dc_init(100, 115200); | |
23 | +if(st <= 0) //返回值小于等于0表示失败 | |
24 | +{ | |
25 | + alert("dc_init error!"); | |
26 | + return; | |
27 | +} | |
28 | +alert("dc_init ok!"); | |
29 | + | |
30 | +//寻卡,能返回在工作区域内某张卡的序列号 | |
31 | +//第一个参数一般设置为0,表示IDLE模式,一次只对一张卡操作 | |
32 | +//第二个参数在javascript只是当成dc_card函数的一个临时变量,仅在vbscript中调用后能正确返回序列号 | |
33 | +st = rd.dc_card(0, lSnr); | |
34 | +if(st != 0) //返回值小于0表示失败 | |
35 | +{ | |
36 | + alert("dc_card error!"); | |
37 | + rd.dc_exit(); | |
38 | + return; | |
39 | +} | |
40 | +alert("dc_card ok!"); | |
41 | +alert(rd.get_bstrRBuffer); //序列号为rd.get_bstrRBuffer,一般有不可显示字符出现 | |
42 | +alert(rd.get_bstrRBuffer_asc); //序列号十六进制ascll码字符串表示为rd.get_bstrRBuffer_asc | |
43 | + | |
44 | +//将密码装入读写模块RAM中 | |
45 | +//第一个参数为装入密码模式 | |
46 | +//第二个参数为扇区号 | |
47 | +rd.put_bstrSBuffer_asc = "FFFFFFFFFFFF"; //在调用dc_load_key必须前先设置属性rd.put_bstrSBuffer或rd.put_bstrSBuffer_asc | |
48 | +st = rd.dc_load_key(0, 0); | |
49 | +if(st != 0) //返回值小于0表示失败 | |
50 | +{ | |
51 | + alert("dc_load_key error!"); | |
52 | + rd.dc_exit(); | |
53 | + return; | |
54 | +} | |
55 | +alert("dc_load_key ok!"); | |
56 | + | |
57 | +//核对密码函数 | |
58 | +//第一个参数为密码验证模式 | |
59 | +//第二个参数为扇区号 | |
60 | +st = rd.dc_authentication(0, 0); | |
61 | +if(st != 0) //返回值小于0表示失败 | |
62 | +{ | |
63 | + alert("dc_authentication error!"); | |
64 | + rd.dc_exit(); | |
65 | + return; | |
66 | +} | |
67 | +alert("dc_authentication ok!"); | |
68 | + | |
69 | +//向卡中写入数据,一次必须写一个块 | |
70 | +//第一个参数为块地址 | |
71 | +//在调用dc_write必须前先设置属性rd.put_bstrSBuffer或rd.put_bstrSBuffer_asc | |
72 | +rd.put_bstrSBuffer_asc = "31323334353637383930313233343536"; | |
73 | +st = rd.dc_write(2); | |
74 | +if(st != 0) //返回值小于0表示失败 | |
75 | +{ | |
76 | + alert("dc_write error!"); | |
77 | + rd.dc_exit(); | |
78 | + return; | |
79 | +} | |
80 | +alert("dc_write ok!"); | |
81 | + | |
82 | +//读取卡中数据,一次必须读一个块 | |
83 | +//第一个参数为块地址 | |
84 | +//取出的数据放在属性放在rd.put_bstrSBuffer(正常表示)和rd.put_bstrSBuffer_asc(十六进制ascll码字符串表示)中 | |
85 | +st = rd.dc_read(2); | |
86 | +if(st != 0) //返回值小于0表示失败 | |
87 | +{ | |
88 | + alert("dc_read error!"); | |
89 | + rd.dc_exit(); | |
90 | + return; | |
91 | +} | |
92 | +alert("dc_read ok!"); | |
93 | +alert(rd.get_bstrRBuffer); | |
94 | +alert(rd.get_bstrRBuffer_asc); | |
95 | + | |
96 | +//设置读写器时间 | |
97 | +//04年 星期四 9月 9日 11点 20分 50秒 | |
98 | +rd.put_bstrSBuffer_asc = "04040909112050"; | |
99 | +st = rd.dc_settime(); | |
100 | +if(st != 0) //返回值小于0表示失败 | |
101 | +{ | |
102 | + alert("dc_settime error!"); | |
103 | + rd.dc_exit(); | |
104 | + return; | |
105 | +} | |
106 | +alert("dc_settime ok!"); | |
107 | + | |
108 | +//在读写器的数码管上显示数字 | |
109 | +rd.put_bstrSBuffer = "12345678\0"; //显示12345678,注意字符串后必须附加一个ascll为0x00结束符号; | |
110 | +st = rd.dc_disp_str(); | |
111 | +if(st != 0) //返回值小于0表示失败 | |
112 | +{ | |
113 | + alert("dc_disp_str error!"); | |
114 | + rd.dc_exit(); | |
115 | + return; | |
116 | +} | |
117 | +alert("dc_disp_str ok!"); | |
118 | + | |
119 | +//蜂鸣 | |
120 | +//第一个参数为蜂鸣时间,单位是10毫秒 | |
121 | +st = rd.dc_beep(50); | |
122 | +if(st != 0) //返回值小于0表示失败 | |
123 | +{ | |
124 | + alert("dc_beep error!"); | |
125 | + rd.dc_exit(); | |
126 | + return; | |
127 | +} | |
128 | +alert("dc_beep ok!"); | |
129 | + | |
130 | +//关闭端口 | |
131 | +st = rd.dc_exit(); | |
132 | +if(st != 0) //返回值小于0表示失败 | |
133 | +{ | |
134 | + alert("dc_exit error!"); | |
135 | + return; | |
136 | +} | |
137 | +alert("dc_exit ok!"); | |
138 | + | |
139 | +} | |
140 | + | |
141 | +</script> | |
142 | + | |
143 | +<!-- Insert HTML here --> | |
144 | +<INPUT id=test type=button value=test onclick=OnTest()></BODY> | |
145 | +</BODY> | |
146 | +</HTML> | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/example/vb-15693/Form1.frm
0 → 100644
1 | +VERSION 5.00 | |
2 | +Begin VB.Form Form1 | |
3 | + Caption = "15693" | |
4 | + ClientHeight = 5265 | |
5 | + ClientLeft = 60 | |
6 | + ClientTop = 450 | |
7 | + ClientWidth = 6345 | |
8 | + LinkTopic = "Form1" | |
9 | + ScaleHeight = 5265 | |
10 | + ScaleWidth = 6345 | |
11 | + StartUpPosition = 3 'Windows Default | |
12 | + Begin VB.CommandButton Cmd_Test | |
13 | + Caption = "Test" | |
14 | + Height = 495 | |
15 | + Left = 4320 | |
16 | + TabIndex = 1 | |
17 | + Top = 720 | |
18 | + Width = 1335 | |
19 | + End | |
20 | + Begin VB.ListBox List1 | |
21 | + Height = 4155 | |
22 | + Left = 600 | |
23 | + TabIndex = 0 | |
24 | + Top = 600 | |
25 | + Width = 3495 | |
26 | + End | |
27 | +End | |
28 | +Attribute VB_Name = "Form1" | |
29 | +Attribute VB_GlobalNameSpace = False | |
30 | +Attribute VB_Creatable = False | |
31 | +Attribute VB_PredeclaredId = True | |
32 | +Attribute VB_Exposed = False | |
33 | +Private Sub Cmd_Test_Click() | |
34 | +Dim st As Integer | |
35 | +Dim UID As String * 16 | |
36 | +Dim rd As COMRD800Lib.RD800 | |
37 | +Set rd = New COMRD800Lib.RD800 | |
38 | +List1.Clear | |
39 | + | |
40 | + | |
41 | +st = rd.dc_init(100, 115200) | |
42 | +If st <= 0 Then | |
43 | + List1.AddItem "dc_init error!" | |
44 | + Set rd = Nothing | |
45 | + Exit Sub | |
46 | +End If | |
47 | +List1.AddItem "dc_init ok!" | |
48 | + | |
49 | +'Request single card | |
50 | +Dim rlen As Variant | |
51 | +st = rd.dc_inventory(&H36, 0, 0, rlen) | |
52 | +If st <> 0 Then | |
53 | + List1.AddItem "dc_inventory error!" | |
54 | + rd.dc_exit | |
55 | + Set rd = Nothing | |
56 | + Exit Sub | |
57 | +End If | |
58 | +List1.AddItem "dc_inventory ok!" | |
59 | +List1.AddItem rd.get_bstrRBuffer | |
60 | +List1.AddItem rd.get_bstrRBuffer_asc | |
61 | + | |
62 | +'get system information | |
63 | +UID = Mid(rd.get_bstrRBuffer_asc, 3, (rlen - 1) * 2) | |
64 | +rd.put_bstrSBuffer_asc = UID | |
65 | +st = rd.dc_get_systeminfo(&H22, rlen) | |
66 | +If st <> 0 Then | |
67 | + List1.AddItem "dc_get_systeminfo error!" | |
68 | + rd.dc_exit | |
69 | + Set rd = Nothing | |
70 | + Exit Sub | |
71 | +End If | |
72 | +List1.AddItem "dc_get_systeminfo ok!" | |
73 | +List1.AddItem rd.get_bstrRBuffer | |
74 | +List1.AddItem rd.get_bstrRBuffer_asc | |
75 | + | |
76 | +'Read | |
77 | +rd.put_bstrSBuffer_asc = UID | |
78 | +st = rd.dc_readblock(&H22, 1, 10, rlen) | |
79 | +If st <> 0 Then | |
80 | + List1.AddItem "dc_readblock error!" | |
81 | + rd.dc_exit | |
82 | + Set rd = Nothing | |
83 | + Exit Sub | |
84 | +End If | |
85 | +List1.AddItem "dc_readblock ok!" | |
86 | +List1.AddItem rd.get_bstrRBuffer | |
87 | +List1.AddItem rd.get_bstrRBuffer_asc | |
88 | + | |
89 | +'Write TI | |
90 | +rd.put_bstrSBuffer_asc = UID | |
91 | +rd.put_bstrSBufferEx_asc = "12345678" | |
92 | +st = rd.dc_writeblock(&H43 Or &H80, 1, 1, 4) | |
93 | +If st <> 0 Then | |
94 | + List1.AddItem "dc_writeblock error!" | |
95 | + rd.dc_exit | |
96 | + Set rd = Nothing | |
97 | + Exit Sub | |
98 | +End If | |
99 | +List1.AddItem "dc_writeblock ok!" | |
100 | + | |
101 | +'Write ICODE II | |
102 | +'rd.put_bstrSBuffer_asc = UID | |
103 | +'rd.put_bstrSBufferEx_asc = "12345678" | |
104 | +'st = rd.dc_writeblock(&H22, 1, 1, 4) | |
105 | +'If st <> 0 Then | |
106 | +' List1.AddItem "dc_writeblock error!" | |
107 | +' rd.dc_exit | |
108 | +' Set rd = Nothing | |
109 | +' Exit Sub | |
110 | +'End If | |
111 | +'List1.AddItem "dc_writeblock ok!" | |
112 | + | |
113 | + | |
114 | +End Sub | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/example/vb-15693/Project1.vbp
0 → 100644
1 | +Type=Exe | |
2 | +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation | |
3 | +Reference=*\G{50DEC628-228A-4AB7-A057-1247676BCA10}#1.0#0#C:\WINDOWS\system32\comRD800.dll#comRD800 1.0 Type Library | |
4 | +Form=Form1.frm | |
5 | +Startup="Form1" | |
6 | +Command32="" | |
7 | +Name="Project1" | |
8 | +HelpContextID="0" | |
9 | +CompatibleMode="0" | |
10 | +MajorVer=1 | |
11 | +MinorVer=0 | |
12 | +RevisionVer=0 | |
13 | +AutoIncrementVer=0 | |
14 | +ServerSupportFiles=0 | |
15 | +VersionCompanyName="Lenovo (Beijing) Limited" | |
16 | +CompilationType=0 | |
17 | +OptimizationType=0 | |
18 | +FavorPentiumPro(tm)=0 | |
19 | +CodeViewDebugInfo=0 | |
20 | +NoAliasing=0 | |
21 | +BoundsCheck=0 | |
22 | +OverflowCheck=0 | |
23 | +FlPointCheck=0 | |
24 | +FDIVCheck=0 | |
25 | +UnroundedFP=0 | |
26 | +StartMode=0 | |
27 | +Unattended=0 | |
28 | +Retained=0 | |
29 | +ThreadPerObject=0 | |
30 | +MaxNumberOfThreads=1 | |
31 | + | |
32 | +[MS Transaction Server] | |
33 | +AutoRefresh=1 | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/example/vb-15693/Project1.vbw
0 → 100644
1 | +Form1 = 44, 58, 653, 500, , 22, 29, 631, 472, C | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/example/vb6/Form1.frm
0 → 100644
1 | +VERSION 5.00 | |
2 | +Begin VB.Form Form1 | |
3 | + Caption = "Form1" | |
4 | + ClientHeight = 5190 | |
5 | + ClientLeft = 60 | |
6 | + ClientTop = 345 | |
7 | + ClientWidth = 5310 | |
8 | + LinkTopic = "Form1" | |
9 | + ScaleHeight = 5190 | |
10 | + ScaleWidth = 5310 | |
11 | + StartUpPosition = 3 'Windows Default | |
12 | + Begin VB.ListBox List1 | |
13 | + Height = 4545 | |
14 | + Left = 240 | |
15 | + TabIndex = 1 | |
16 | + Top = 240 | |
17 | + Width = 3375 | |
18 | + End | |
19 | + Begin VB.CommandButton Command1 | |
20 | + Caption = "²âÊÔ" | |
21 | + Height = 495 | |
22 | + Left = 3840 | |
23 | + TabIndex = 0 | |
24 | + Top = 240 | |
25 | + Width = 1215 | |
26 | + End | |
27 | +End | |
28 | +Attribute VB_Name = "Form1" | |
29 | +Attribute VB_GlobalNameSpace = False | |
30 | +Attribute VB_Creatable = False | |
31 | +Attribute VB_PredeclaredId = True | |
32 | +Attribute VB_Exposed = False | |
33 | +Private Sub Command1_Click() | |
34 | + | |
35 | +Dim st As Integer | |
36 | +Dim rd As COMRD800Lib.RD800 | |
37 | +Set rd = New COMRD800Lib.RD800 | |
38 | +List1.Clear | |
39 | + | |
40 | +st = rd.dc_init(100, 115200) | |
41 | +If st <= 0 Then | |
42 | + List1.AddItem "dc_init error!" | |
43 | + Set rd = Nothing | |
44 | + Exit Sub | |
45 | +End If | |
46 | +List1.AddItem "dc_init ok!" | |
47 | + | |
48 | +Dim lSnr As Variant | |
49 | +st = rd.dc_card(0, lSnr) | |
50 | +If st <> 0 Then | |
51 | + List1.AddItem "dc_card error!" | |
52 | + rd.dc_exit | |
53 | + Set rd = Nothing | |
54 | + Exit Sub | |
55 | +End If | |
56 | +List1.AddItem "dc_card ok!" | |
57 | +List1.AddItem lSnr | |
58 | + | |
59 | +rd.put_bstrSBuffer_asc = "FFFFFFFFFFFF" | |
60 | +st = rd.dc_load_key(0, 0) | |
61 | +If st < 0 Then | |
62 | + List1.AddItem "dc_load_key error!" | |
63 | + rd.dc_exit | |
64 | + Set rd = Nothing | |
65 | + Exit Sub | |
66 | +End If | |
67 | +List1.AddItem "dc_load_key ok!" | |
68 | + | |
69 | +st = rd.dc_authentication(0, 0) | |
70 | +If st < 0 Then | |
71 | + List1.AddItem "dc_authentication error!" | |
72 | + rd.dc_exit | |
73 | + Set rd = Nothing | |
74 | + Exit Sub | |
75 | +End If | |
76 | +List1.AddItem "dc_authentication ok!" | |
77 | + | |
78 | +rd.put_bstrSBuffer_asc = "31323334353637383930313233343536" | |
79 | +st = rd.dc_write(2) | |
80 | +If st < 0 Then | |
81 | + List1.AddItem "dc_write error!" | |
82 | + rd.dc_exit | |
83 | + Set rd = Nothing | |
84 | + Exit Sub | |
85 | +End If | |
86 | +List1.AddItem "dc_write ok!" | |
87 | + | |
88 | +st = rd.dc_read(2) | |
89 | +If st < 0 Then | |
90 | + List1.AddItem "dc_read error!" | |
91 | + rd.dc_exit | |
92 | + Set rd = Nothing | |
93 | + Exit Sub | |
94 | +End If | |
95 | +List1.AddItem "dc_read ok!" | |
96 | +List1.AddItem rd.get_bstrRBuffer | |
97 | +List1.AddItem rd.get_bstrRBuffer_asc | |
98 | + | |
99 | +st = rd.dc_exit() | |
100 | +If st < 0 Then | |
101 | + List1.AddItem "dc_exit error!" | |
102 | + Set rd = Nothing | |
103 | + Exit Sub | |
104 | +End If | |
105 | +List1.AddItem "dc_exit ok!" | |
106 | + | |
107 | +Set rd = Nothing | |
108 | + | |
109 | +End Sub | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/example/vb6/Project1.vbp
0 → 100644
1 | +Type=Exe | |
2 | +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#D:\WINDOWS\system32\STDOLE2.TLB#OLE Automation | |
3 | +Reference=*\G{50DEC628-228A-4AB7-A057-1247676BCA10}#1.0#0#F:\d8com\comRD800.dll#comRD800 1.0 Type Library | |
4 | +Form=Form1.frm | |
5 | +Startup="Form1" | |
6 | +Command32="" | |
7 | +Name="Project1" | |
8 | +HelpContextID="0" | |
9 | +CompatibleMode="0" | |
10 | +MajorVer=1 | |
11 | +MinorVer=0 | |
12 | +RevisionVer=0 | |
13 | +AutoIncrementVer=0 | |
14 | +ServerSupportFiles=0 | |
15 | +VersionCompanyName="Decard" | |
16 | +CompilationType=0 | |
17 | +OptimizationType=0 | |
18 | +FavorPentiumPro(tm)=0 | |
19 | +CodeViewDebugInfo=0 | |
20 | +NoAliasing=0 | |
21 | +BoundsCheck=0 | |
22 | +OverflowCheck=0 | |
23 | +FlPointCheck=0 | |
24 | +FDIVCheck=0 | |
25 | +UnroundedFP=0 | |
26 | +StartMode=0 | |
27 | +Unattended=0 | |
28 | +Retained=0 | |
29 | +ThreadPerObject=0 | |
30 | +MaxNumberOfThreads=1 | |
31 | + | |
32 | +[MS Transaction Server] | |
33 | +AutoRefresh=1 | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/example/vb6/Project1.vbw
0 → 100644
1 | +Form1 = 44, 44, 569, 484, , 22, 22, 547, 462, C | ... | ... |
doc/D3&&D8&&T10ulm开发包/COM/readme.txt
0 → 100644
doc/D3&&D8&&T10ulm开发包/D8RFhelp.doc
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/LINUX/D8S_linux-Ubuntu_12.04.1_LTS-3.2.0-29-generic-pae.rar
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/LINUX/D8U_linux-CentOS_6.6-2.6.32-504.e_6.x86_64.rar
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/LINUX/D8U_linux-CentOS_6.6-2.6.32-504.e_6.x86_64_so.rar
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/LINUX/D8U_linux-Ubuntu_12.04.1_LTS-3.2.0-29-generic-pae.rar
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/LINUX/linuxd8u.rar
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/LINUX/原LINUX开发包.rar
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/RFhelp.chm
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/chs16.fon
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/java/.classpath
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<classpath> | |
3 | + <classpathentry kind="src" path="src"/> | |
4 | + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | |
5 | + <classpathentry kind="lib" path="lib/jna.jar"/> | |
6 | + <classpathentry kind="lib" path="lib/platform.jar"/> | |
7 | + <classpathentry kind="output" path="bin"/> | |
8 | +</classpath> | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/.project
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<projectDescription> | |
3 | + <name>D8Demo</name> | |
4 | + <comment></comment> | |
5 | + <projects> | |
6 | + </projects> | |
7 | + <buildSpec> | |
8 | + <buildCommand> | |
9 | + <name>org.eclipse.jdt.core.javabuilder</name> | |
10 | + <arguments> | |
11 | + </arguments> | |
12 | + </buildCommand> | |
13 | + </buildSpec> | |
14 | + <natures> | |
15 | + <nature>org.eclipse.jdt.core.javanature</nature> | |
16 | + </natures> | |
17 | +</projectDescription> | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/.settings/org.eclipse.core.resources.prefs
0 → 100644
doc/D3&&D8&&T10ulm开发包/java/.settings/org.eclipse.jdt.core.prefs
0 → 100644
1 | +eclipse.preferences.version=1 | |
2 | +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | |
3 | +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | |
4 | +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | |
5 | +org.eclipse.jdt.core.compiler.compliance=1.7 | |
6 | +org.eclipse.jdt.core.compiler.debug.lineNumber=generate | |
7 | +org.eclipse.jdt.core.compiler.debug.localVariable=generate | |
8 | +org.eclipse.jdt.core.compiler.debug.sourceFile=generate | |
9 | +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | |
10 | +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | |
11 | +org.eclipse.jdt.core.compiler.source=1.7 | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/lib/jna.jar
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/java/lib/platform.jar
0 → 100644
No preview for this file type
doc/D3&&D8&&T10ulm开发包/java/readme.txt
0 → 100644
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/ContactCpuDemo.java
0 → 100644
1 | +/* | |
2 | + * To change this template, choose Tools | Templates | |
3 | + * and open the template in the editor. | |
4 | + */ | |
5 | +package d8demo; | |
6 | + | |
7 | +import com.sun.jna.Native; | |
8 | + | |
9 | +/** | |
10 | + * ´ó¿¨×ù²Ù×÷demo | |
11 | + * @author decard | |
12 | + */ | |
13 | +public class ContactCpuDemo { | |
14 | + | |
15 | + /** | |
16 | + * @param b | |
17 | + * @param length | |
18 | + */ | |
19 | + public static void print_bytes(byte[] b, int length) { | |
20 | + for (int i = 0; i < length; ++i) { | |
21 | + String hex = Integer.toHexString(b[i] & 0xFF); | |
22 | + if (hex.length() == 1) { | |
23 | + hex = '0' + hex; | |
24 | + } | |
25 | + System.out.print(hex.toUpperCase()); | |
26 | + } | |
27 | + } | |
28 | + | |
29 | + public static void main(String[] args) { | |
30 | + Dcrf32_h dcrf32; | |
31 | + dcrf32 = (Dcrf32_h) Native.loadLibrary("./dcrf32.dll", Dcrf32_h.class); | |
32 | + | |
33 | + int result; | |
34 | + int handle; | |
35 | + | |
36 | + int[] snr = new int[1]; | |
37 | + byte[] rlen = new byte[1]; | |
38 | + byte[] send_buffer = new byte[2048]; | |
39 | + byte[] recv_buffer = new byte[2048]; | |
40 | + | |
41 | + System.out.print("dc_init ... "); | |
42 | + result = dcrf32.dc_init((short) 100, 115200); | |
43 | + if (result < 0) { | |
44 | + System.out.println("error!"); | |
45 | + return; | |
46 | + } | |
47 | + System.out.println("ok!"); | |
48 | + | |
49 | + handle = result; | |
50 | + | |
51 | + System.out.print("set cpu address ... "); | |
52 | + result = dcrf32.dc_setcpu(handle, (byte) 0x0c); | |
53 | + if (result != 0) { | |
54 | + System.out.println("error!"); | |
55 | + dcrf32.dc_exit(handle); | |
56 | + return; | |
57 | + } | |
58 | + System.out.println("ok"); | |
59 | + | |
60 | + System.out.print("cpu reset ... "); | |
61 | + result = dcrf32.dc_cpureset(handle, rlen, recv_buffer); | |
62 | + if (result != 0) { | |
63 | + System.out.println("error!"); | |
64 | + dcrf32.dc_exit(handle); | |
65 | + return; | |
66 | + } | |
67 | + System.out.println("ok"); | |
68 | + System.out.print("reset info :"); | |
69 | + print_bytes(recv_buffer, rlen[0] & 0xFF); | |
70 | + System.out.println(); | |
71 | + | |
72 | + System.out.print("dc_pro_command ... "); | |
73 | + send_buffer[0] = (byte) 0x00; | |
74 | + send_buffer[1] = (byte) 0x84; | |
75 | + send_buffer[2] = (byte) 0x00; | |
76 | + send_buffer[3] = (byte) 0x00; | |
77 | + send_buffer[4] = (byte) 0x08; | |
78 | + result = dcrf32.dc_cpuapdu(handle, (byte) 5, send_buffer, rlen, recv_buffer); | |
79 | + if (result != 0) { | |
80 | + System.out.println("error!"); | |
81 | + dcrf32.dc_exit(handle); | |
82 | + return; | |
83 | + } | |
84 | + System.out.println("ok!"); | |
85 | + | |
86 | + System.out.print("DATA: "); | |
87 | + print_bytes(recv_buffer, rlen[0] & 0xFF); | |
88 | + System.out.println(); | |
89 | + | |
90 | + | |
91 | + System.out.print("dc_beep ... "); | |
92 | + result = dcrf32.dc_beep(handle, (short) 10); | |
93 | + if (result != 0) { | |
94 | + System.out.println("error!"); | |
95 | + dcrf32.dc_exit(handle); | |
96 | + return; | |
97 | + } | |
98 | + System.out.println("ok!"); | |
99 | + | |
100 | + System.out.print("dc_exit ... "); | |
101 | + result = dcrf32.dc_exit(handle); | |
102 | + if (result != 0) { | |
103 | + System.out.println("error!"); | |
104 | + return; | |
105 | + } | |
106 | + System.out.println("ok!"); | |
107 | + | |
108 | + } | |
109 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/D8_24C01_Demo.java
0 → 100644
1 | +package d8demo; | |
2 | + | |
3 | +import com.sun.jna.Native; | |
4 | + | |
5 | +public class D8_24C01_Demo { | |
6 | + | |
7 | + public static void print_bytes(byte[] b, int length) { | |
8 | + for (int i = 0; i < length; ++i) { | |
9 | + String hex = Integer.toHexString(b[i] & 0xFF); | |
10 | + if (hex.length() == 1) { | |
11 | + hex = '0' + hex; | |
12 | + } | |
13 | + System.out.print(hex.toUpperCase()); | |
14 | + } | |
15 | + } | |
16 | + | |
17 | + public static void main(String[] args) { | |
18 | + Dcrf32_h dcrf32; | |
19 | + dcrf32 = (Dcrf32_h) Native.loadLibrary("./dcrf32.dll", Dcrf32_h.class); | |
20 | + | |
21 | + int st, icdev; | |
22 | + int status = -1; | |
23 | + byte[] rdata = new byte[1024]; | |
24 | + | |
25 | + icdev = dcrf32.dc_init((short) 100, 115200); | |
26 | + if (icdev <= 0) { | |
27 | + System.out.println("dc init error"); | |
28 | + return; | |
29 | + } | |
30 | + System.out.println("dc init ok"); | |
31 | + | |
32 | + st = dcrf32.dc_setcpu(icdev, (byte) 12); | |
33 | + | |
34 | + st = dcrf32.dc_write_24c(icdev, (short) 0, (short) 8, new byte[] { | |
35 | + 0x12, 0x34, 0x56, 0x78, (byte) 0x90, (byte) 0xab, (byte) 0xcd, | |
36 | + (byte) 0xef }); | |
37 | + if (st != 0) { | |
38 | + System.out.println("write data error"); | |
39 | + dcrf32.dc_exit(icdev); | |
40 | + return; | |
41 | + } | |
42 | + System.out | |
43 | + .println("write data from byte 0 to 7 as 1234567890abcdef ok"); | |
44 | + st = dcrf32.dc_read_24c(icdev, (short) 0, (short) 8, rdata); | |
45 | + if (st != 0) { | |
46 | + System.out.println("read data error"); | |
47 | + dcrf32.dc_exit(icdev); | |
48 | + return; | |
49 | + } | |
50 | + System.out.println("read data ok"); | |
51 | + | |
52 | + D8_24C01_Demo.print_bytes(rdata, 8); | |
53 | + | |
54 | + st = dcrf32.dc_beep(icdev, (short) 10); | |
55 | + | |
56 | + dcrf32.dc_exit(icdev); | |
57 | + } | |
58 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/D8_24C64_Demo.java
0 → 100644
1 | +package d8demo; | |
2 | + | |
3 | +import com.sun.jna.Native; | |
4 | + | |
5 | +public class D8_24C64_Demo { | |
6 | + public static void print_bytes(byte[] b, int length) { | |
7 | + for (int i = 0; i < length; ++i) { | |
8 | + String hex = Integer.toHexString(b[i] & 0xFF); | |
9 | + if (hex.length() == 1) { | |
10 | + hex = '0' + hex; | |
11 | + } | |
12 | + System.out.print(hex.toUpperCase()); | |
13 | + } | |
14 | + } | |
15 | + | |
16 | + public static void main(String[] args) { | |
17 | + Dcrf32_h dcrf32; | |
18 | + dcrf32 = (Dcrf32_h) Native.loadLibrary("./dcrf32.dll", Dcrf32_h.class); | |
19 | + | |
20 | + int st, icdev; | |
21 | + int status = -1; | |
22 | + byte[] rdata = new byte[1024]; | |
23 | + | |
24 | + icdev = dcrf32.dc_init((short) 100, 115200); | |
25 | + if (icdev <= 0) { | |
26 | + System.out.println("dc init error"); | |
27 | + return; | |
28 | + } | |
29 | + System.out.println("dc init ok"); | |
30 | + | |
31 | + st = dcrf32.dc_setcpu(icdev, (byte) 12); | |
32 | + | |
33 | + st = dcrf32.dc_write_24c64(icdev, (short) 0, (short) 8, new byte[] { | |
34 | + 0x12, 0x34, 0x56, 0x78, (byte) 0x90, (byte) 0xab, (byte) 0xcd, | |
35 | + (byte) 0xef }); | |
36 | + if (st != 0) { | |
37 | + System.out.println("write data error"); | |
38 | + dcrf32.dc_exit(icdev); | |
39 | + return; | |
40 | + } | |
41 | + System.out | |
42 | + .println("write data from byte 0 to 7 as 1234567890abcdef ok"); | |
43 | + st = dcrf32.dc_read_24c64(icdev, (short) 0, (short) 8, rdata); | |
44 | + if (st != 0) { | |
45 | + System.out.println("read data error"); | |
46 | + dcrf32.dc_exit(icdev); | |
47 | + return; | |
48 | + } | |
49 | + System.out.println("read data ok"); | |
50 | + | |
51 | + D8_24C01_Demo.print_bytes(rdata, 8); | |
52 | + | |
53 | + st = dcrf32.dc_beep(icdev, (short) 10); | |
54 | + | |
55 | + dcrf32.dc_exit(icdev); | |
56 | + } | |
57 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/D8_4428_Demo.java
0 → 100644
1 | +/* | |
2 | + * To change this template, choose Tools | Templates | |
3 | + * and open the template in the editor. | |
4 | + */ | |
5 | +package d8demo; | |
6 | + | |
7 | +import com.sun.jna.Native; | |
8 | + | |
9 | +/** | |
10 | + * 4428¿¨²Ù×÷demo | |
11 | + * | |
12 | + * @author Administrator | |
13 | + */ | |
14 | +public class D8_4428_Demo { | |
15 | + | |
16 | + public static void print_bytes(byte[] b, int length) { | |
17 | + for (int i = 0; i < length; ++i) { | |
18 | + String hex = Integer.toHexString(b[i] & 0xFF); | |
19 | + if (hex.length() == 1) { | |
20 | + hex = '0' + hex; | |
21 | + } | |
22 | + System.out.print(hex.toUpperCase()); | |
23 | + } | |
24 | + } | |
25 | + | |
26 | + public static void main(String[] args) { | |
27 | + Dcrf32_h dcrf32; | |
28 | + dcrf32 = (Dcrf32_h) Native.loadLibrary("./dcrf32.dll", Dcrf32_h.class); | |
29 | + | |
30 | + int result; | |
31 | + int handle; | |
32 | + int[] snr = new int[1]; | |
33 | + byte[] rlen = new byte[1]; | |
34 | + byte[] send_buffer = new byte[2048]; | |
35 | + byte[] recv_buffer = new byte[2048]; | |
36 | + | |
37 | + System.out.print("dc_init ... "); | |
38 | + result = dcrf32.dc_init((short) 100, 115200); | |
39 | + if (result < 0) { | |
40 | + System.out.println("error!"); | |
41 | + return; | |
42 | + } | |
43 | + System.out.println("ok!"); | |
44 | + | |
45 | + handle = result; | |
46 | + | |
47 | + System.out.print("get pin count ..."); | |
48 | + result = dcrf32.dc_readpincount_4428(handle); | |
49 | + if (result < 0) { | |
50 | + System.out.println(" error"); | |
51 | + dcrf32.dc_exit(handle); | |
52 | + return; | |
53 | + } | |
54 | + System.out.println(" ok"); | |
55 | + | |
56 | + System.out.println("pin count :" + result); | |
57 | + | |
58 | + System.out.print("varifi the pin "); | |
59 | + result = dcrf32.dc_verifypin_4428(handle, new byte[]{(byte) 0xff, (byte) 0xff}); | |
60 | + if (result != 0) { | |
61 | + System.out.println(" error"); | |
62 | + dcrf32.dc_exit(handle); | |
63 | + return; | |
64 | + } | |
65 | + System.out.println(" ok"); | |
66 | + | |
67 | + System.out.print("change pin to 0xffff"); | |
68 | + result = dcrf32.dc_changepin_4428(handle, new byte[]{(byte) 0xff, (byte) 0xff}); | |
69 | + if (result != 0) { | |
70 | + System.out.println(" error"); | |
71 | + } | |
72 | + System.out.println(" ok"); | |
73 | + | |
74 | + System.out.print("read the pin "); | |
75 | + result = dcrf32.dc_readpin_4428(handle, recv_buffer); | |
76 | + if (result != 0) { | |
77 | + System.out.println(" error"); | |
78 | + dcrf32.dc_exit(handle); | |
79 | + return; | |
80 | + } | |
81 | + System.out.println("ok"); | |
82 | + | |
83 | + System.out.print("the pin is "); | |
84 | + print_bytes(recv_buffer, 2); | |
85 | + System.out.println(""); | |
86 | + | |
87 | + | |
88 | + System.out.print("read data from 0xf5 to 0x1A"); | |
89 | + result = dcrf32.dc_read_4428(handle, (short) 0xf5, (short) 6, recv_buffer); | |
90 | + if (result != 0) { | |
91 | + System.out.println(" error"); | |
92 | + dcrf32.dc_exit(handle); | |
93 | + return; | |
94 | + } | |
95 | + System.out.println(" ok"); | |
96 | + System.out.print("data : "); | |
97 | + print_bytes(recv_buffer, 6); | |
98 | + System.out.println(""); | |
99 | + | |
100 | + System.out.print("write data from 0xf5 to 0x1A as 123456789abc"); | |
101 | + result = dcrf32.dc_write_4428(handle, (short) 0xf5, (short) 6, new byte[]{0x12, 0x34, 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc}); | |
102 | + if (result != 0) { | |
103 | + System.out.println(" error"); | |
104 | + System.out.println(" error code " + result); | |
105 | + dcrf32.dc_exit(handle); | |
106 | + return; | |
107 | + } | |
108 | + System.out.println(" ok"); | |
109 | + | |
110 | + System.out.print("read data from 0xf5 to 0x1A again"); | |
111 | + result = dcrf32.dc_read_4428(handle, (short) 0xf5, (short) 6, recv_buffer); | |
112 | + if (result != 0) { | |
113 | + System.out.println(" error"); | |
114 | + dcrf32.dc_exit(handle); | |
115 | + return; | |
116 | + } | |
117 | + System.out.println(" ok"); | |
118 | + System.out.print("data : "); | |
119 | + print_bytes(recv_buffer, 6); | |
120 | + System.out.println(""); | |
121 | + | |
122 | + System.out.print("write data from 0xf5 to 0x1A as ffffffffffff"); | |
123 | + result = dcrf32.dc_write_4428(handle, (short) 0xf5, (short) 6, new byte[]{(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff}); | |
124 | + if (result != 0) { | |
125 | + System.out.println(" error"); | |
126 | + System.out.println(" error code " + result); | |
127 | + dcrf32.dc_exit(handle); | |
128 | + return; | |
129 | + } | |
130 | + System.out.println(" ok"); | |
131 | + | |
132 | + result = dcrf32.dc_beep(handle, (short) 10); | |
133 | + | |
134 | + System.out.print("dc_exit ... "); | |
135 | + result = dcrf32.dc_exit(handle); | |
136 | + if (result != 0) { | |
137 | + System.out.println("error!"); | |
138 | + return; | |
139 | + } | |
140 | + System.out.println("ok!"); | |
141 | + } | |
142 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/D8_4442_Demo.java
0 → 100644
1 | +/* | |
2 | + * To change this template, choose Tools | Templates | |
3 | + * and open the template in the editor. | |
4 | + */ | |
5 | +package d8demo; | |
6 | + | |
7 | +import com.sun.jna.Native; | |
8 | + | |
9 | +/** | |
10 | + * 4442¿¨²Ù×÷demo | |
11 | + * @author Administrator | |
12 | + */ | |
13 | +public class D8_4442_Demo { | |
14 | + | |
15 | + public static void print_bytes(byte[] b, int length) { | |
16 | + for (int i = 0; i < length; ++i) { | |
17 | + String hex = Integer.toHexString(b[i] & 0xFF); | |
18 | + if (hex.length() == 1) { | |
19 | + hex = '0' + hex; | |
20 | + } | |
21 | + System.out.print(hex.toUpperCase()); | |
22 | + } | |
23 | + } | |
24 | + | |
25 | + public static void main(String[] args) { | |
26 | + Dcrf32_h dcrf32; | |
27 | + dcrf32 = (Dcrf32_h) Native.loadLibrary("./dcrf32.dll", Dcrf32_h.class); | |
28 | + | |
29 | + int result; | |
30 | + int handle; | |
31 | + byte[] rlen = new byte[1]; | |
32 | + byte[] recv_buffer = new byte[2048]; | |
33 | + | |
34 | + System.out.print("dc_init ... "); | |
35 | + result = dcrf32.dc_init((short) 100, 115200); | |
36 | + if (result < 0) { | |
37 | + System.out.println("error!"); | |
38 | + return; | |
39 | + } | |
40 | + System.out.println("ok!"); | |
41 | + | |
42 | + handle = result; | |
43 | + | |
44 | + System.out.print("get pin count ..."); | |
45 | + result = dcrf32.dc_readpincount_4442(handle); | |
46 | + if (result < 0) { | |
47 | + System.out.println(" error"); | |
48 | + dcrf32.dc_exit(handle); | |
49 | + return; | |
50 | + } | |
51 | + System.out.println(" ok"); | |
52 | + | |
53 | + System.out.println("pin count :" + result); | |
54 | + | |
55 | + System.out.print("varifi the pin "); | |
56 | + result = dcrf32.dc_verifypin_4442(handle, new byte[]{(byte) 0xff, (byte) 0xff, (byte) 0xff}); | |
57 | + if (result != 0) { | |
58 | + System.out.println(" error"); | |
59 | + dcrf32.dc_exit(handle); | |
60 | + return; | |
61 | + } | |
62 | + System.out.println(" ok"); | |
63 | + | |
64 | + System.out.print("change pin to 0xffffff"); | |
65 | + result = dcrf32.dc_changepin_4442(handle, new byte[]{(byte) 0xff, (byte) 0xff, (byte) 0xff}); | |
66 | + if (result != 0) { | |
67 | + System.out.println(" error"); | |
68 | + } | |
69 | + System.out.println(" ok"); | |
70 | + | |
71 | + System.out.print(" read the pin "); | |
72 | + recv_buffer = new byte[1024]; | |
73 | + result = dcrf32.dc_readpin_4442(handle, recv_buffer); | |
74 | + if (result != 0) { | |
75 | + System.out.println(" error"); | |
76 | + dcrf32.dc_exit(handle); | |
77 | + return; | |
78 | + } | |
79 | + System.out.println("ok"); | |
80 | + | |
81 | + System.out.print(" the pin is "); | |
82 | + print_bytes(recv_buffer, 3); | |
83 | + System.out.println(""); | |
84 | + | |
85 | + System.out.print("read data from 0xf5 to 0xfa"); | |
86 | + result = dcrf32.dc_read_4442(handle, (short) 0xf5, (short) 6, recv_buffer); | |
87 | + if (result != 0) { | |
88 | + System.out.println(" error"); | |
89 | + dcrf32.dc_exit(handle); | |
90 | + return; | |
91 | + } | |
92 | + System.out.println(" ok"); | |
93 | + System.out.print("data : "); | |
94 | + print_bytes(recv_buffer, 6); | |
95 | + System.out.println(""); | |
96 | + | |
97 | + System.out.print("write data from 0xf5 to 0xfa again as '123456789abc"); | |
98 | + result = dcrf32.dc_write_4442(handle, (short) 0xf5, (short) 6, new byte[]{0x12, 0x34, 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc}); | |
99 | + if (result != 0) { | |
100 | + System.out.println(" error"); | |
101 | + System.out.println(" error code " + result); | |
102 | + dcrf32.dc_exit(handle); | |
103 | + return; | |
104 | + } | |
105 | + System.out.println(" ok"); | |
106 | + | |
107 | + System.out.print("read data from 0xf5 to 0xfa again"); | |
108 | + result = dcrf32.dc_read_4442(handle, (short) 0xf5, (short) 6, recv_buffer); | |
109 | + if (result != 0) { | |
110 | + System.out.println(" error"); | |
111 | + dcrf32.dc_exit(handle); | |
112 | + return; | |
113 | + } | |
114 | + System.out.println(" ok"); | |
115 | + System.out.print("data : "); | |
116 | + print_bytes(recv_buffer, 6); | |
117 | + System.out.println(""); | |
118 | + | |
119 | + System.out.print("write data from 0xf5 to 0xfa as 'ffffffffffff"); | |
120 | + result = dcrf32.dc_write_4442(handle, (short) 0xf5, (short) 6, new byte[]{(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff}); | |
121 | + if (result != 0) { | |
122 | + System.out.println(" error"); | |
123 | + System.out.println(" error code " + result); | |
124 | + dcrf32.dc_exit(handle); | |
125 | + return; | |
126 | + } | |
127 | + System.out.println(" ok"); | |
128 | + | |
129 | + result = dcrf32.dc_beep(handle, (short) 10); | |
130 | + | |
131 | + System.out.print("dc_exit ... "); | |
132 | + result = dcrf32.dc_exit(handle); | |
133 | + if (result != 0) { | |
134 | + System.out.println("error!"); | |
135 | + return; | |
136 | + } | |
137 | + System.out.println("ok!"); | |
138 | + } | |
139 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/Dcrf32_h.java
0 → 100644
1 | +/* | |
2 | + * To change this template, choose Tools | Templates | |
3 | + * and open the template in the editor. | |
4 | + */ | |
5 | +package d8demo; | |
6 | + | |
7 | +import com.sun.jna.win32.StdCallLibrary; | |
8 | + | |
9 | +/** | |
10 | + * | |
11 | + * @author Administrator | |
12 | + */ | |
13 | +public interface Dcrf32_h extends StdCallLibrary { | |
14 | + | |
15 | + int dc_init(short port, int baud); | |
16 | + | |
17 | + short dc_beep(int icdev, short ms); | |
18 | + | |
19 | + short dc_reset(int icdev, short ms); | |
20 | + | |
21 | + short dc_config_card(int icdev, byte cardtype); | |
22 | + | |
23 | + short dc_card(int icdev, byte mode, int[] snr); | |
24 | + | |
25 | + short dc_pro_reset(int icdev, byte[] rlen, byte[] receive_data); | |
26 | + | |
27 | + short dc_pro_command(int icdev, byte slen, byte[] sendbuffer, byte[] rlen, byte[] receive_data, byte timeout); | |
28 | + | |
29 | + short dc_pro_commandsource(int icdev, byte slen, byte[] sendbuffer, byte[] rlen, byte[] receive_data, byte timeout); | |
30 | + | |
31 | + short dc_pro_halt(int icdev); | |
32 | + | |
33 | + short dc_exit(int icdev); | |
34 | + | |
35 | + short dc_card_double(int icdev, byte mode, byte[] snr); | |
36 | + | |
37 | + short dc_load_key(int icdev, byte mode, byte secnum, byte[] pass); | |
38 | + | |
39 | + short dc_authentication(int icdev, byte mode, byte secnum); | |
40 | + | |
41 | + short dc_read(int icdev, byte addr, byte[] data); | |
42 | + | |
43 | + short dc_write(int icdev, byte addr, byte[] data); | |
44 | + | |
45 | + short dc_request_b(int icdev, byte _Mode, byte AFI, | |
46 | + byte N, byte[] ATQB); | |
47 | + | |
48 | + short dc_attrib(int icdev, byte[] PUPI, byte CID); | |
49 | + | |
50 | + short dc_pro_commandlink(int idComDev, byte slen, | |
51 | + byte[] sendbuffer, byte[] rlen, | |
52 | + byte[] databuffer, byte timeout, | |
53 | + byte FG); | |
54 | + | |
55 | + short dc_setcpu(int icdev, byte _Byte); | |
56 | + | |
57 | + short dc_cpureset(int icdev, byte[] rlen, byte[] databuffer); | |
58 | + | |
59 | + short dc_cpuapdu(int icdev, byte slen, byte[] sendbuffer, | |
60 | + byte[] rlen, byte[] databuffer); | |
61 | + | |
62 | + short dc_read_4442(int icdev, short offset, short lenth, byte[] buffer); | |
63 | + | |
64 | + short dc_read_4442_hex(int icdev, short offset, short lenth, byte[] buffer); | |
65 | + | |
66 | + short dc_write_4442(int icdev, short offset, short lenth, byte[] buffer); | |
67 | + | |
68 | + short dc_write_4442_hex(int icdev, short offset, short lenth, byte[] buffer); | |
69 | + | |
70 | + short dc_verifypin_4442(int icdev, byte[] passwd); | |
71 | + | |
72 | + short dc_verifypin_4442_hex(int icdev, byte[] passwd); | |
73 | + | |
74 | + short dc_readpin_4442(int icdev, byte[] passwd); | |
75 | + | |
76 | + short dc_readpin_4442_hex(int icdev, byte[] passwd); | |
77 | + | |
78 | + short dc_readpincount_4442(int icdev); | |
79 | + | |
80 | + short dc_changepin_4442(int icdev, byte[] passwd); | |
81 | + | |
82 | + short dc_changepin_4442_hex(int icdev, byte[] passwd); | |
83 | + | |
84 | + short dc_readwrotect_4442(int icdev, short offset, short leng, byte[] buffer); | |
85 | + | |
86 | + short dc_readwrotect_4442_hex(int icdev, short offset, short leng, byte[] buffer); | |
87 | + | |
88 | + short dc_writeprotect_4442(int icdev, short offset, short leng, byte[] buffer); | |
89 | + | |
90 | + short dc_writeprotect_4442_hex(int icdev, short offset, short leng, byte[] buffer); | |
91 | + | |
92 | + short dc_read_4428(int icdev, short offset, short lenth, byte[] buffer); | |
93 | + | |
94 | + short dc_read_4428_hex(int icdev, short offset, short lenth, byte[] buffer); | |
95 | + | |
96 | + short dc_write_4428(int icdev, short offset, short lenth, byte[] buffer); | |
97 | + | |
98 | + short dc_write_4428_hex(int icdev, short offset, short lenth, byte[] buffer); | |
99 | + | |
100 | + short dc_verifypin_4428(int icdev, byte[] passwd); | |
101 | + | |
102 | + short dc_verifypin_4428_hex(int icdev, byte[] passwd); | |
103 | + | |
104 | + short dc_readpin_4428(int icdev, byte[] passwd); | |
105 | + | |
106 | + short dc_readpin_4428_hex(int icdev, byte[] passwd); | |
107 | + | |
108 | + short dc_readpincount_4428(int icdev); | |
109 | + | |
110 | + short dc_changepin_4428(int icdev, byte[] passwd); | |
111 | + | |
112 | + short dc_changepin_4428_hex(int icdev, byte[] passwd); | |
113 | + | |
114 | + short dc_Check_4442(int icdev); | |
115 | + | |
116 | + short dc_Check_4428(int icdev); | |
117 | + | |
118 | + short dc_card_b_hex(int icdev, byte[] rbuf); | |
119 | + | |
120 | + short dc_card_b(int icdev, byte[] rbuf); | |
121 | + | |
122 | + short dc_CheckCard(int icdev); | |
123 | + | |
124 | + short dc_read_24c(int icdev, short offset, short lenth, byte[] buffer); | |
125 | + | |
126 | + short dc_read_24c64(int icdev, short offset, short lenth, byte[] buffer); | |
127 | + | |
128 | + short dc_write_24c(int icdev, short offset, short lenth, byte[] buffer); | |
129 | + | |
130 | + short dc_write_24c64(int icdev, short offset, short lenth, byte[] buffer); | |
131 | + | |
132 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/M1Demo.java
0 → 100644
1 | +/* | |
2 | + * To change this template, choose Tools | Templates | |
3 | + * and open the template in the editor. | |
4 | + */ | |
5 | +package d8demo; | |
6 | + | |
7 | +import com.sun.jna.Native; | |
8 | + | |
9 | +/** | |
10 | + * m1卡操作demo | |
11 | + * @author decard | |
12 | + */ | |
13 | +public class M1Demo { | |
14 | + | |
15 | + public static void print_bytes(byte[] b, int length) { | |
16 | + for (int i = 0; i < length; ++i) { | |
17 | + String hex = Integer.toHexString(b[i] & 0xFF); | |
18 | + if (hex.length() == 1) { | |
19 | + hex = '0' + hex; | |
20 | + } | |
21 | + System.out.print(hex.toUpperCase()); | |
22 | + } | |
23 | + } | |
24 | + | |
25 | + public static void main(String[] args) { | |
26 | + | |
27 | + Dcrf32_h dcrf32; | |
28 | + dcrf32 = (Dcrf32_h) Native.loadLibrary("./dcrf32.dll", Dcrf32_h.class); | |
29 | + | |
30 | + int result; | |
31 | + int handle; | |
32 | + int[] snr = new int[1]; | |
33 | + byte[] send_buffer = new byte[2048]; | |
34 | + byte[] recv_buffer = new byte[2048]; | |
35 | + | |
36 | + | |
37 | + | |
38 | + System.out.print("dc_init ... "); | |
39 | + result = dcrf32.dc_init((short) 100, 115200); | |
40 | + if (result < 0) { | |
41 | + System.out.println("error!"); | |
42 | + return; | |
43 | + } | |
44 | + System.out.println("ok!"); | |
45 | + | |
46 | + handle = result; | |
47 | + | |
48 | + System.out.print("dc_card ... "); | |
49 | + result = dcrf32.dc_config_card(handle, (byte) 0x41);//设置非接卡型为A | |
50 | + result = dcrf32.dc_card(handle, (byte) 0, snr); | |
51 | + if (result != 0) { | |
52 | + System.out.println(result); | |
53 | + System.out.println("error!"); | |
54 | + dcrf32.dc_exit(handle); | |
55 | + return; | |
56 | + } | |
57 | + System.out.println("ok!"); | |
58 | + | |
59 | + recv_buffer[0] = (byte) ((snr[0] >>> 24) & 0xff); | |
60 | + recv_buffer[1] = (byte) ((snr[0] >>> 16) & 0xff); | |
61 | + recv_buffer[2] = (byte) ((snr[0] >>> 8) & 0xff); | |
62 | + recv_buffer[3] = (byte) ((snr[0] >>> 0) & 0xff); | |
63 | + print_bytes(recv_buffer, 4); | |
64 | + System.out.println(""); | |
65 | + | |
66 | + byte[] pass = new byte[6]; | |
67 | + pass[0] = (byte) 0xff; | |
68 | + pass[1] = (byte) 0xff; | |
69 | + pass[2] = (byte) 0xff; | |
70 | + pass[3] = (byte) 0xff; | |
71 | + pass[4] = (byte) 0xff; | |
72 | + pass[5] = (byte) 0xff; | |
73 | + | |
74 | + System.out.print("dc_load_key ... "); | |
75 | + result = dcrf32.dc_load_key(handle, (byte) 0, (byte) 0, pass); | |
76 | + if (result != 0) { | |
77 | + System.out.println("error!"); | |
78 | + dcrf32.dc_exit(handle); | |
79 | + return; | |
80 | + } | |
81 | + System.out.println("ok!"); | |
82 | + | |
83 | + System.out.print("dc_authentication ... "); | |
84 | + result = dcrf32.dc_authentication(handle, (byte) 0, (byte) 0); | |
85 | + if (result != 0) { | |
86 | + System.out.println("error!"); | |
87 | + dcrf32.dc_exit(handle); | |
88 | + return; | |
89 | + } | |
90 | + System.out.println("ok!"); | |
91 | + | |
92 | + System.out.print("dc_write ... "); | |
93 | + send_buffer[0] = (byte) 0x41; | |
94 | + send_buffer[1] = (byte) 0x42; | |
95 | + send_buffer[2] = (byte) 0x43; | |
96 | + send_buffer[3] = (byte) 0x44; | |
97 | + send_buffer[4] = (byte) 0x45; | |
98 | + send_buffer[5] = (byte) 0x46; | |
99 | + send_buffer[6] = (byte) 0x47; | |
100 | + send_buffer[7] = (byte) 0x48; | |
101 | + send_buffer[8] = (byte) 0x49; | |
102 | + send_buffer[9] = (byte) 0x4A; | |
103 | + send_buffer[10] = (byte) 0x4B; | |
104 | + send_buffer[11] = (byte) 0x4C; | |
105 | + send_buffer[12] = (byte) 0x4D; | |
106 | + send_buffer[13] = (byte) 0x4E; | |
107 | + send_buffer[14] = (byte) 0x4F; | |
108 | + send_buffer[15] = (byte) 0x50; | |
109 | + result = dcrf32.dc_write(handle, (byte) 2, send_buffer); | |
110 | + if (result != 0) { | |
111 | + System.out.println("error!"); | |
112 | + dcrf32.dc_exit(handle); | |
113 | + return; | |
114 | + } | |
115 | + System.out.println("ok!"); | |
116 | + | |
117 | + System.out.print("dc_read ... "); | |
118 | + result = dcrf32.dc_read(handle, (byte) 2, recv_buffer); | |
119 | + if (result != 0) { | |
120 | + System.out.println("error!"); | |
121 | + dcrf32.dc_exit(handle); | |
122 | + return; | |
123 | + } | |
124 | + System.out.println("ok!"); | |
125 | + | |
126 | + print_bytes(recv_buffer, 16); | |
127 | + System.out.println(""); | |
128 | + | |
129 | + System.out.print("dc_beep ... "); | |
130 | + result = dcrf32.dc_beep(handle, (short) 10); | |
131 | + if (result != 0) { | |
132 | + System.out.println("error!"); | |
133 | + dcrf32.dc_exit(handle); | |
134 | + return; | |
135 | + } | |
136 | + System.out.println("ok!"); | |
137 | + | |
138 | + System.out.print("dc_exit ... "); | |
139 | + result = dcrf32.dc_exit(handle); | |
140 | + if (result != 0) { | |
141 | + System.out.println("error!"); | |
142 | + return; | |
143 | + } | |
144 | + System.out.println("ok!"); | |
145 | + } | |
146 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/TypeADemo.java
0 → 100644
1 | +/* | |
2 | + * To change this template, choose Tools | Templates | |
3 | + * and open the template in the editor. | |
4 | + */ | |
5 | +package d8demo; | |
6 | + | |
7 | +import com.sun.jna.Native; | |
8 | + | |
9 | +/** | |
10 | + * type a ¿¨²Ù×÷demo | |
11 | + * @author decard | |
12 | + */ | |
13 | +public class TypeADemo { | |
14 | + | |
15 | + public static void print_bytes(byte[] b, int length) { | |
16 | + for (int i = 0; i < length; ++i) { | |
17 | + String hex = Integer.toHexString(b[i] & 0xFF); | |
18 | + if (hex.length() == 1) { | |
19 | + hex = '0' + hex; | |
20 | + } | |
21 | + System.out.print(hex.toUpperCase()); | |
22 | + } | |
23 | + } | |
24 | + | |
25 | + public static void main(String[] args) { | |
26 | + Dcrf32_h dcrf32; | |
27 | + dcrf32 = (Dcrf32_h) Native.loadLibrary("./dcrf32.dll", Dcrf32_h.class); | |
28 | + | |
29 | + int result; | |
30 | + int handle; | |
31 | + | |
32 | + int[] snr = new int[1]; | |
33 | + byte[] rlen = new byte[1]; | |
34 | + byte[] send_buffer = new byte[2048]; | |
35 | + byte[] recv_buffer = new byte[2048]; | |
36 | + | |
37 | + | |
38 | + | |
39 | + System.out.print("dc_init ... "); | |
40 | + result = dcrf32.dc_init((short) 100, 115200); | |
41 | + if (result < 0) { | |
42 | + System.out.println("error!"); | |
43 | + return; | |
44 | + } | |
45 | + System.out.println("ok!"); | |
46 | + | |
47 | + handle = result; | |
48 | + | |
49 | + System.out.print("dc_config_card ... "); | |
50 | + result = dcrf32.dc_config_card(handle, (byte) 0x41); | |
51 | + if (result != 0) { | |
52 | + System.out.println("error!"); | |
53 | + dcrf32.dc_exit(handle); | |
54 | + return; | |
55 | + } | |
56 | + System.out.println("ok!"); | |
57 | + | |
58 | + System.out.print("dc_card ... "); | |
59 | + result = dcrf32.dc_card(handle, (byte) 0, snr); | |
60 | + if (result != 0) { | |
61 | + System.out.println("error!"); | |
62 | + dcrf32.dc_exit(handle); | |
63 | + return; | |
64 | + } | |
65 | + System.out.println("ok!"); | |
66 | + | |
67 | + System.out.println(snr[0]); | |
68 | + | |
69 | + System.out.print("dc_pro_reset ... "); | |
70 | + result = dcrf32.dc_pro_reset(handle, rlen, recv_buffer); | |
71 | + if (result != 0) { | |
72 | + System.out.println("error!"); | |
73 | + dcrf32.dc_exit(handle); | |
74 | + return; | |
75 | + } | |
76 | + System.out.println("ok!"); | |
77 | + | |
78 | + System.out.print("INFO: "); | |
79 | + print_bytes(recv_buffer, rlen[0] & 0xFF); | |
80 | + System.out.println(); | |
81 | + | |
82 | + System.out.print("dc_pro_command ... "); | |
83 | + send_buffer[0] = (byte) 0x00; | |
84 | + send_buffer[1] = (byte) 0x84; | |
85 | + send_buffer[2] = (byte) 0x00; | |
86 | + send_buffer[3] = (byte) 0x00; | |
87 | + send_buffer[4] = (byte) 0x08; | |
88 | + result = dcrf32.dc_pro_command(handle, (byte) 5, send_buffer, rlen, recv_buffer, (byte) 7); | |
89 | + if (result != 0) { | |
90 | + System.out.println("error!"); | |
91 | + dcrf32.dc_exit(handle); | |
92 | + return; | |
93 | + } | |
94 | + System.out.println("ok!"); | |
95 | + | |
96 | + System.out.print("DATA: "); | |
97 | + print_bytes(recv_buffer, rlen[0] & 0xFF); | |
98 | + System.out.println(); | |
99 | + | |
100 | + System.out.print("dc_beep ... "); | |
101 | + result = dcrf32.dc_beep(handle, (short) 10); | |
102 | + if (result != 0) { | |
103 | + System.out.println("error!"); | |
104 | + dcrf32.dc_exit(handle); | |
105 | + return; | |
106 | + } | |
107 | + System.out.println("ok!"); | |
108 | + | |
109 | + System.out.print("dc_exit ... "); | |
110 | + result = dcrf32.dc_exit(handle); | |
111 | + if (result != 0) { | |
112 | + System.out.println("error!"); | |
113 | + return; | |
114 | + } | |
115 | + System.out.println("ok!"); | |
116 | + | |
117 | + } | |
118 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/java/src/d8demo/TypeBDemo.java
0 → 100644
1 | +/* | |
2 | + * To change this template, choose Tools | Templates | |
3 | + * and open the template in the editor. | |
4 | + */ | |
5 | +package d8demo; | |
6 | + | |
7 | +import com.sun.jna.Native; | |
8 | +import java.io.UnsupportedEncodingException; | |
9 | +import javax.print.DocFlavor; | |
10 | + | |
11 | +/** | |
12 | + * type b ¿¨²Ù×÷demo | |
13 | + * | |
14 | + * @author decard | |
15 | + */ | |
16 | +public class TypeBDemo { | |
17 | + | |
18 | + public static void print_bytes(byte[] b, int length) { | |
19 | + for (int i = 0; i < length; ++i) { | |
20 | + String hex = Integer.toHexString(b[i] & 0xFF); | |
21 | + if (hex.length() == 1) { | |
22 | + hex = '0' + hex; | |
23 | + } | |
24 | + System.out.print(hex.toUpperCase()); | |
25 | + } | |
26 | + } | |
27 | + | |
28 | + public static String gbk_bytes_to_string(byte[] data) { | |
29 | + int i; | |
30 | + String s = ""; | |
31 | + | |
32 | + for (i = 0; i < data.length; ++i) { | |
33 | + if (data[i] == 0) { | |
34 | + break; | |
35 | + } | |
36 | + } | |
37 | + | |
38 | + byte[] temp = new byte[i]; | |
39 | + System.arraycopy(data, 0, temp, 0, temp.length); | |
40 | + | |
41 | + try { | |
42 | + s = new String(temp, "GBK"); | |
43 | + } catch (UnsupportedEncodingException e) { | |
44 | + // TODO Auto-generated catch block | |
45 | + e.printStackTrace(); | |
46 | + } | |
47 | + | |
48 | + return s; | |
49 | + } | |
50 | + | |
51 | + public static byte[] string_to_gbk_bytes(String data) { | |
52 | + int i = 0; | |
53 | + byte[] s = null; | |
54 | + | |
55 | + try { | |
56 | + s = data.getBytes("GBK"); | |
57 | + i = s.length; | |
58 | + } catch (UnsupportedEncodingException e) { | |
59 | + // TODO Auto-generated catch block | |
60 | + e.printStackTrace(); | |
61 | + } | |
62 | + | |
63 | + byte[] temp = new byte[i + 1]; | |
64 | + System.arraycopy(s, 0, temp, 0, i); | |
65 | + temp[i] = 0; | |
66 | + | |
67 | + return temp; | |
68 | + } | |
69 | + | |
70 | + public static void main(String[] args) { | |
71 | + Dcrf32_h dcrf32; | |
72 | + dcrf32 = (Dcrf32_h) Native.loadLibrary("./dcrf32.dll", Dcrf32_h.class); | |
73 | + | |
74 | + int result; | |
75 | + int handle; | |
76 | + | |
77 | + int[] snr = new int[1]; | |
78 | + byte[] rlen = new byte[1]; | |
79 | + byte[] temp; | |
80 | + byte[] send_buffer = new byte[2048]; | |
81 | + byte[] recv_buffer = new byte[2048]; | |
82 | + | |
83 | + | |
84 | + | |
85 | + System.out.print("dc_init ... "); | |
86 | + result = dcrf32.dc_init((short) 100, 115200); | |
87 | + if (result < 0) { | |
88 | + System.out.println("error!"); | |
89 | + return; | |
90 | + } | |
91 | + System.out.println("ok!"); | |
92 | + | |
93 | + handle = result; | |
94 | + | |
95 | + System.out.print("dc_config_card ... "); | |
96 | + result = dcrf32.dc_config_card(handle, (byte) 0x42); | |
97 | + if (result != 0) { | |
98 | + System.out.println("error!"); | |
99 | + dcrf32.dc_exit(handle); | |
100 | + return; | |
101 | + } | |
102 | + System.out.println("ok!"); | |
103 | + | |
104 | + System.out.print("dc request card b ..."); | |
105 | + temp = new byte[128]; | |
106 | + result = dcrf32.dc_card_b(handle, temp); | |
107 | + if (result != 0) { | |
108 | + System.out.println("error!"); | |
109 | + dcrf32.dc_exit(handle); | |
110 | + return; | |
111 | + } | |
112 | + System.out.println("ok"); | |
113 | + System.out.print("atqb : "); | |
114 | + print_bytes(temp, 12); | |
115 | + System.out.println(""); | |
116 | + | |
117 | + System.out.print("dc_pro_command ... "); | |
118 | + send_buffer[0] = (byte) 0x00; | |
119 | + send_buffer[1] = (byte) 0x84; | |
120 | + send_buffer[2] = (byte) 0x00; | |
121 | + send_buffer[3] = (byte) 0x00; | |
122 | + send_buffer[4] = (byte) 0x08; | |
123 | + result = dcrf32.dc_pro_command(handle, (byte) 5, send_buffer, rlen, recv_buffer, (byte) 7); | |
124 | + if (result != 0) { | |
125 | + System.out.println("error!"); | |
126 | + dcrf32.dc_exit(handle); | |
127 | + return; | |
128 | + } | |
129 | + System.out.println("ok!"); | |
130 | + | |
131 | + System.out.print("DATA: "); | |
132 | + print_bytes(recv_buffer, rlen[0] & 0xFF); | |
133 | + System.out.println(); | |
134 | + | |
135 | + System.out.print("dc_beep ... "); | |
136 | + result = dcrf32.dc_beep(handle, (short) 10); | |
137 | + if (result != 0) { | |
138 | + System.out.println("error!"); | |
139 | + dcrf32.dc_exit(handle); | |
140 | + return; | |
141 | + } | |
142 | + System.out.println("ok!"); | |
143 | + | |
144 | + System.out.print("dc_exit ... "); | |
145 | + result = dcrf32.dc_exit(handle); | |
146 | + if (result != 0) { | |
147 | + System.out.println("error!"); | |
148 | + return; | |
149 | + } | |
150 | + System.out.println("ok!"); | |
151 | + | |
152 | + } | |
153 | +} | ... | ... |
doc/D3&&D8&&T10ulm开发包/win32-Examples/C#/D8_ULtralight(C#)/D8_ULtralight.csproj
0 → 100644
1 | +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
2 | + <PropertyGroup> | |
3 | + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |
4 | + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |
5 | + <ProductVersion>8.0.50727</ProductVersion> | |
6 | + <SchemaVersion>2.0</SchemaVersion> | |
7 | + <ProjectGuid>{C7372DFE-74B7-4E47-BD86-2F295878BF4B}</ProjectGuid> | |
8 | + <OutputType>WinExe</OutputType> | |
9 | + <AppDesignerFolder>Properties</AppDesignerFolder> | |
10 | + <RootNamespace>D8_ULtralight</RootNamespace> | |
11 | + <AssemblyName>D8_ULtralight</AssemblyName> | |
12 | + </PropertyGroup> | |
13 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |
14 | + <DebugSymbols>true</DebugSymbols> | |
15 | + <DebugType>full</DebugType> | |
16 | + <Optimize>false</Optimize> | |
17 | + <OutputPath>bin\Debug\</OutputPath> | |
18 | + <DefineConstants>DEBUG;TRACE</DefineConstants> | |
19 | + <ErrorReport>prompt</ErrorReport> | |
20 | + <WarningLevel>4</WarningLevel> | |
21 | + </PropertyGroup> | |
22 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |
23 | + <DebugType>pdbonly</DebugType> | |
24 | + <Optimize>true</Optimize> | |
25 | + <OutputPath>bin\Release\</OutputPath> | |
26 | + <DefineConstants>TRACE</DefineConstants> | |
27 | + <ErrorReport>prompt</ErrorReport> | |
28 | + <WarningLevel>4</WarningLevel> | |
29 | + </PropertyGroup> | |
30 | + <ItemGroup> | |
31 | + <Reference Include="System" /> | |
32 | + <Reference Include="System.Data" /> | |
33 | + <Reference Include="System.Deployment" /> | |
34 | + <Reference Include="System.Drawing" /> | |
35 | + <Reference Include="System.Windows.Forms" /> | |
36 | + <Reference Include="System.Xml" /> | |
37 | + </ItemGroup> | |
38 | + <ItemGroup> | |
39 | + <Compile Include="Form1.cs"> | |
40 | + <SubType>Form</SubType> | |
41 | + </Compile> | |
42 | + <Compile Include="Form1.Designer.cs"> | |
43 | + <DependentUpon>Form1.cs</DependentUpon> | |
44 | + </Compile> | |
45 | + <Compile Include="Program.cs" /> | |
46 | + <Compile Include="Properties\AssemblyInfo.cs" /> | |
47 | + <EmbeddedResource Include="Form1.resx"> | |
48 | + <SubType>Designer</SubType> | |
49 | + <DependentUpon>Form1.cs</DependentUpon> | |
50 | + </EmbeddedResource> | |
51 | + <EmbeddedResource Include="Properties\Resources.resx"> | |
52 | + <Generator>ResXFileCodeGenerator</Generator> | |
53 | + <LastGenOutput>Resources.Designer.cs</LastGenOutput> | |
54 | + <SubType>Designer</SubType> | |
55 | + </EmbeddedResource> | |
56 | + <Compile Include="Properties\Resources.Designer.cs"> | |
57 | + <AutoGen>True</AutoGen> | |
58 | + <DependentUpon>Resources.resx</DependentUpon> | |
59 | + </Compile> | |
60 | + <None Include="Properties\Settings.settings"> | |
61 | + <Generator>SettingsSingleFileGenerator</Generator> | |
62 | + <LastGenOutput>Settings.Designer.cs</LastGenOutput> | |
63 | + </None> | |
64 | + <Compile Include="Properties\Settings.Designer.cs"> | |
65 | + <AutoGen>True</AutoGen> | |
66 | + <DependentUpon>Settings.settings</DependentUpon> | |
67 | + <DesignTimeSharedInput>True</DesignTimeSharedInput> | |
68 | + </Compile> | |
69 | + </ItemGroup> | |
70 | + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | |
71 | + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | |
72 | + Other similar extension points exist, see Microsoft.Common.targets. | |
73 | + <Target Name="BeforeBuild"> | |
74 | + </Target> | |
75 | + <Target Name="AfterBuild"> | |
76 | + </Target> | |
77 | + --> | |
78 | +</Project> | |
0 | 79 | \ No newline at end of file | ... | ... |
doc/D3&&D8&&T10ulm开发包/win32-Examples/C#/D8_ULtralight(C#)/D8_ULtralight.sln
0 → 100644
1 | + | |
2 | +Microsoft Visual Studio Solution File, Format Version 9.00 | |
3 | +# Visual Studio 2005 | |
4 | +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "D8_ULtralight", "D8_ULtralight.csproj", "{C7372DFE-74B7-4E47-BD86-2F295878BF4B}" | |
5 | +EndProject | |
6 | +Global | |
7 | + GlobalSection(SolutionConfigurationPlatforms) = preSolution | |
8 | + Debug|Any CPU = Debug|Any CPU | |
9 | + Release|Any CPU = Release|Any CPU | |
10 | + EndGlobalSection | |
11 | + GlobalSection(ProjectConfigurationPlatforms) = postSolution | |
12 | + {C7372DFE-74B7-4E47-BD86-2F295878BF4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |
13 | + {C7372DFE-74B7-4E47-BD86-2F295878BF4B}.Debug|Any CPU.Build.0 = Debug|Any CPU | |
14 | + {C7372DFE-74B7-4E47-BD86-2F295878BF4B}.Release|Any CPU.ActiveCfg = Release|Any CPU | |
15 | + {C7372DFE-74B7-4E47-BD86-2F295878BF4B}.Release|Any CPU.Build.0 = Release|Any CPU | |
16 | + EndGlobalSection | |
17 | + GlobalSection(SolutionProperties) = preSolution | |
18 | + HideSolutionNode = FALSE | |
19 | + EndGlobalSection | |
20 | +EndGlobal | ... | ... |
doc/D3&&D8&&T10ulm开发包/win32-Examples/C#/D8_ULtralight(C#)/Form1.Designer.cs
0 → 100644
1 | +namespace D8_ULtralight | |
2 | +{ | |
3 | + partial class Form1 | |
4 | + { | |
5 | + /// <summary> | |
6 | + /// 必需的设计器变量。 | |
7 | + /// </summary> | |
8 | + private System.ComponentModel.IContainer components = null; | |
9 | + | |
10 | + /// <summary> | |
11 | + /// 清理所有正在使用的资源。 | |
12 | + /// </summary> | |
13 | + /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |
14 | + protected override void Dispose(bool disposing) | |
15 | + { | |
16 | + if (disposing && (components != null)) | |
17 | + { | |
18 | + components.Dispose(); | |
19 | + } | |
20 | + base.Dispose(disposing); | |
21 | + } | |
22 | + | |
23 | + #region Windows 窗体设计器生成的代码 | |
24 | + | |
25 | + /// <summary> | |
26 | + /// 设计器支持所需的方法 - 不要 | |
27 | + /// 使用代码编辑器修改此方法的内容。 | |
28 | + /// </summary> | |
29 | + private void InitializeComponent() | |
30 | + { | |
31 | + this.button1 = new System.Windows.Forms.Button(); | |
32 | + this.button2 = new System.Windows.Forms.Button(); | |
33 | + this.button3 = new System.Windows.Forms.Button(); | |
34 | + this.label1 = new System.Windows.Forms.Label(); | |
35 | + this.textBox1 = new System.Windows.Forms.TextBox(); | |
36 | + this.button4 = new System.Windows.Forms.Button(); | |
37 | + this.label2 = new System.Windows.Forms.Label(); | |
38 | + this.textBox2 = new System.Windows.Forms.TextBox(); | |
39 | + this.label3 = new System.Windows.Forms.Label(); | |
40 | + this.textBox3 = new System.Windows.Forms.TextBox(); | |
41 | + this.button5 = new System.Windows.Forms.Button(); | |
42 | + this.label4 = new System.Windows.Forms.Label(); | |
43 | + this.textBox4 = new System.Windows.Forms.TextBox(); | |
44 | + this.label5 = new System.Windows.Forms.Label(); | |
45 | + this.textBox5 = new System.Windows.Forms.TextBox(); | |
46 | + this.SuspendLayout(); | |
47 | + // | |
48 | + // button1 | |
49 | + // | |
50 | + this.button1.Location = new System.Drawing.Point(12, 12); | |
51 | + this.button1.Name = "button1"; | |
52 | + this.button1.Size = new System.Drawing.Size(91, 31); | |
53 | + this.button1.TabIndex = 0; | |
54 | + this.button1.Text = "打开端口"; | |
55 | + this.button1.UseVisualStyleBackColor = true; | |
56 | + this.button1.Click += new System.EventHandler(this.button1_Click); | |
57 | + // | |
58 | + // button2 | |
59 | + // | |
60 | + this.button2.Location = new System.Drawing.Point(235, 13); | |
61 | + this.button2.Name = "button2"; | |
62 | + this.button2.Size = new System.Drawing.Size(82, 30); | |
63 | + this.button2.TabIndex = 1; | |
64 | + this.button2.Text = "退出"; | |
65 | + this.button2.UseVisualStyleBackColor = true; | |
66 | + this.button2.Click += new System.EventHandler(this.button2_Click); | |
67 | + // | |
68 | + // button3 | |
69 | + // | |
70 | + this.button3.Location = new System.Drawing.Point(12, 64); | |
71 | + this.button3.Name = "button3"; | |
72 | + this.button3.Size = new System.Drawing.Size(91, 31); | |
73 | + this.button3.TabIndex = 0; | |
74 | + this.button3.Text = "寻卡"; | |
75 | + this.button3.UseVisualStyleBackColor = true; | |
76 | + this.button3.Click += new System.EventHandler(this.button3_Click); | |
77 | + // | |
78 | + // label1 | |
79 | + // | |
80 | + this.label1.AutoSize = true; | |
81 | + this.label1.Location = new System.Drawing.Point(20, 114); | |
82 | + this.label1.Name = "label1"; | |
83 | + this.label1.Size = new System.Drawing.Size(41, 12); | |
84 | + this.label1.TabIndex = 2; | |
85 | + this.label1.Text = "卡号:"; | |
86 | + // | |
87 | + // textBox1 | |
88 | + // | |
89 | + this.textBox1.Location = new System.Drawing.Point(67, 111); | |
90 | + this.textBox1.Name = "textBox1"; | |
91 | + this.textBox1.Size = new System.Drawing.Size(156, 21); | |
92 | + this.textBox1.TabIndex = 3; | |
93 | + // | |
94 | + // button4 | |
95 | + // | |
96 | + this.button4.Location = new System.Drawing.Point(12, 149); | |
97 | + this.button4.Name = "button4"; | |
98 | + this.button4.Size = new System.Drawing.Size(91, 31); | |
99 | + this.button4.TabIndex = 0; | |
100 | + this.button4.Text = "读卡"; | |
101 | + this.button4.UseVisualStyleBackColor = true; | |
102 | + this.button4.Click += new System.EventHandler(this.button4_Click); | |
103 | + // | |
104 | + // label2 | |
105 | + // | |
106 | + this.label2.AutoSize = true; | |
107 | + this.label2.Location = new System.Drawing.Point(20, 190); | |
108 | + this.label2.Name = "label2"; | |
109 | + this.label2.Size = new System.Drawing.Size(41, 12); | |
110 | + this.label2.TabIndex = 2; | |
111 | + this.label2.Text = "块号:"; | |
112 | + // | |
113 | + // textBox2 | |
114 | + // | |
115 | + this.textBox2.Location = new System.Drawing.Point(58, 187); | |
116 | + this.textBox2.Name = "textBox2"; | |
117 | + this.textBox2.Size = new System.Drawing.Size(58, 21); | |
118 | + this.textBox2.TabIndex = 3; | |
119 | + this.textBox2.Text = "1"; | |
120 | + // | |
121 | + // label3 | |
122 | + // | |
123 | + this.label3.AutoSize = true; | |
124 | + this.label3.Location = new System.Drawing.Point(20, 217); | |
125 | + this.label3.Name = "label3"; | |
126 | + this.label3.Size = new System.Drawing.Size(41, 12); | |
127 | + this.label3.TabIndex = 2; | |
128 | + this.label3.Text = "数据:"; | |
129 | + // | |
130 | + // textBox3 | |
131 | + // | |
132 | + this.textBox3.Location = new System.Drawing.Point(58, 214); | |
133 | + this.textBox3.Name = "textBox3"; | |
134 | + this.textBox3.Size = new System.Drawing.Size(165, 21); | |
135 | + this.textBox3.TabIndex = 3; | |
136 | + // | |
137 | + // button5 | |
138 | + // | |
139 | + this.button5.Location = new System.Drawing.Point(12, 245); | |
140 | + this.button5.Name = "button5"; | |
141 | + this.button5.Size = new System.Drawing.Size(91, 31); | |
142 | + this.button5.TabIndex = 0; | |
143 | + this.button5.Text = "写卡"; | |
144 | + this.button5.UseVisualStyleBackColor = true; | |
145 | + this.button5.Click += new System.EventHandler(this.button5_Click); | |
146 | + // | |
147 | + // label4 | |
148 | + // | |
149 | + this.label4.AutoSize = true; | |
150 | + this.label4.Location = new System.Drawing.Point(20, 286); | |
151 | + this.label4.Name = "label4"; | |
152 | + this.label4.Size = new System.Drawing.Size(41, 12); | |
153 | + this.label4.TabIndex = 2; | |
154 | + this.label4.Text = "块号:"; | |
155 | + // | |
156 | + // textBox4 | |
157 | + // | |
158 | + this.textBox4.Location = new System.Drawing.Point(58, 283); | |
159 | + this.textBox4.Name = "textBox4"; | |
160 | + this.textBox4.Size = new System.Drawing.Size(58, 21); | |
161 | + this.textBox4.TabIndex = 3; | |
162 | + this.textBox4.Text = "4"; | |
163 | + // | |
164 | + // label5 | |
165 | + // | |
166 | + this.label5.AutoSize = true; | |
167 | + this.label5.Location = new System.Drawing.Point(20, 313); | |
168 | + this.label5.Name = "label5"; | |
169 | + this.label5.Size = new System.Drawing.Size(41, 12); | |
170 | + this.label5.TabIndex = 2; | |
171 | + this.label5.Text = "数据:"; | |
172 | + // | |
173 | + // textBox5 | |
174 | + // | |
175 | + this.textBox5.Location = new System.Drawing.Point(58, 310); | |
176 | + this.textBox5.Name = "textBox5"; | |
177 | + this.textBox5.Size = new System.Drawing.Size(165, 21); | |
178 | + this.textBox5.TabIndex = 3; | |
179 | + this.textBox5.Text = "11223344"; | |
180 | + // | |
181 | + // Form1 | |
182 | + // | |
183 | + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |
184 | + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |
185 | + this.ClientSize = new System.Drawing.Size(346, 348); | |
186 | + this.Controls.Add(this.textBox5); | |
187 | + this.Controls.Add(this.label5); | |
188 | + this.Controls.Add(this.textBox3); | |
189 | + this.Controls.Add(this.textBox4); | |
190 | + this.Controls.Add(this.label3); | |
191 | + this.Controls.Add(this.label4); | |
192 | + this.Controls.Add(this.textBox2); | |
193 | + this.Controls.Add(this.label2); | |
194 | + this.Controls.Add(this.textBox1); | |
195 | + this.Controls.Add(this.label1); | |
196 | + this.Controls.Add(this.button5); | |
197 | + this.Controls.Add(this.button2); | |
198 | + this.Controls.Add(this.button4); | |
199 | + this.Controls.Add(this.button3); | |
200 | + this.Controls.Add(this.button1); | |
201 | + this.Name = "Form1"; | |
202 | + this.Text = "Form1"; | |
203 | + this.ResumeLayout(false); | |
204 | + this.PerformLayout(); | |
205 | + | |
206 | + } | |
207 | + | |
208 | + #endregion | |
209 | + | |
210 | + private System.Windows.Forms.Button button1; | |
211 | + private System.Windows.Forms.Button button2; | |
212 | + private System.Windows.Forms.Button button3; | |
213 | + private System.Windows.Forms.Label label1; | |
214 | + private System.Windows.Forms.TextBox textBox1; | |
215 | + private System.Windows.Forms.Button button4; | |
216 | + private System.Windows.Forms.Label label2; | |
217 | + private System.Windows.Forms.TextBox textBox2; | |
218 | + private System.Windows.Forms.Label label3; | |
219 | + private System.Windows.Forms.TextBox textBox3; | |
220 | + private System.Windows.Forms.Button button5; | |
221 | + private System.Windows.Forms.Label label4; | |
222 | + private System.Windows.Forms.TextBox textBox4; | |
223 | + private System.Windows.Forms.Label label5; | |
224 | + private System.Windows.Forms.TextBox textBox5; | |
225 | + } | |
226 | +} | |
227 | + | ... | ... |
doc/D3&&D8&&T10ulm开发包/win32-Examples/C#/D8_ULtralight(C#)/Form1.cs
0 → 100644
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using System.ComponentModel; | |
4 | +using System.Data; | |
5 | +using System.Drawing; | |
6 | +using System.Text; | |
7 | +using System.Windows.Forms; | |
8 | +using System.Runtime.InteropServices; | |
9 | + | |
10 | +namespace D8_ULtralight | |
11 | +{ | |
12 | + public partial class Form1 : Form | |
13 | + { | |
14 | +#region | |
15 | + [DllImport("dcrf32.dll")] | |
16 | + public static extern int dc_init(Int16 port, Int32 baud); //初试化 | |
17 | + [DllImport("dcrf32.dll")] | |
18 | + public static extern short dc_exit(int icdev); | |
19 | + [DllImport("dcrf32.dll")] | |
20 | + public static extern short dc_beep(int icdev, uint _Msec); | |
21 | + [DllImport("dcrf32.dll")] | |
22 | + public static extern short dc_card_double_hex(int icdev, char _Mode, [MarshalAs(UnmanagedType.LPStr)] StringBuilder Snr); //从卡中读数据(转换为16进制) | |
23 | + | |
24 | + [DllImport("dcrf32.dll")] | |
25 | + public static extern short dc_read(int icdev, int adr, [Out] byte[] sdata); //从卡中读数据 | |
26 | + [DllImport("dcrf32.dll")] | |
27 | + public static extern short dc_read(int icdev, int adr, [MarshalAs(UnmanagedType.LPStr)] StringBuilder sdata); //从卡中读数据 | |
28 | + | |
29 | + [DllImport("dcrf32.dll")] | |
30 | + public static extern short dc_read_hex(int icdev, int adr, ref byte sdata); //从卡中读数据(转换为16进制) | |
31 | + [DllImport("dcrf32.dll")] | |
32 | + public static extern short dc_read_hex(int icdev, int adr, [MarshalAs(UnmanagedType.LPStr)] StringBuilder sdata); //从卡中读数 | |
33 | + | |
34 | + [DllImport("dcrf32.dll")] | |
35 | + public static extern short dc_write(int icdev, int adr, [In] string sdata); //向卡中写入数据 | |
36 | + [DllImport("dcrf32.dll")] | |
37 | + public static extern short dc_write_hex(int icdev, int adr, [In] string sdata); //向卡中写入数据(转换为16进制) | |
38 | +#endregion | |
39 | + private int icdev=-1; | |
40 | + private short st=-1; | |
41 | + | |
42 | + public Form1() | |
43 | + { | |
44 | + InitializeComponent(); | |
45 | + } | |
46 | + | |
47 | + private void button1_Click(object sender, EventArgs e) | |
48 | + { | |
49 | + if (icdev >0 ) | |
50 | + { | |
51 | + st = dc_exit(icdev); | |
52 | + icdev = -1; | |
53 | + } | |
54 | + icdev = dc_init(100, 115200); | |
55 | + if (icdev<0) | |
56 | + { | |
57 | + MessageBox.Show("打开端口失败","提示"); | |
58 | + return; | |
59 | + } | |
60 | + st = dc_beep(icdev, 10); | |
61 | + | |
62 | + } | |
63 | + | |
64 | + private void button2_Click(object sender, EventArgs e) | |
65 | + { | |
66 | + if (icdev>0) | |
67 | + { | |
68 | + st = dc_exit(icdev); | |
69 | + icdev = -1; | |
70 | + } | |
71 | + this.Close(); | |
72 | + } | |
73 | + | |
74 | + private void button3_Click(object sender, EventArgs e) | |
75 | + { | |
76 | + StringBuilder strsnr=new StringBuilder(20); | |
77 | + st = dc_card_double_hex(icdev, '0', strsnr); | |
78 | + if (st!=0) | |
79 | + { | |
80 | + MessageBox.Show("寻卡失败","提示"); | |
81 | + return; | |
82 | + } | |
83 | + this.textBox1.Text = Convert.ToString(strsnr); | |
84 | + | |
85 | + } | |
86 | + | |
87 | + private void button4_Click(object sender, EventArgs e) | |
88 | + { | |
89 | + short addr = 0; | |
90 | + StringBuilder rbuff = new StringBuilder(32); | |
91 | + addr = Convert.ToInt16(this.textBox2.Text); | |
92 | + | |
93 | + st = dc_read_hex(icdev, addr, rbuff); | |
94 | + if (st!=0) | |
95 | + { | |
96 | + MessageBox.Show("读卡失败","提示"); | |
97 | + return; | |
98 | + } | |
99 | + string ss1 = rbuff.ToString(); | |
100 | + this.textBox3.Text = ss1.Substring(1,8); | |
101 | + | |
102 | + } | |
103 | + | |
104 | + private void button5_Click(object sender, EventArgs e) | |
105 | + { | |
106 | + short addr = 0; | |
107 | + // string wbuffer = String.Format("{0,-32}",textBox5.Text); | |
108 | + string wbuffer = textBox5.Text; | |
109 | + wbuffer = wbuffer.PadRight(32, '0'); | |
110 | + | |
111 | + addr = Convert.ToInt16(this.textBox4.Text); | |
112 | + | |
113 | + st = dc_write_hex(icdev, addr, wbuffer); | |
114 | + if (st != 0) | |
115 | + { | |
116 | + MessageBox.Show("写卡失败", "提示"); | |
117 | + return; | |
118 | + } | |
119 | + MessageBox.Show("写卡成功", "提示"); | |
120 | + } | |
121 | + } | |
122 | +} | |
0 | 123 | \ No newline at end of file | ... | ... |