summaryrefslogtreecommitdiffstats
path: root/src/can
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-03-09 13:06:56 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-03-16 17:10:40 +0100
commite2411259c39a880338bd2435e994c21268eb3e5c (patch)
tree454c3e49c3d95e2f013ac3e7fe9f555b218988d2 /src/can
parentda7ef40a3eb25f1b74ce5b1ea91b09e29f24a497 (diff)
Add necessary to be able to initialize diagnostic manager shims.
We have to conform to functions signatures from isotp-c to have it working. Change-Id: I429def66f54e53277e87aa99e66292cdb47c1c5f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/can')
-rw-r--r--src/can/can-bus-dev.cpp8
-rw-r--r--src/can/can-bus-dev.hpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/can/can-bus-dev.cpp b/src/can/can-bus-dev.cpp
index 157f7de7..b8dadcf8 100644
--- a/src/can/can-bus-dev.cpp
+++ b/src/can/can-bus-dev.cpp
@@ -168,7 +168,7 @@ void can_bus_dev_t::can_reader(can_bus_t& can_bus)
/// @brief Send a can message from a can_message_t object.
/// @param[in] can_msg the can message object to send
-int can_bus_dev_t::send_can_message(can_message_t& can_msg)
+int can_bus_dev_t::send(can_message_t& can_msg)
{
ssize_t nbytes;
canfd_frame f;
@@ -197,7 +197,7 @@ int can_bus_dev_t::send_can_message(can_message_t& can_msg)
/// @brief Send a can message from a can_message_t object.
/// @param[in] can bus used to send the message
/// @param[in] can_msg the can message object to send
-bool can_bus_dev_t::send_can_message(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size)
+bool can_bus_dev_t::shims_send(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size)
{
ssize_t nbytes;
canfd_frame f;
@@ -206,9 +206,9 @@ bool can_bus_dev_t::send_can_message(const uint32_t arbitration_id, const uint8_
f.len = size;
::memcpy(f.data, data, size);
- if(socket.socket())
+ if(can_socket_.socket())
{
- nbytes = ::sendto(socket.socket(), &f, sizeof(struct canfd_frame), 0,
+ nbytes = ::sendto(can_socket_.socket(), &f, sizeof(struct canfd_frame), 0,
(struct sockaddr*)&txAddress_, sizeof(txAddress_));
if (nbytes == -1)
{
diff --git a/src/can/can-bus-dev.hpp b/src/can/can-bus-dev.hpp
index 744f53fa..e7184ff1 100644
--- a/src/can/can-bus-dev.hpp
+++ b/src/can/can-bus-dev.hpp
@@ -57,6 +57,6 @@ public:
can_message_t read();
- int send_can_message(can_message_t& can_msg);
- static bool send_can_message(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size);
+ int send(can_message_t& can_msg);
+ bool shims_send(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size);
};