summaryrefslogtreecommitdiffstats
path: root/low-can-binding/utils/socketcan-raw.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-04 14:27:16 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-07-04 14:27:16 +0200
commitc16ccc9d6a1de5406ba0e74f757403ac7553b6a8 (patch)
tree16df16f5cf53367e21aa865426ded8e9fd78a0f3 /low-can-binding/utils/socketcan-raw.cpp
parent621f55e3e4b104d5771a38aae4db5439fe9a5aa8 (diff)
DAB RC3 Fixes follows appfw API break.
Following functions now return 0 on success and negative value on failure : o afb_req_subcall o afb_req_subcall_sync o afb_service_call o afb_service_call_sync Verbosity macros used in v2 bindings now needs to be prefixed with AFB_ (ERROR -> AFB_ERROR) Change-Id: Ica4346f215bb142fcda0c6ea15e7074f7091f4cc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/utils/socketcan-raw.cpp')
-rw-r--r--low-can-binding/utils/socketcan-raw.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/low-can-binding/utils/socketcan-raw.cpp b/low-can-binding/utils/socketcan-raw.cpp
index 31965c3d..58b443be 100644
--- a/low-can-binding/utils/socketcan-raw.cpp
+++ b/low-can-binding/utils/socketcan-raw.cpp
@@ -42,10 +42,10 @@ namespace utils
// Attempts to open a socket to CAN bus
::strcpy(ifr.ifr_name, device_name.c_str());
- DEBUG("ifr_name is : %s", ifr.ifr_name);
+ AFB_DEBUG("ifr_name is : %s", ifr.ifr_name);
if(::ioctl(socket_, SIOCGIFINDEX, &ifr) < 0)
{
- ERROR("ioctl failed. Error was : %s", strerror(errno));
+ AFB_ERROR("ioctl failed. Error was : %s", strerror(errno));
close();
}
else
@@ -55,7 +55,7 @@ namespace utils
if(bind((struct sockaddr *)&tx_address_, sizeof(tx_address_)) < 0)
{
- ERROR("Bind failed. %s", strerror(errno));
+ AFB_ERROR("Bind failed. %s", strerror(errno));
close();
}
}
@@ -74,8 +74,8 @@ namespace utils
ifr.ifr_ifindex = addr.can_ifindex;
ioctl(s.socket(), SIOCGIFNAME, &ifr);
- DEBUG("Data available: %i bytes read", (int)nbytes);
- DEBUG("read: Found on bus %s:\n id: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", ifr.ifr_name, frame.can_id, frame.len,
+ AFB_DEBUG("Data available: %i bytes read", (int)nbytes);
+ AFB_DEBUG("read: Found on bus %s:\n id: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", ifr.ifr_name, frame.can_id, frame.len,
frame.data[0], frame.data[1], frame.data[2], frame.data[3], frame.data[4], frame.data[5], frame.data[6], frame.data[7]);
struct timeval tv;
@@ -85,4 +85,4 @@ namespace utils
return s;
}
-} \ No newline at end of file
+}