diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-08 15:25:27 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-09 11:43:31 +0200 |
commit | 32fb0e5b1949ef115e92de9457cb4e83854e51f2 (patch) | |
tree | bb9444fb67783eda6a187acf17bcdffcdea4f8ec /CAN-binder/low-can-binding/utils/socketcan-bcm.cpp | |
parent | ce2bd1c557ae2cb44db1794909f129e82286c305 (diff) |
Migration to AFB Binding V2
No more binder interface needed to use logging macros and
others stuff like make_event or any other calls
Change-Id: Iaee60697373bc8a0e67518e924b36b5389533e68
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/utils/socketcan-bcm.cpp')
-rw-r--r-- | CAN-binder/low-can-binding/utils/socketcan-bcm.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/CAN-binder/low-can-binding/utils/socketcan-bcm.cpp b/CAN-binder/low-can-binding/utils/socketcan-bcm.cpp index 5ee4b1aa..e16b246f 100644 --- a/CAN-binder/low-can-binding/utils/socketcan-bcm.cpp +++ b/CAN-binder/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(binder_interface, "%s: BCM socket ifr_name is : %s", __FUNCTION__, ifr.ifr_name); + DEBUG("BCM socket ifr_name is : %s", ifr.ifr_name); if(::ioctl(socket_, SIOCGIFINDEX, &ifr) < 0) { - ERROR(binder_interface, "%s: ioctl failed. Error was : %s", __FUNCTION__, strerror(errno)); + 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(binder_interface, "%s: Connect failed. %s", __FUNCTION__, strerror(errno)); + 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(binder_interface, "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(binder_interface, "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, + 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, 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; |