D8demoDlg.cpp 16.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693
// D8demoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "D8demo.h"
#include "D8demoDlg.h"
#include "dcrf32.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CD8demoDlg dialog

CD8demoDlg::CD8demoDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CD8demoDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CD8demoDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CD8demoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CD8demoDlg)
	DDX_Control(pDX, IDC_LIST1, m_list1);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CD8demoDlg, CDialog)
	//{{AFX_MSG_MAP(CD8demoDlg)
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
	ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
	ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
	ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
	ON_BN_CLICKED(IDC_BUTTON7, OnButton7)
	ON_BN_CLICKED(IDC_BUTTON8, OnButton8)
//	ON_BN_CLICKED(IDC_BUTTON9, OnButton9)
//	ON_BN_CLICKED(IDC_BUTTON10, OnButton10)
//	ON_BN_CLICKED(IDC_BUTTON11, OnButton11)
//	ON_BN_CLICKED(IDC_BUTTON12, OnButton12)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CD8demoDlg message handlers

BOOL CD8demoDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	icdev = INVALID_HANDLE_VALUE;
	st = 0;
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CD8demoDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CD8demoDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void CD8demoDlg::OnButton1() 
{
	// TODO: Add your control notification handler code here
	char  rbuff[1024]="\0"; 
	char sbuff[1024] = "\0";
	CString temp = "";
	unsigned char  urbuff[1024]="\0";
	m_list1.ResetContent();
	m_list1.AddString ("dc init ...");
	icdev = dc_init(100,115200);
	if(icdev < 0)
	{
		m_list1.AddString("dc init error");
		return;
	}
	m_list1.AddString("dc init ok");
	st = dc_config_card(icdev,65);
	m_list1.AddString("dc card ...");
	st = dc_card_hex(icdev,0,urbuff);
	if (st != 0)
	{
		m_list1.AddString("dc card error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("dc card ok ");
	temp.Format ("card id : %s",(char *)urbuff);
	m_list1.AddString( temp);
	m_list1.AddString("dc load key 'ffffffffffff' for sector 0...");
	memcpy(sbuff,"ffffffffffff",12);
	st = dc_load_key_hex(icdev,0,2,sbuff);
	if(st != 0)
	{
		m_list1.AddString("dc load key error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("dc load key ok");
	m_list1.AddString("dc authenticate key at sector 0...");
	st = dc_authentication(icdev,0,2);
	if(st != 0)
	{
		m_list1.AddString("dc authentication error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("dc authentication ok");
	m_list1.AddString("read info from block 2 of sector 0...");
	st = dc_read_hex(icdev,10,rbuff);
	if(st!=0)
	{
		m_list1.AddString("read info error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read info ok");
	temp.Format ("the info is : %s",(char *)rbuff);
	m_list1.AddString( temp);
	m_list1.AddString("write '11223344556677889900aabbccddeeff' into block 2 of sector 0");	
	memcpy(rbuff,"11223344556677889900aabbccddeeff",32);
	st = dc_write_hex(icdev,10,rbuff);
	if(st!=0)
	{
		m_list1.AddString("write data error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("write data ok");
	m_list1.AddString("read info from block 2 of sector 0");
	st = dc_read_hex(icdev,10,rbuff);
	if(st!=0)
	{
		m_list1.AddString("read info error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read info ok");
	temp.Format ("the info is : %s",(char *)rbuff);
	m_list1.AddString( temp);
	dc_beep(icdev,10);
	dc_exit(icdev);
}

void CD8demoDlg::OnButton2() 
{
	// TODO: Add your control notification handler code here
	char  rbuff[1024]="\0";
	char sbuff[1024]="\0";
	unsigned char rlen = 0;
    unsigned char urbuff[1024]="\0";
	m_list1.ResetContent();
	icdev = dc_init(100,115200);
	if(icdev < 0)
	{
		m_list1.AddString("dc init error");
		return;
	}
	m_list1.AddString("dc init ok");
	st = dc_config_card(icdev,65);
	st = dc_card_hex(icdev,0,urbuff);
	if (st != 0)
	{
		m_list1.AddString("dc card error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("dc card ok ");
	m_list1.AddString( "card id shows beneath :");
	m_list1.AddString( (char *)urbuff);
	st = dc_pro_resethex(icdev,&rlen,rbuff);
	if(st != 0)
	{
		m_list1.AddString("dc pro reset error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("dc pro reset ok");

	memcpy(sbuff,"0084000008",10);
	st = dc_pro_commandhex(icdev,5,sbuff,&rlen,rbuff,7);
	if(st != 0)
	{
		m_list1.AddString("dc pro command error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("get a random number ok,the number shows beneath");
	m_list1.AddString(rbuff);
	dc_beep(icdev,10);
	dc_exit(icdev);
}

void CD8demoDlg::OnButton3() 
{
	// TODO: Add your control notification handler code here
	char  rbuff[1024]="\0"; 
	char sbuff[1024]="\0";
	unsigned char rlen = 0;
	m_list1.ResetContent();
	icdev = dc_init(100,115200);
	if(icdev < 0)
	{
		m_list1.AddString("dc init error");
		return;
	}
	m_list1.AddString("dc init ok");
	st = dc_config_card(icdev,66);
	st = dc_card_b_hex(icdev,rbuff);
	if (st != 0)
	{
		m_list1.AddString("dc card error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("dc card ok ");
	m_list1.AddString( "card id shows beneath :");
	m_list1.AddString(  rbuff);
	memcpy(sbuff,"0084000008",10);
	st = dc_pro_commandhex(icdev,5,sbuff,&rlen,rbuff,7);
	if(st != 0)
	{
		m_list1.AddString("dc pro command error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("get a random number ok,the number shows beneath");
	m_list1.AddString(rbuff);
	dc_beep(icdev,10);
	dc_exit(icdev);
}


void CD8demoDlg::OnButton4() 
{
	// TODO: Add your control notification handler code here
	char recvbuff[1024]="\0";
	char sendbuff[1024]="\0";
	unsigned char  crlen=0;
	CString send="";
	m_list1.ResetContent();
	icdev = dc_init(100,115200);
	if(icdev <0)
	{
		m_list1.AddString ("dc init error");
		return;
	}
	m_list1.AddString ("dc init ok");
	st = dc_setcpu(icdev,12);
	if(st != 0)
	{
		m_list1.AddString("dc_setcpu error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("dc_setcpu ok");
	st = dc_cpureset_hex(icdev,&crlen,recvbuff);
	if(st != 0)
	{
		dc_exit(icdev);
		m_list1.AddString ("dc  cpu reset error");
		return;
	}
	m_list1.AddString ("dc  cpu reset ok");
	m_list1.AddString("the reset info shows beneath :");
	m_list1.AddString(  recvbuff);
	memcpy(sendbuff,"0084000008",10);
	st = dc_cpuapdusource_hex(icdev,5,sendbuff,&crlen,recvbuff);
	if(st != 0)
	{
		m_list1.AddString ("dc apdu error");
	}
	else
	{
		m_list1.AddString ("get a random number ok,the number shows beneath :");
		m_list1.AddString(recvbuff);
	}
	dc_beep(icdev,10);
	dc_exit(icdev);
}

void CD8demoDlg::OnButton5() 
{
	// TODO: Add your control notification handler code here
	unsigned char rbuff[1024]="\0"; 
	unsigned char sbuff[1024]="\0";
	char temp[1024]="\0";
	m_list1.ResetContent();
	icdev = dc_init(100,115200);
	if(icdev <0)
	{
		m_list1.AddString ("dc init error");
		return;
	}
	m_list1.AddString ("dc init ok");
	st = dc_readpincount_4428(icdev);
	if(st <0)
	{
		m_list1.AddString("get the pin error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("the pin count shwos beneath");
	memcpy(sbuff,"ffff",4);
	st = dc_verifypin_4428_hex(icdev,sbuff);
	if(st != 0)
	{
		m_list1.AddString("verify the pin failed");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("verify the pin ok");
	st = dc_changepin_4428_hex(icdev,sbuff);
	if(st != 0)
	{
		m_list1.AddString("change the pin to ffff error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("change the pin to ffff ok");
	st = dc_readpin_4428_hex(icdev,rbuff);
	if(st != 0)
	{
		m_list1.AddString("read the pinn error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read the pin ok ,the pin shows beneath:");
	m_list1.AddString((char *)rbuff);
	m_list1.AddString("read the data from 245 to 250 ...");
	st =dc_read_4428_hex(icdev, 245, 6, rbuff);
	if(st!=0)
	{
		m_list1.AddString("dc read error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read the data ok ,the data shows beneath");
	m_list1.AddString((char *)rbuff);
	memcpy(sbuff,"1234567890ab",12);
	m_list1.AddString("write '1234567890ab' from 245 to 250");
	st = dc_write_4428_hex(icdev, 245, 6, sbuff);
	if(st != 0)
	{
		m_list1.AddString("write data error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("write the data ok");
	m_list1.AddString("read the data from 245 to 250 ...");
	st = dc_read_4428_hex(icdev, 245, 6, rbuff);
	if(st!=0)
	{
		m_list1.AddString("dc read error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read the data ok ,the data shows beneath");
	m_list1.AddString((char *)rbuff);
	dc_beep(icdev,10);
	dc_exit(icdev);
}

void CD8demoDlg::OnButton6() 
{
	// TODO: Add your control notification handler code here
	unsigned char rbuff[1024]="\0";
	unsigned char sbuff[1024]="\0";
	char temp[1024]="\0";
	
	m_list1.ResetContent();
	icdev = dc_init(100,115200);
	
	if(icdev <0)
	{
		m_list1.AddString ("dc init error");
		return;
	}
	m_list1.AddString ("dc init ok");
	
	st = dc_readpincount_4442(icdev);
	if(st <0)
	{
		m_list1.AddString("get the pin error");
		dc_exit(icdev);
		return;
	}
	st+=48;
	m_list1.AddString("the pin count shwos beneath");
	m_list1.AddString((char * )&st);
	
//	memcpy(temp,,6);
	memcpy(sbuff,"ffffff",6);
	st = dc_verifypin_4442_hex(icdev,sbuff);
	if(st != 0)
	{
		m_list1.AddString("verify the pin failed");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("verify the pin ok");
	
	st = dc_changepin_4442_hex(icdev,sbuff);
	if(st != 0)
	{
		m_list1.AddString("change the pin to ffffff error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("change the pin to ffffff ok");
	
	st = dc_readpin_4442_hex(icdev,rbuff);
	if(st != 0)
	{
		m_list1.AddString("read the pinn error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read the pin ok ,the pin shows beneath:");
	m_list1.AddString((char *)rbuff);
	
	m_list1.AddString("read the data from 245 to 250 ...");
	st =dc_read_4442_hex(icdev, 245, 6, rbuff);
	if(st!=0)
	{
		m_list1.AddString("dc read error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read the data ok ,the data shows beneath");
	m_list1.AddString((char *)rbuff);
	
	//memcpy(temp,,12);
	memcpy(sbuff,"1234567890ab",12);
	m_list1.AddString("write '1234567890ab' from 245 to 250");
	st = dc_write_4442_hex(icdev, 245, 6, sbuff);
	if(st != 0)
	{
		m_list1.AddString("write data error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("write the data ok");
	
	m_list1.AddString("read the data from 245 to 250 ...");
	st =dc_read_4442_hex(icdev, 245, 6, rbuff);
	if(st!=0)
	{
		m_list1.AddString("dc read error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read the data ok ,the data shows beneath");
	m_list1.AddString((char *)rbuff);
	
	//memcpy(temp,"1234567890ab",12);
	memcpy(sbuff,"1234567890ab",12);
	m_list1.AddString("write '1234567890ab' from 245 to 250");
	st = dc_write_4442_hex(icdev, 245, 6, sbuff);
	if(st != 0)
	{
		m_list1.AddString("write data error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("write the data ok");
	dc_beep(icdev,10);
	dc_exit(icdev);
}

void CD8demoDlg::OnButton7() 
{
	unsigned char rdata[1024]="\0";
	int status = -1;
	char sdata[1024]="\0";
	CString temp ="";
	// TODO: Add your control notification handler code here
	m_list1.ResetContent();
	icdev = dc_init(100,115200);
	if(icdev <= 0)
	{
		m_list1.AddString("dc init error");
		return;
	}
	m_list1.AddString("dc init ok");
	st = dc_setcpu(icdev,12);//设置接触卡位为附卡座
	memcpy(sdata,"1234567890abcdef",16);
	st = dc_write_24c_hex(icdev,0,8,(unsigned char *)sdata);
	if(st !=0)
	{
		m_list1.AddString("write data error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("write into the area from 0 to 7 as '1234567890abcdef' ok");
	st = dc_read_24c_hex(icdev,0,8,rdata);
	if(st !=0)
	{
		m_list1.AddString("read data error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read data from 0 to 7  ok");
	temp.Format ("card id shows beneath : %s",(char *)rdata);
	m_list1.AddString("the data is " + temp);
	dc_beep(icdev,10);
	dc_exit(icdev);
}

void CD8demoDlg::OnButton8() 
{
	// TODO: Add your control notification handler code here
	unsigned char rdata[1024]="\0";
	int status = -1;
	char sdata[1024]="\0";
	CString temp="";
	// TODO: Add your control notification handler code here
	m_list1.ResetContent();
	icdev = dc_init(100,115200);
	if(icdev <= 0)
	{
		m_list1.AddString("dc init error");
		return;
	}
	m_list1.AddString("dc init ok");
	st = dc_setcpu(icdev,12);//设置接触卡位为附卡座
	memcpy(sdata,"1234567890abcdef",16);
	st = dc_write_24c64_hex(icdev,0,8,(unsigned char *)sdata);
	if(st !=0)
	{
		m_list1.AddString("write data error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("write into the area from 0 to 7 as '1234567890abcdef' ok");
	st = dc_read_24c64_hex(icdev,0,8,rdata);
	if(st !=0)
	{
		m_list1.AddString("read data error");
		dc_exit(icdev);
		return;
	}
	m_list1.AddString("read data from 0 to 7  ok");
	temp.Format ("card id shows beneath : %s",(char *)rdata);
	m_list1.AddString("the data is " + temp);
	dc_beep(icdev,10);
	dc_exit(icdev);
}

//void CD8demoDlg::OnButton9() 
//{
	// TODO: Add your control notification handler code here
//	unsigned char rdata[1024];
//	char * sbuff,* mkey;
//	sbuff = "fedcba98765432100123456789abcdef";
//	mkey = "0123456789abcdeffedcba9876543210";
//	int st = -1;
//	st = dc_tripledes_hex((unsigned char *)mkey,(unsigned char *)sbuff,rdata,0);
//	st = -1;
//}

//void CD8demoDlg::OnButton10() 
//{
	// TODO: Add your control notification handler code here
//	int st = -1;
//	unsigned char rdata[1024],* sbuff;
//	char rbuff[1024];
//	long snr;
	

//	icdev =dc_init(100,115200);

//	st = dc_card_hex(icdev,0,rdata);

//	st = dc_authentication(icdev,0,2);

//	mtest("123456789123456789f",19);
	

//	st = dc_read_hex(icdev,8,rbuff);

//	rbuff[19] = 0;


//	dc_exit(icdev);

//}

int CD8demoDlg::mtest(char *sbuff,int slen)
{
	char msbuff[128];
	memset(msbuff,48,32);
	memcpy(msbuff,sbuff,slen);
	st  = dc_write_hex(icdev,8,msbuff);
	return st;
}

void CD8demoDlg::OnButton11() 
{
	// TODO: Add your control notification handler code here
	char * key = "A81296541567CE19\0";
	char * sour = "abcdef1234567890\0";
	unsigned  char dest[128] = "\0";
	
	__int16 st = -1;
	
	st = dcdeshex((unsigned char *)key,(unsigned char *)sour,dest,1);
}

void CD8demoDlg::OnButton12() 
{
	// TODO: Add your control notification handler code here
/*	unsigned char key[128]={'A','8','1','2','9','6','5','4','1','5','6','7','C','E','1','9',0};
    unsigned char sour[128]={'a','b','c','d','e','f','1','2','3','4','5','6','8','7','9','0',0};
	unsigned char dest[128];
	int st;
	//	st=dcdeshex(key,sour,dest,0);
	//  if (st!=0)
	//{
	//	MessageBox("dcdeshex error");
	//	return;
	//}
	//	MessageBox("dcdeshex ok");
	//	dest[16]=0;
	//	MessageBox(dest);
	
	//	MessageBox(sour);
	//    sour[0]=0;
	
	st=dc_des_hex(key,sour,dest,0);
    if (st!=0)
	{
	//	MessageBox("dcdeshex error");
		return;
	}
	//MessageBox("dcdeshex ok");
	
		sour[16]=0;*/
	unsigned char rdata[1024];

	icdev =dc_init(100,115200);
	
	st = dc_card_double_hex(icdev,0,rdata);

	dc_exit(icdev);
}