All unit tests compile, but crash. This is the most horrifying commit I've ever made.

This commit is contained in:
Pavel Kirienko
2015-07-01 14:55:24 +03:00
parent feb7600f17
commit 8a2e22046e
42 changed files with 421 additions and 587 deletions
@@ -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;
}
+1 -3
View File
@@ -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
+5
View File
@@ -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);