Improve log message.
[apps/agl-service-can-low-level.git] / CAN-binder / low-can-binding / can / can-bus-dev.cpp
index 7155a72..601881d 100644 (file)
@@ -24,9 +24,7 @@
 
 #include "can-bus.hpp"
 #include "can-message.hpp"
-#include "../binding/low-can-binding.hpp"
-#include "canutil/write.h"
-#include "bitfield/bitfield.h"
+#include "../binding/low-can-hat.hpp"
 
 /// @brief Class constructor
 ///
@@ -106,7 +104,7 @@ can_message_t can_bus_dev_t::read()
        // Test that socket is really opened
        if (!can_socket_)
        {
-               ERROR(binder_interface, "read: Socket unavailable. Closing thread.");
+               ERROR(binder_interface, "%s: Socket unavailable. Closing thread.", __FUNCTION__);
                is_running_ = false;
        }
 
@@ -116,8 +114,8 @@ can_message_t can_bus_dev_t::read()
        if (nbytes != CANFD_MTU && nbytes != CAN_MTU)
        {
                if (errno == ENETDOWN)
-                       ERROR(binder_interface, "read: %s CAN device down", device_name_.c_str());
-               ERROR(binder_interface, "read: Incomplete CAN(FD) frame");
+                       ERROR(binder_interface, "%s: %s CAN device down", __FUNCTION__, device_name_.c_str());
+               ERROR(binder_interface, "%s: Incomplete CAN(FD) frame", __FUNCTION__);
                ::memset(&cfd, 0, sizeof(cfd));
        }