From d2d2620bbb8f0aad0181e67e9f6affc3d6cb4a51 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 26 Jun 2019 10:34:04 +0200 Subject: Change can_message_t class usage for new j1939 This commit transforms the class can_message_t as the base class and creates two derived classes: j1939_message_t and can_message_t. Bug-AGL: SPEC-2386 Change-Id: I6d3afd8e4f5abff2cd0ec4e9910bd52a2893de76 Signed-off-by: Arthur Guyader Signed-off-by: Stephane Desneux Signed-off-by: Romain Forlot --- low-can-binding/binding/low-can-cb.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'low-can-binding/binding/low-can-cb.cpp') diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp index 6b869073..9515424a 100644 --- a/low-can-binding/binding/low-can-cb.cpp +++ b/low-can-binding/binding/low-can-cb.cpp @@ -32,7 +32,7 @@ #include "../can/can-encoder.hpp" #include "../can/can-bus.hpp" #include "../can/can-signals.hpp" -#include "../can/can-message.hpp" +#include "../can/message/message.hpp" #include "../utils/signals.hpp" #include "../diagnostic/diagnostic-message.hpp" #include "../utils/openxc-utils.hpp" @@ -70,12 +70,12 @@ void on_no_clients(std::shared_ptr can_subscription, std s.erase(it); } -static void push_n_notify(std::shared_ptr m) +static void push_n_notify(std::shared_ptr m) { can_bus_t& cbm = application_t::instance().get_can_bus_manager(); { std::lock_guard can_message_lock(cbm.get_can_message_mutex()); - cbm.push_new_can_message(*m); + cbm.push_new_can_message(m); } cbm.get_new_can_message_cv().notify_one(); } @@ -88,7 +88,7 @@ int read_message(sd_event_source *event_source, int fd, uint32_t revents, void * if ((revents & EPOLLIN) != 0) { std::shared_ptr s = can_subscription->get_socket(); - std::shared_ptr message = s->read_message(); + std::shared_ptr message = s->read_message(); // Sure we got a valid CAN message ? if (! message->get_id() == 0 && ! message->get_length() == 0) @@ -413,7 +413,7 @@ static int send_frame(struct canfd_frame& cfd, const std::string& bus_name) if( cd.count(bus_name) == 0) {cd[bus_name] = std::make_shared(low_can_subscription_t());} - return cd[bus_name]->tx_send(cfd, bus_name); + return cd[bus_name]->tx_send(*cd[bus_name], cfd, bus_name); } static void write_raw_frame(afb_req_t request, const std::string& bus_name, json_object *json_value) -- cgit 1.2.3-korg