From 1a8757e54b86b44d527f38d2c1b483f43e1a2a8d Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 6 Apr 2015 19:21:01 +0300 Subject: [PATCH] allowRogueTransfers() exposed in Publisher and Subscriber --- libuavcan/include/uavcan/node/generic_publisher.hpp | 9 +++++++++ libuavcan/include/uavcan/node/generic_subscriber.hpp | 9 +++++++++ libuavcan/include/uavcan/node/publisher.hpp | 1 + libuavcan/include/uavcan/node/subscriber.hpp | 1 + 4 files changed, 20 insertions(+) diff --git a/libuavcan/include/uavcan/node/generic_publisher.hpp b/libuavcan/include/uavcan/node/generic_publisher.hpp index aece082ddb..9b2f97bc90 100644 --- a/libuavcan/include/uavcan/node/generic_publisher.hpp +++ b/libuavcan/include/uavcan/node/generic_publisher.hpp @@ -60,6 +60,15 @@ public: MonotonicDuration getTxTimeout() const { return tx_timeout_; } void setTxTimeout(MonotonicDuration tx_timeout); + /** + * 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. + */ + void allowRogueTransfers() + { + sender_->allowRogueTransfers(); + } + INode& getNode() const { return node_; } }; diff --git a/libuavcan/include/uavcan/node/generic_subscriber.hpp b/libuavcan/include/uavcan/node/generic_subscriber.hpp index 3ec6b87f92..a5d81512b8 100644 --- a/libuavcan/include/uavcan/node/generic_subscriber.hpp +++ b/libuavcan/include/uavcan/node/generic_subscriber.hpp @@ -196,6 +196,15 @@ protected: return genericStart(&Dispatcher::registerServiceResponseListener); } + /** + * By default, rogue transfers will be ignored. + * This option allows to enable reception of rogue transfers. + */ + void allowRogueTransfers() + { + forwarder_->allowRogueTransfers(); + } + /** * Terminate the subscription. * Dispatcher core will remove this instance from the subscribers list. diff --git a/libuavcan/include/uavcan/node/publisher.hpp b/libuavcan/include/uavcan/node/publisher.hpp index 6abb3bd533..9c684b29fc 100644 --- a/libuavcan/include/uavcan/node/publisher.hpp +++ b/libuavcan/include/uavcan/node/publisher.hpp @@ -87,6 +87,7 @@ public: */ using BaseType::init; + using BaseType::allowRogueTransfers; using BaseType::getTransferSender; using BaseType::getMinTxTimeout; using BaseType::getMaxTxTimeout; diff --git a/libuavcan/include/uavcan/node/subscriber.hpp b/libuavcan/include/uavcan/node/subscriber.hpp index 1112a6abc0..1bb8b2c934 100644 --- a/libuavcan/include/uavcan/node/subscriber.hpp +++ b/libuavcan/include/uavcan/node/subscriber.hpp @@ -111,6 +111,7 @@ public: return BaseType::startAsMessageListener(); } + using BaseType::allowRogueTransfers; using BaseType::stop; using BaseType::getFailureCount; };