CAN mock method - popTxFrame()

This commit is contained in:
Pavel Kirienko 2014-03-12 13:01:15 +04:00
parent 54f920898d
commit 3426d55cac

View File

@ -79,6 +79,18 @@ public:
return matchAndPopTx(frame, uavcan::MonotonicTime::fromUSec(tx_deadline_usec));
}
uavcan::CanFrame popTxFrame()
{
if (tx.empty())
{
std::cout << "Tx buffer is empty" << std::endl;
std::abort();
}
const FrameWithTime frame_time = tx.front();
tx.pop();
return frame_time.frame;
}
int send(const uavcan::CanFrame& frame, uavcan::MonotonicTime tx_deadline)
{
assert(this);