aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding/low-can-subscription.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-08-09 16:10:41 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-08-09 16:10:41 +0200
commit3bc37571d22cc6cbf9c35fc26c0aff5aea887d82 (patch)
treea64218dcb45112546f5263a088e8517de228813a /low-can-binding/binding/low-can-subscription.cpp
parent85099f34f7c15f041c84b541cb121be5ab7c61a2 (diff)
Improve debugging diag and empty event
Change-Id: I64dd5b3f241a9696dc759dffff884772e3f72fd7 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/binding/low-can-subscription.cpp')
-rw-r--r--low-can-binding/binding/low-can-subscription.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/low-can-binding/binding/low-can-subscription.cpp b/low-can-binding/binding/low-can-subscription.cpp
index 5488cc5..d94a77b 100644
--- a/low-can-binding/binding/low-can-subscription.cpp
+++ b/low-can-binding/binding/low-can-subscription.cpp
@@ -108,22 +108,26 @@ const std::shared_ptr<diagnostic_message_t> low_can_subscription_t::get_diagnost
/// @brief Return the CAN signal name and empty string if not found
/// or no CAN signal subscribed
-const std::string low_can_subscription_t::get_name() const
+const std::string low_can_socket_t::get_name() const
{
if (can_signal_ != nullptr)
return can_signal_->get_name();
+ else if (!diagnostic_message_.empty())
+ return "diagnostic_messages";
+ AFB_WARNING("No diagnostics messages nor CAN signals registered in that subscription. Name empty ! It's a bug to be reported.");
return "";
}
/// @brief Return name from a diagnostic message from a PID
///
/// @param[in] pid - Diagnostic message PID
-const std::string low_can_subscription_t::get_name(uint32_t pid) const
+const std::string low_can_socket_t::get_name(uint32_t pid) const
{
if (!diagnostic_message_.empty())
return get_diagnostic_message(pid)->get_name() ;
+ AFB_WARNING("No diagnostics messages nor CAN signals registered in that subscription. Name empty ! It's a bug to be reported.");
return "";
}
@@ -303,4 +307,4 @@ int low_can_subscription_t::create_rx_filter(utils::simple_bcm_msg& bcm_msg)
}
return 0;
-} \ No newline at end of file
+}