summaryrefslogtreecommitdiffstats
path: root/low-can-binding/utils
diff options
context:
space:
mode:
Diffstat (limited to 'low-can-binding/utils')
-rw-r--r--low-can-binding/utils/config-parser.cpp6
-rw-r--r--low-can-binding/utils/signals.cpp6
-rw-r--r--low-can-binding/utils/socketcan-bcm.cpp12
-rw-r--r--low-can-binding/utils/socketcan-raw.cpp12
-rw-r--r--low-can-binding/utils/socketcan.hpp2
5 files changed, 19 insertions, 19 deletions
diff --git a/low-can-binding/utils/config-parser.cpp b/low-can-binding/utils/config-parser.cpp
index 8ccf5bcb..e3936eba 100644
--- a/low-can-binding/utils/config-parser.cpp
+++ b/low-can-binding/utils/config-parser.cpp
@@ -39,10 +39,10 @@ namespace utils
{
if (config_content_.size() <= 0)
{
- ERROR("Can't load the INI config file.");
+ AFB_ERROR("Can't load the INI config file.");
return false;
}
- DEBUG("Configuration file parsed");
+ AFB_DEBUG("Configuration file parsed");
return true;
}
@@ -64,4 +64,4 @@ namespace utils
return devices_name;
}
-} \ No newline at end of file
+}
diff --git a/low-can-binding/utils/signals.cpp b/low-can-binding/utils/signals.cpp
index fbc49044..5c08eaaf 100644
--- a/low-can-binding/utils/signals.cpp
+++ b/low-can-binding/utils/signals.cpp
@@ -68,10 +68,10 @@ namespace utils
lookup_signals_by_id(key.numeric_value, application_t::instance().get_diagnostic_messages(), sf.diagnostic_messages);
break;
default:
- ERROR("wrong openxc_DynamicField specified. Use openxc_DynamicField_Type_NUM or openxc_DynamicField_Type_STRING type only.");
+ AFB_ERROR("wrong openxc_DynamicField specified. Use openxc_DynamicField_Type_NUM or openxc_DynamicField_Type_STRING type only.");
break;
}
- DEBUG("Found %d signal(s)", (int)(sf.can_signals.size() + sf.diagnostic_messages.size()));
+ AFB_DEBUG("Found %d signal(s)", (int)(sf.can_signals.size() + sf.diagnostic_messages.size()));
return sf;
}
-} \ No newline at end of file
+}
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
+}
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
+}
diff --git a/low-can-binding/utils/socketcan.hpp b/low-can-binding/utils/socketcan.hpp
index 82b797e0..40e165bd 100644
--- a/low-can-binding/utils/socketcan.hpp
+++ b/low-can-binding/utils/socketcan.hpp
@@ -65,7 +65,7 @@ namespace utils
socketcan_t& operator<<(socketcan_t& s, const T& obj)
{
if (::sendto(s.socket(), &obj, sizeof(obj), 0, (const struct sockaddr*)&s.get_tx_address(), sizeof(s.get_tx_address())) < 0)
- ERROR("Error sending : %i %s", errno, ::strerror(errno));
+ AFB_ERROR("Error sending : %i %s", errno, ::strerror(errno));
return s;
}
}