Read Request

1. Synchronne citanie

	EDataCollection* coll = new EDataCollection();
	coll->SetRequestType(EDataCollection::RQ_READ);
	EAplRequest* req = new EAplRequest();
	req->SetRequest(0,TYPE_SUPER_PURSE);
	req->SetRequestCount(1);
	coll->InsertLast(req);
	EDataCollection* rcv = new EDataCollection();

	long err = EChipCard::GetInstance().SendSyncAplRequest(coll, rcv,50000);
	int i = rcv->GetCount();
	EINFO("received: %d err:",i,err);

Vytvorenie read request-u

  1. kolekcii ktoru posielam je potrebne nastavit typ requestu (Citanie/Zapis)
  2. pre jednotlive aplikacne objekty je nutne urcit typ operacie (hlavne pri zapise). Metoda na to sluziaca “SetCardOperation”

example:

	ERequestDataType    reqType[3] = {TYPE_COMMON_DATA,TYPE_PURSE_DATA,TYPE_PERSONAL_DATA};
	EAplRequest	    *aplRequest = new EAplRequest();

	aplRequest->SetCardOperation(EAbstractCardData::OPERATION_READ);// urcim ze sa jedna o operaciu citania
	aplRequest->SetRequestCount(3);
	for (unsigned char pos = 0; pos < 3; pos++)
		aplRequest->SetRequest(pos,reqType[pos]);
	aplRequest->SetIgnoreErrors(0); //nastavuje sa ci sa maju ignorovat chyby (karta ineho zavodu, blokovana karta, atd.) 
                                            //1 - chcem ignorovat chyby
                                            //0 - nechcem ignorovat chyby

Poslanie read request-u

existuju 2 sposovy
  • Poslem hore vytvoreny EAplRequest
               PotomokEAppChipCard->SendAplRequest(aplRequest);
  • Vytvorim novu kolekciu a poslem kolekciu
         EDataCollection	*dataCollection = new EDataCollection();
         dataCollection->SetRequestType(EDataCollection::RQ_READ);
         dataCollection->InsertLast(aplRequest);
         EAppChipCard->SendRequest(dataCollection);
         delete dataCollection;
 
 
howto/readrequest.txt · Last modified: 2013/04/19 09:53 by 192.168.10.185
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki