aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-06-01 10:32:48 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-06-01 18:40:13 +0200
commit81540dbc7d6b2d83c3f3b32ed81e92b086eebfd2 (patch)
tree8e9380d5f995e4f43fea5f8dea0cb0d963879549
parent80740ea1082b3034fa5003b812e063063a873d7c (diff)
Fix: segfault subscribing diagnostic messages
Wrong object used when subscribing. Change-Id: I356c8cedc57191268ce3ea1838999fbe03472ae2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--CAN-binder/low-can-binding/binding/low-can-cb.cpp10
-rw-r--r--CAN-binder/low-can-binding/binding/low-can-cb.hpp4
2 files changed, 7 insertions, 7 deletions
diff --git a/CAN-binder/low-can-binding/binding/low-can-cb.cpp b/CAN-binder/low-can-binding/binding/low-can-cb.cpp
index 297c377..5f24546 100644
--- a/CAN-binder/low-can-binding/binding/low-can-cb.cpp
+++ b/CAN-binder/low-can-binding/binding/low-can-cb.cpp
@@ -59,8 +59,8 @@ low_can_subscription_t::low_can_subscription_t(struct event_filter_t event_filte
: event_filter_{event_filter}
{}
-low_can_subscription_t::low_can_subscription_t(struct event_filter_t event_filter, std::shared_ptr<active_diagnostic_request_t> active_diagnostic_request)
- : active_diagnostic_request_{active_diagnostic_request}, event_filter_{event_filter}
+low_can_subscription_t::low_can_subscription_t(struct event_filter_t event_filter, std::shared_ptr<diagnostic_message_t> diagnostic_message)
+ : diagnostic_message_{diagnostic_message}, event_filter_{event_filter}
{}
low_can_subscription_t::low_can_subscription_t( low_can_subscription_t&& s)
@@ -94,8 +94,8 @@ const std::string low_can_subscription_t::get_name() const
{
if (can_signal_ != nullptr)
return can_signal_->get_name();
- if (active_diagnostic_request_ != nullptr)
- return active_diagnostic_request_->get_name() ;
+ if (diagnostic_message_ != nullptr)
+ return diagnostic_message_->get_name() ;
return "";
}
@@ -360,7 +360,7 @@ int subscribe_unsubscribe_diagnostic_messages(struct afb_req request, bool subsc
return -1;
}
- std::shared_ptr<low_can_subscription_t> can_subscription(new low_can_subscription_t(event_filter, std::shared_ptr<active_diagnostic_request_t>(adr)));
+ std::shared_ptr<low_can_subscription_t> can_subscription(new low_can_subscription_t(event_filter, sig));
int ret = subscribe_unsubscribe_signal(request, subscribe, can_subscription);
if(ret < 0)
return ret;
diff --git a/CAN-binder/low-can-binding/binding/low-can-cb.hpp b/CAN-binder/low-can-binding/binding/low-can-cb.hpp
index b74fdb2..0f276fb 100644
--- a/CAN-binder/low-can-binding/binding/low-can-cb.hpp
+++ b/CAN-binder/low-can-binding/binding/low-can-cb.hpp
@@ -40,7 +40,7 @@ private:
/// Signal part
std::shared_ptr<can_signal_t> can_signal_;
- std::shared_ptr<active_diagnostic_request_t> active_diagnostic_request_;
+ std::shared_ptr<diagnostic_message_t> diagnostic_message_;
/// Filtering part
struct event_filter_t event_filter_;
@@ -49,7 +49,7 @@ private:
public:
low_can_subscription_t();
low_can_subscription_t(struct event_filter_t event_filter);
- low_can_subscription_t(struct event_filter_t event_filter, std::shared_ptr<active_diagnostic_request_t> active_diagnostic_request);
+ low_can_subscription_t(struct event_filter_t event_filter, std::shared_ptr<diagnostic_message_t> diagnostic_message);
low_can_subscription_t(const low_can_subscription_t& s) = delete;
low_can_subscription_t(low_can_subscription_t&& s);