Small fixes (include and pointer) 11/21411/10
authorRomain Forlot <romain.forlot@iot.bzh>
Tue, 25 Jun 2019 14:24:39 +0000 (16:24 +0200)
committerRomain Forlot <romain.forlot@iot.bzh>
Wed, 26 Jun 2019 16:06:54 +0000 (18:06 +0200)
Bug-AGL: SPEC-2386

Change-Id: I3a622b9d236283aff479f187451cd86557a9aba7
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>
low-can-binding/binding/low-can-cb.cpp
low-can-binding/binding/low-can-subscription.cpp
low-can-binding/binding/low-can-subscription.hpp

index ab6210b..b6a18eb 100644 (file)
@@ -478,7 +478,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(*cd[bus_name], cfd, bus_name);
+       return low_can_subscription_t::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)
index eb3f6c3..54cd314 100644 (file)
@@ -54,7 +54,8 @@ low_can_subscription_t& low_can_subscription_t::operator=(const low_can_subscrip
 
 low_can_subscription_t::~low_can_subscription_t()
 {
-       socket_->close();
+       if(socket_)
+               socket_->close();
 }
 
 low_can_subscription_t::operator bool() const
index 691eb88..61c354d 100644 (file)
@@ -23,7 +23,8 @@
 
 #include "../can/signals.hpp"
 #include "../diagnostic/diagnostic-message.hpp"
-#include "../utils/socketcan-bcm.hpp"
+#include "../utils/socketcan.hpp"
+
 
 #define OBDII_MAX_SIMULTANEOUS_RESPONSES 8