mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 00:33:33 +08:00
Better name for anonymous transfers (automatic renaming)
This commit is contained in:
@@ -62,11 +62,11 @@ public:
|
||||
|
||||
/**
|
||||
* By default, attempt to send a transfer from passive mode will result in an error @ref ErrPassive.
|
||||
* This option allows to enable sending rogue transfers from passive mode.
|
||||
* This option allows to enable sending anonymous transfers from passive mode.
|
||||
*/
|
||||
void allowRogueTransfers()
|
||||
void allowAnonymousTransfers()
|
||||
{
|
||||
sender_->allowRogueTransfers();
|
||||
sender_->allowAnonymousTransfers();
|
||||
}
|
||||
|
||||
INode& getNode() const { return node_; }
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
TransferID getTransferID() const { return safeget<TransferID, &IncomingTransfer::getTransferID>(); }
|
||||
NodeID getSrcNodeID() const { return safeget<NodeID, &IncomingTransfer::getSrcNodeID>(); }
|
||||
uint8_t getIfaceIndex() const { return safeget<uint8_t, &IncomingTransfer::getIfaceIndex>(); }
|
||||
bool isRogueTransfer() const { return safeget<bool, &IncomingTransfer::isRogueTransfer>(); }
|
||||
bool isAnonymousTransfer() const { return safeget<bool, &IncomingTransfer::isAnonymousTransfer>(); }
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -198,12 +198,12 @@ protected:
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, rogue transfers will be ignored.
|
||||
* This option allows to enable reception of rogue transfers.
|
||||
* By default, anonymous transfers will be ignored.
|
||||
* This option allows to enable reception of anonymous transfers.
|
||||
*/
|
||||
void allowRogueTransfers()
|
||||
void allowAnonymousTransfers()
|
||||
{
|
||||
forwarder_->allowRogueTransfers();
|
||||
forwarder_->allowAnonymousTransfers();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
*/
|
||||
using BaseType::init;
|
||||
|
||||
using BaseType::allowRogueTransfers;
|
||||
using BaseType::allowAnonymousTransfers;
|
||||
using BaseType::getTransferSender;
|
||||
using BaseType::getMinTxTimeout;
|
||||
using BaseType::getMaxTxTimeout;
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
return BaseType::startAsMessageListener();
|
||||
}
|
||||
|
||||
using BaseType::allowRogueTransfers;
|
||||
using BaseType::allowAnonymousTransfers;
|
||||
using BaseType::stop;
|
||||
using BaseType::getFailureCount;
|
||||
};
|
||||
|
||||
@@ -51,9 +51,9 @@ public:
|
||||
virtual void release() { }
|
||||
|
||||
/**
|
||||
* Whether this is a rogue transfer
|
||||
* Whether this is a anonymous transfer
|
||||
*/
|
||||
virtual bool isRogueTransfer() const { return false; }
|
||||
virtual bool isAnonymousTransfer() const { return false; }
|
||||
|
||||
MonotonicTime getMonotonicTimestamp() const { return ts_mono_; }
|
||||
UtcTime getUtcTimestamp() const { return ts_utc_; }
|
||||
@@ -73,7 +73,7 @@ class UAVCAN_EXPORT SingleFrameIncomingTransfer : public IncomingTransfer
|
||||
public:
|
||||
explicit SingleFrameIncomingTransfer(const RxFrame& frm);
|
||||
virtual int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
virtual bool isRogueTransfer() const;
|
||||
virtual bool isAnonymousTransfer() const;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ class UAVCAN_EXPORT TransferListenerBase : public LinkedListNode<TransferListene
|
||||
MapBase<TransferBufferManagerKey, TransferReceiver>& receivers_;
|
||||
ITransferBufferManager& bufmgr_;
|
||||
TransferPerfCounter& perf_;
|
||||
bool allow_rogue_transfers_;
|
||||
bool allow_anonymous_transfers_;
|
||||
|
||||
class TimedOutReceiverPredicate
|
||||
{
|
||||
@@ -126,13 +126,13 @@ protected:
|
||||
, receivers_(receivers)
|
||||
, bufmgr_(bufmgr)
|
||||
, perf_(perf)
|
||||
, allow_rogue_transfers_(false)
|
||||
, allow_anonymous_transfers_(false)
|
||||
{ }
|
||||
|
||||
virtual ~TransferListenerBase() { }
|
||||
|
||||
void handleReception(TransferReceiver& receiver, const RxFrame& frame, TransferBufferAccessor& tba);
|
||||
void handleRogueTransferReception(const RxFrame& frame);
|
||||
void handleAnonymousTransferReception(const RxFrame& frame);
|
||||
|
||||
virtual void handleIncomingTransfer(IncomingTransfer& transfer) = 0;
|
||||
|
||||
@@ -140,10 +140,10 @@ public:
|
||||
const DataTypeDescriptor& getDataTypeDescriptor() const { return data_type_; }
|
||||
|
||||
/**
|
||||
* By default, rogue transfers will be ignored.
|
||||
* This option allows to enable reception of rogue transfers.
|
||||
* By default, anonymous transfers will be ignored.
|
||||
* This option allows to enable reception of anonymous transfers.
|
||||
*/
|
||||
void allowRogueTransfers() { allow_rogue_transfers_ = true; }
|
||||
void allowAnonymousTransfers() { allow_anonymous_transfers_ = true; }
|
||||
|
||||
void cleanup(MonotonicTime ts);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class UAVCAN_EXPORT TransferSender
|
||||
const TransferCRC crc_base_;
|
||||
CanIOFlags flags_;
|
||||
uint8_t iface_mask_;
|
||||
bool allow_rogue_transfers_;
|
||||
bool allow_anonymous_transfers_;
|
||||
|
||||
Dispatcher& dispatcher_;
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
, crc_base_(data_type.getSignature().toTransferCRC())
|
||||
, flags_(CanIOFlags(0))
|
||||
, iface_mask_(AllIfacesMask)
|
||||
, allow_rogue_transfers_(false)
|
||||
, allow_anonymous_transfers_(false)
|
||||
, dispatcher_(dispatcher)
|
||||
{ }
|
||||
|
||||
@@ -62,13 +62,13 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Rogue transfers (i.e. transfers that don't carry a valid Source Node ID) can be sent if
|
||||
* Anonymous transfers (i.e. transfers that don't carry a valid Source Node ID) can be sent if
|
||||
* the local node is configured in passive mode (i.e. the node doesn't have a valid Node ID).
|
||||
* By default, this class will return an error if it is asked to send a transfer while the
|
||||
* node is configured in passive mode. However, if this option is enabled, it will be possible
|
||||
* to send rogue transfers from passive mode.
|
||||
* to send anonymous transfers from passive mode.
|
||||
*/
|
||||
void allowRogueTransfers() { allow_rogue_transfers_ = true; }
|
||||
void allowAnonymousTransfers() { allow_anonymous_transfers_ = true; }
|
||||
|
||||
/**
|
||||
* Send with explicit Transfer ID.
|
||||
|
||||
Reference in New Issue
Block a user