mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 00:13:34 +08:00
Better name for anonymous transfers (automatic renaming)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user