mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 10:23:36 +08:00
Superrefactoring - all time values were replaced with new safer classes from uavcan/time.hpp; generated types were moved away from anonymous namespaces because this makes it impossible to use a type from different compilation units. Some less vital fixes are to follow - see the next few commits
This commit is contained in:
@@ -13,16 +13,18 @@ static int sendOne(uavcan::TransferSender& sender, const std::string& data,
|
||||
uint64_t monotonic_tx_deadline, uint64_t monotonic_blocking_deadline,
|
||||
uavcan::TransferType transfer_type, uavcan::NodeID dst_node_id)
|
||||
{
|
||||
return sender.send(reinterpret_cast<const uint8_t*>(data.c_str()), data.length(), monotonic_tx_deadline,
|
||||
monotonic_blocking_deadline, transfer_type, dst_node_id);
|
||||
return sender.send(reinterpret_cast<const uint8_t*>(data.c_str()), data.length(),
|
||||
uavcan::MonotonicTime::fromUSec(monotonic_tx_deadline),
|
||||
uavcan::MonotonicTime::fromUSec(monotonic_blocking_deadline), transfer_type, dst_node_id);
|
||||
}
|
||||
|
||||
static int sendOne(uavcan::TransferSender& sender, const std::string& data,
|
||||
uint64_t monotonic_tx_deadline, uint64_t monotonic_blocking_deadline,
|
||||
uavcan::TransferType transfer_type, uavcan::NodeID dst_node_id, uavcan::TransferID tid)
|
||||
{
|
||||
return sender.send(reinterpret_cast<const uint8_t*>(data.c_str()), data.length(), monotonic_tx_deadline,
|
||||
monotonic_blocking_deadline, transfer_type, dst_node_id, tid);
|
||||
return sender.send(reinterpret_cast<const uint8_t*>(data.c_str()), data.length(),
|
||||
uavcan::MonotonicTime::fromUSec(monotonic_tx_deadline),
|
||||
uavcan::MonotonicTime::fromUSec(monotonic_blocking_deadline), transfer_type, dst_node_id, tid);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +121,7 @@ TEST(TransferSender, Basic)
|
||||
|
||||
while (true)
|
||||
{
|
||||
const int res = dispatcher_rx.spin(0);
|
||||
const int res = dispatcher_rx.spin(tsMono(0));
|
||||
ASSERT_LE(0, res);
|
||||
clockmock.advance(100);
|
||||
if (res == 0)
|
||||
|
||||
Reference in New Issue
Block a user