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); } }
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); } }