mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 02:03:33 +08:00
All unit tests compile, but crash. This is the most horrifying commit I've ever made.
This commit is contained in:
@@ -169,7 +169,7 @@ int DynamicNodeIDClient::start(const protocol::HardwareVersion& hardware_version
|
||||
}
|
||||
dnida_sub_.allowAnonymousTransfers();
|
||||
|
||||
startPeriodic(MonotonicDuration::fromMSec(protocol::dynamic_node_id::Allocation::DEFAULT_REQUEST_PERIOD_MS));
|
||||
startPeriodic(MonotonicDuration::fromMSec(1000 /* TODO FIXME */));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,6 @@ void Dispatcher::handleFrame(const CanRxFrame& can_frame)
|
||||
switch (frame.getTransferType())
|
||||
{
|
||||
case TransferTypeMessageBroadcast:
|
||||
case TransferTypeMessageUnicast:
|
||||
{
|
||||
lmsg_.handleFrame(frame);
|
||||
break;
|
||||
@@ -364,8 +363,7 @@ bool Dispatcher::hasSubscriber(DataTypeID dtid) const
|
||||
|
||||
bool Dispatcher::hasPublisher(DataTypeID dtid) const
|
||||
{
|
||||
return outgoing_transfer_reg_.exists(dtid, TransferTypeMessageBroadcast) ||
|
||||
outgoing_transfer_reg_.exists(dtid, TransferTypeMessageUnicast);
|
||||
return outgoing_transfer_reg_.exists(dtid, TransferTypeMessageBroadcast);
|
||||
}
|
||||
|
||||
bool Dispatcher::hasServer(DataTypeID dtid) const
|
||||
|
||||
@@ -12,7 +12,12 @@ namespace uavcan
|
||||
* TransferPriority
|
||||
*/
|
||||
const uint8_t TransferPriority::BitLen;
|
||||
const uint8_t TransferPriority::NumericallyMax;
|
||||
const uint8_t TransferPriority::NumericallyMin;
|
||||
|
||||
const TransferPriority TransferPriority::Default((1U << BitLen) / 2);
|
||||
const TransferPriority TransferPriority::OneHigherThanLowest(NumericallyMax - 1);
|
||||
const TransferPriority TransferPriority::OneLowerThanHighest(NumericallyMin + 1);
|
||||
|
||||
/**
|
||||
* TransferID
|
||||
|
||||
@@ -65,7 +65,7 @@ MultiFrameIncomingTransfer::MultiFrameIncomingTransfer(MonotonicTime ts_mono, Ut
|
||||
, buf_acc_(tba)
|
||||
{
|
||||
UAVCAN_ASSERT(last_frame.isValid());
|
||||
UAVCAN_ASSERT(last_frame.isLast());
|
||||
UAVCAN_ASSERT(last_frame.isEndOfTransfer());
|
||||
}
|
||||
|
||||
int MultiFrameIncomingTransfer::read(unsigned offset, uint8_t* data, unsigned len) const
|
||||
@@ -202,7 +202,7 @@ void TransferListenerBase::handleFrame(const RxFrame& frame)
|
||||
TransferReceiver* recv = receivers_.access(key);
|
||||
if (recv == NULL)
|
||||
{
|
||||
if (!frame.isFirst())
|
||||
if (!frame.isStartOfTransfer())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -219,8 +219,8 @@ void TransferListenerBase::handleFrame(const RxFrame& frame)
|
||||
handleReception(*recv, frame, tba);
|
||||
}
|
||||
else if (frame.getSrcNodeID().isBroadcast() &&
|
||||
frame.isFirst() &&
|
||||
frame.isLast() &&
|
||||
frame.isStartOfTransfer() &&
|
||||
frame.isEndOfTransfer() &&
|
||||
frame.getDstNodeID().isBroadcast()) // Anonymous transfer
|
||||
{
|
||||
handleAnonymousTransferReception(frame);
|
||||
|
||||
Reference in New Issue
Block a user