From 2d7e20b88510bce0532a36dfdd3d191b130297fd Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 16 Mar 2015 23:43:42 +0300 Subject: [PATCH] Improved doc for PanicBroadcaster --- libuavcan/include/uavcan/protocol/panic_broadcaster.hpp | 6 ++++-- libuavcan/src/protocol/uc_panic_broadcaster.cpp | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libuavcan/include/uavcan/protocol/panic_broadcaster.hpp b/libuavcan/include/uavcan/protocol/panic_broadcaster.hpp index 2976933919..c05a55fe2e 100644 --- a/libuavcan/include/uavcan/protocol/panic_broadcaster.hpp +++ b/libuavcan/include/uavcan/protocol/panic_broadcaster.hpp @@ -32,10 +32,12 @@ public: } /** - * Begin broadcasting at the standard interval. + * Begin broadcasting at the standard interval (see BROADCASTING_INTERVAL_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. */ - void panic(const char* short_reason); + void panic(const char* short_reason_description); /** * Stop broadcasting immediately. diff --git a/libuavcan/src/protocol/uc_panic_broadcaster.cpp b/libuavcan/src/protocol/uc_panic_broadcaster.cpp index 059e288320..8c73929586 100644 --- a/libuavcan/src/protocol/uc_panic_broadcaster.cpp +++ b/libuavcan/src/protocol/uc_panic_broadcaster.cpp @@ -22,10 +22,10 @@ void PanicBroadcaster::handleTimerEvent(const TimerEvent&) publishOnce(); } -void PanicBroadcaster::panic(const char* short_reason) +void PanicBroadcaster::panic(const char* short_reason_description) { msg_.reason_text.clear(); - const char* p = short_reason; + const char* p = short_reason_description; while (p && *p) { if (msg_.reason_text.size() == msg_.reason_text.capacity())