From c16ccc9d6a1de5406ba0e74f757403ac7553b6a8 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 4 Jul 2017 14:27:16 +0200 Subject: 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 --- low-can-binding/utils/socketcan-bcm.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'low-can-binding/utils/socketcan-bcm.cpp') diff --git a/low-can-binding/utils/socketcan-bcm.cpp b/low-can-binding/utils/socketcan-bcm.cpp index e16b246f..39b53f56 100644 --- a/low-can-binding/utils/socketcan-bcm.cpp +++ b/low-can-binding/utils/socketcan-bcm.cpp @@ -45,10 +45,10 @@ namespace utils // Attempts to open a socket to CAN bus ::strcpy(ifr.ifr_name, device_name.c_str()); - DEBUG("BCM socket ifr_name is : %s", ifr.ifr_name); + AFB_DEBUG("BCM socket 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 @@ -58,7 +58,7 @@ namespace utils if(connect((struct sockaddr *)&tx_address_, sizeof(tx_address_)) < 0) { - ERROR("Connect failed. %s", strerror(errno)); + AFB_ERROR("Connect failed. %s", strerror(errno)); close(); } // Needed because of using systemD event loop. See sd_event_add_io manual. @@ -84,8 +84,8 @@ namespace utils ioctl(s.socket(), SIOCGIFNAME, &ifr); long unsigned int frame_size = nbytes-sizeof(struct bcm_msg_head); - DEBUG("Data available: %li bytes read. BCM head, opcode: %i, can_id: %i, nframes: %i", frame_size, msg.msg_head.opcode, msg.msg_head.can_id, msg.msg_head.nframes); - DEBUG("read: Found on bus %s:\n id: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", ifr.ifr_name, msg.msg_head.can_id, msg.frames.can_dlc, + AFB_DEBUG("Data available: %li bytes read. BCM head, opcode: %i, can_id: %i, nframes: %i", frame_size, msg.msg_head.opcode, msg.msg_head.can_id, msg.msg_head.nframes); + AFB_DEBUG("read: Found on bus %s:\n id: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", ifr.ifr_name, msg.msg_head.can_id, msg.frames.can_dlc, msg.frames.data[0], msg.frames.data[1], msg.frames.data[2], msg.frames.data[3], msg.frames.data[4], msg.frames.data[5], msg.frames.data[6], msg.frames.data[7]); struct timeval tv; @@ -98,4 +98,4 @@ namespace utils return s; } -} \ No newline at end of file +} -- cgit 1.2.3-korg