From 181b4f609491df942a2a263d4b6dac78004e2ce0 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sun, 16 Aug 2015 17:30:03 +0300 Subject: [PATCH] DSDL update --- dsdl | 2 +- .../include/uavcan/protocol/panic_broadcaster.hpp | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dsdl b/dsdl index e116524b58..feca9d0061 160000 --- a/dsdl +++ b/dsdl @@ -1 +1 @@ -Subproject commit e116524b58b650d2a95b5d4256c8e1f9fd9dbba6 +Subproject commit feca9d0061e0345bf391fb77ca244e7e831d98c2 diff --git a/libuavcan/include/uavcan/protocol/panic_broadcaster.hpp b/libuavcan/include/uavcan/protocol/panic_broadcaster.hpp index 685fd13831..28c9b32c1d 100644 --- a/libuavcan/include/uavcan/protocol/panic_broadcaster.hpp +++ b/libuavcan/include/uavcan/protocol/panic_broadcaster.hpp @@ -38,17 +38,17 @@ public: explicit PanicBroadcaster(INode& node) : TimerBase(node) , pub_(node) - { - pub_.setTxTimeout(MonotonicDuration::fromMSec(protocol::Panic::BROADCASTING_PERIOD_MS - 10)); - } + { } /** - * Begin broadcasting at the standard interval (see BROADCASTING_PERIOD_MS). * This method does not block and can't fail. - * @param short_reason Short ASCII string that describes the reason of the panic, 7 characters max. - * If the string exceeds 7 characters, it will be truncated. + * @param short_reason Short ASCII string that describes the reason of the panic, 7 characters max. + * If the string exceeds 7 characters, it will be truncated. + * @param broadcasting_period Broadcasting period. Optional. + * @param priority Transfer priority. Optional. */ void panic(const char* short_reason_description, + MonotonicDuration broadcasting_period = MonotonicDuration::fromMSec(100), const TransferPriority priority = TransferPriority::Default) { msg_.reason_text.clear(); @@ -65,10 +65,11 @@ public: UAVCAN_TRACE("PanicBroadcaster", "Panicking with reason '%s'", getReason().c_str()); + pub_.setTxTimeout(broadcasting_period); pub_.setPriority(priority); publishOnce(); - startPeriodic(MonotonicDuration::fromMSec(protocol::Panic::BROADCASTING_PERIOD_MS)); + startPeriodic(broadcasting_period); } /**