mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 14:31:36 +08:00
Testing tooling fix
This commit is contained in:
@@ -122,6 +122,11 @@ struct PairableCanDriver : public uavcan::ICanDriver, public uavcan::ICanIface
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pushRxToAllIfaces(const uavcan::CanFrame& can_frame)
|
||||||
|
{
|
||||||
|
read_queue.push(can_frame);
|
||||||
|
}
|
||||||
|
|
||||||
virtual uavcan::int16_t configureFilters(const uavcan::CanFilterConfig*, uavcan::uint16_t) { return -1; }
|
virtual uavcan::int16_t configureFilters(const uavcan::CanFilterConfig*, uavcan::uint16_t) { return -1; }
|
||||||
virtual uavcan::uint16_t getNumFilters() const { return 0; }
|
virtual uavcan::uint16_t getNumFilters() const { return 0; }
|
||||||
virtual uavcan::uint64_t getErrorCount() const { return error_count; }
|
virtual uavcan::uint64_t getErrorCount() const { return error_count; }
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ struct BackgroundSpinner : uavcan::TimerBase
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename MessageType>
|
template <typename CanDriver, typename MessageType>
|
||||||
static inline void emulateSingleFrameBroadcastTransfer(CanDriverMock& can, uavcan::NodeID node_id,
|
static inline void emulateSingleFrameBroadcastTransfer(CanDriver& can, uavcan::NodeID node_id,
|
||||||
const MessageType& message, uavcan::TransferID tid)
|
const MessageType& message, uavcan::TransferID tid)
|
||||||
{
|
{
|
||||||
uavcan::StaticTransferBuffer<100> buffer;
|
uavcan::StaticTransferBuffer<100> buffer;
|
||||||
@@ -126,8 +126,5 @@ static inline void emulateSingleFrameBroadcastTransfer(CanDriverMock& can, uavca
|
|||||||
uavcan::CanFrame can_frame;
|
uavcan::CanFrame can_frame;
|
||||||
ASSERT_TRUE(frame.compile(can_frame));
|
ASSERT_TRUE(frame.compile(can_frame));
|
||||||
|
|
||||||
for (uint8_t i = 0; i < can.getNumIfaces(); i++)
|
can.pushRxToAllIfaces(can_frame);
|
||||||
{
|
|
||||||
can.ifaces.at(i).pushRx(can_frame);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,6 +169,14 @@ public:
|
|||||||
, select_failure(false)
|
, select_failure(false)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
void pushRxToAllIfaces(const uavcan::CanFrame& can_frame)
|
||||||
|
{
|
||||||
|
for (uint8_t i = 0; i < getNumIfaces(); i++)
|
||||||
|
{
|
||||||
|
ifaces.at(i).pushRx(can_frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual uavcan::int16_t select(uavcan::CanSelectMasks& inout_masks, uavcan::MonotonicTime deadline)
|
virtual uavcan::int16_t select(uavcan::CanSelectMasks& inout_masks, uavcan::MonotonicTime deadline)
|
||||||
{
|
{
|
||||||
assert(this);
|
assert(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user