diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2019-06-26 10:34:04 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2019-06-26 17:55:06 +0200 |
commit | d2d2620bbb8f0aad0181e67e9f6affc3d6cb4a51 (patch) | |
tree | 13e7c1069252dbadb2b430414f3722132d1d7013 /low-can-binding/binding/low-can-cb.cpp | |
parent | 82b45e3de8c92816c8080178224c5bd4be60a091 (diff) |
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 <arthur.guyader@iot.bzh>
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/binding/low-can-cb.cpp')
-rw-r--r-- | low-can-binding/binding/low-can-cb.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<low_can_subscription_t> can_subscription, std s.erase(it); } -static void push_n_notify(std::shared_ptr<can_message_t> m) +static void push_n_notify(std::shared_ptr<message_t> m) { can_bus_t& cbm = application_t::instance().get_can_bus_manager(); { std::lock_guard<std::mutex> 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<utils::socketcan_t> s = can_subscription->get_socket(); - std::shared_ptr<can_message_t> message = s->read_message(); + std::shared_ptr<message_t> 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>(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) |