void MockAppLayer::SendUnsolicited(APDU& arAPDU) { LOG_BLOCK(LEV_COMM, "=> " << toHex(arAPDU.GetBuffer(), arAPDU.Size(), true)); LOG_BLOCK(LEV_INTERPRET, "=> " << arAPDU.ToString()); mFragments.push_back(arAPDU); this->DoSendUnsol(); }
void AppLayerTest::SendUp(FunctionCodes aCode, bool aFIR, bool aFIN, bool aCON, bool aUNS, int aSEQ) { APDU f; f.SetFunction(aCode); f.SetControl(aFIR, aFIN, aCON, aUNS, aSEQ); lower.SendUp(f.GetBuffer(), f.Size()); }
bool AppLayerTest::CheckSentAPDU(FunctionCodes aCode, bool aFIR, bool aFIN, bool aCON, bool aUNS, int aSEQ) { APDU f; f.SetFunction(aCode); f.SetControl(aFIR, aFIN, aCON, aUNS, aSEQ); if(aCode == FC_UNSOLICITED_RESPONSE || aCode == FC_RESPONSE) { IINField iin; f.SetIIN(iin); } bool ret = lower.BufferEquals(f.GetBuffer(), f.Size()); if(ret) lower.ClearBuffer(); return ret; }