Exemple #1
0
APDU MockAppLayer::Read()
{
	if(mFragments.size() == 0) throw InvalidStateException(LOCATION, "no more fragments");
	APDU frag = mFragments.front();
	frag.Interpret();
	mFragments.pop_front();
	return frag;
}
void ResponseLoaderTestObject::Load(const std::string& arAPDU)
{
	fdo.Clear();
	HexSequence hs(arAPDU);
	APDU f;
	f.Write(hs, hs.Size());
	f.Interpret();

	ResponseLoader rl(mpLogger, &fdo);
	for(HeaderReadIterator hdr = f.BeginRead(); !hdr.IsEnd(); ++hdr)
	{
		rl.Process(hdr);
	}
}
Exemple #3
0
void AppLayer::OnConfirm(const AppControlField& arCtrl, APDU& arAPDU)
{
	arAPDU.Interpret(); //throws if there is additional data beyond length of 2

	// which channel?
	if(arCtrl.UNS) {
		if(mpUser->IsMaster())
			throw Exception(LOCATION, ALERR_UNEXPECTED_CONFIRM);

		mUnsolicited.OnConfirm(arCtrl.SEQ);		
	}
	else {
		mSolicited.OnConfirm(arCtrl.SEQ);		
	}	
}