Better name for anonymous transfers (automatic renaming)

This commit is contained in:
Pavel Kirienko
2015-04-08 02:40:28 +03:00
parent 042aa60773
commit df2a38c217
13 changed files with 46 additions and 46 deletions
@@ -31,7 +31,7 @@ void DynamicNodeIDAllocationClient::handleTimerEvent(const TimerEvent&)
void DynamicNodeIDAllocationClient::handleDynamicNodeIDAllocation(
const ReceivedDataStructure<protocol::DynamicNodeIDAllocation>& msg)
{
if ((msg.short_unique_id != short_unique_id_) || msg.isRogueTransfer())
if ((msg.short_unique_id != short_unique_id_) || msg.isAnonymousTransfer())
{
return; // Not ours
}
@@ -83,7 +83,7 @@ int DynamicNodeIDAllocationClient::startImpl()
{
return res;
}
dnida_pub_.allowRogueTransfers();
dnida_pub_.allowAnonymousTransfers();
res = dnida_sub_.start(
DynamicNodeIDAllocationCallback(this, &DynamicNodeIDAllocationClient::handleDynamicNodeIDAllocation));
@@ -91,7 +91,7 @@ int DynamicNodeIDAllocationClient::startImpl()
{
return res;
}
dnida_sub_.allowRogueTransfers();
dnida_sub_.allowAnonymousTransfers();
startPeriodic(
MonotonicDuration::fromMSec(protocol::DynamicNodeIDAllocation::ALLOCATEE_MIN_BROADCAST_INTERVAL_SEC * 1000));
@@ -50,7 +50,7 @@ int SingleFrameIncomingTransfer::read(unsigned offset, uint8_t* data, unsigned l
return int(len);
}
bool SingleFrameIncomingTransfer::isRogueTransfer() const
bool SingleFrameIncomingTransfer::isAnonymousTransfer() const
{
return (getTransferType() == TransferTypeMessageBroadcast) && getSrcNodeID().isBroadcast();
}
@@ -177,9 +177,9 @@ void TransferListenerBase::handleReception(TransferReceiver& receiver, const RxF
}
}
void TransferListenerBase::handleRogueTransferReception(const RxFrame& frame)
void TransferListenerBase::handleAnonymousTransferReception(const RxFrame& frame)
{
if (allow_rogue_transfers_)
if (allow_anonymous_transfers_)
{
perf_.addRxTransfer();
SingleFrameIncomingTransfer it(frame);
@@ -221,9 +221,9 @@ void TransferListenerBase::handleFrame(const RxFrame& frame)
else if (frame.getSrcNodeID().isBroadcast() &&
frame.isFirst() &&
frame.isLast() &&
frame.getDstNodeID().isBroadcast()) // Rogue transfer
frame.getDstNodeID().isBroadcast()) // Anonymous transfer
{
handleRogueTransferReception(frame);
handleAnonymousTransferReception(frame);
}
else
{
@@ -30,11 +30,11 @@ int TransferSender::send(const uint8_t* payload, unsigned payload_len, Monotonic
/*
* Checking if we're allowed to send.
* In passive mode we can send only rogue transfers, if they are enabled.
* In passive mode we can send only anonymous transfers, if they are enabled.
*/
if (dispatcher_.isPassiveMode())
{
const bool allow = allow_rogue_transfers_ &&
const bool allow = allow_anonymous_transfers_ &&
(transfer_type == TransferTypeMessageBroadcast) &&
(int(payload_len) <= frame.getMaxPayloadLen());
if (!allow)