mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 00:03:34 +08:00
CAN mock method - popTxFrame()
This commit is contained in:
@@ -79,6 +79,18 @@ public:
|
|||||||
return matchAndPopTx(frame, uavcan::MonotonicTime::fromUSec(tx_deadline_usec));
|
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)
|
int send(const uavcan::CanFrame& frame, uavcan::MonotonicTime tx_deadline)
|
||||||
{
|
{
|
||||||
assert(this);
|
assert(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user