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/can | |
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/can')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-bus.cpp | 10 | ||||
-rw-r--r-- | CAN-binder/low-can-binding/can/can-decoder.cpp | 4 | ||||
-rw-r--r-- | CAN-binder/low-can-binding/can/can-message.cpp | 20 |
3 files changed, 17 insertions, 17 deletions
diff --git a/CAN-binder/low-can-binding/can/can-bus.cpp b/CAN-binder/low-can-binding/can/can-bus.cpp index e481a1bd..1d3fce9b 100644 --- a/CAN-binder/low-can-binding/can/can-bus.cpp +++ b/CAN-binder/low-can-binding/can/can-bus.cpp @@ -91,7 +91,7 @@ void can_bus_t::process_can_signals(const can_message_t& can_message, std::map<i { std::lock_guard<std::mutex> decoded_can_message_lock(decoded_can_message_mutex_); push_new_vehicle_message(subscription_id, vehicle_message); - DEBUG(binder_interface, "%s: %s CAN signals processed.", __FUNCTION__, sig->get_name().c_str()); + DEBUG("%s CAN signals processed.", sig->get_name().c_str()); } } } @@ -116,7 +116,7 @@ void can_bus_t::process_diagnostic_signals(diagnostic_manager_t& manager, const { std::lock_guard<std::mutex> decoded_can_message_lock(decoded_can_message_mutex_); push_new_vehicle_message(subscription_id, vehicle_message); - DEBUG(binder_interface, "%s: %s CAN signals processed.", __FUNCTION__, s[subscription_id]->get_name().c_str()); + DEBUG("%s CAN signals processed.", s[subscription_id]->get_name().c_str()); } } } @@ -249,7 +249,7 @@ const can_message_t can_bus_t::next_can_message() { can_msg = can_message_q_.front(); can_message_q_.pop(); - DEBUG(binder_interface, "%s: Here is the next can message : id %X, length %X, data %02X%02X%02X%02X%02X%02X%02X%02X", __FUNCTION__, can_msg.get_id(), can_msg.get_length(), + DEBUG("Here is the next can message : id %X, length %X, data %02X%02X%02X%02X%02X%02X%02X%02X", can_msg.get_id(), can_msg.get_length(), can_msg.get_data()[0], can_msg.get_data()[1], can_msg.get_data()[2], can_msg.get_data()[3], can_msg.get_data()[4], can_msg.get_data()[5], can_msg.get_data()[6], can_msg.get_data()[7]); return can_msg; } @@ -276,7 +276,7 @@ std::pair<int, openxc_VehicleMessage> can_bus_t::next_vehicle_message() { v_msg = vehicle_message_q_.front(); vehicle_message_q_.pop(); - DEBUG(binder_interface, "%s: next vehicle message poped", __FUNCTION__); + DEBUG("next vehicle message poped"); return v_msg; } @@ -299,7 +299,7 @@ void can_bus_t::set_can_devices() if(can_devices_.empty()) { - ERROR(binder_interface, "%s: No mapping found in config file: '%s'. Check it that it have a CANbus-mapping section.", + ERROR("No mapping found in config file: '%s'. Check it that it have a CANbus-mapping section.", __FUNCTION__, conf_file_.filepath().c_str()); } } diff --git a/CAN-binder/low-can-binding/can/can-decoder.cpp b/CAN-binder/low-can-binding/can/can-decoder.cpp index 3e21397b..61bfe753 100644 --- a/CAN-binder/low-can-binding/can/can-decoder.cpp +++ b/CAN-binder/low-can-binding/can/can-decoder.cpp @@ -132,7 +132,7 @@ openxc_DynamicField decoder_t::stateDecoder(can_signal_t& signal, if(signal_state.size() <= 0) { *send = false; - ERROR(binder_interface, "%s: No state found with index: %d", __FUNCTION__, (int)value); + ERROR("No state found with index: %d", (int)value); } return decoded_value; } @@ -157,7 +157,7 @@ openxc_DynamicField decoder_t::translateSignal(can_signal_t& signal, const can_m const std::vector<std::shared_ptr<can_signal_t> >& signals, bool* send) { float value = decoder_t::parseSignalBitfield(signal, message); - DEBUG(binder_interface, "%s: Decoded message from parseSignalBitfield: %f", __FUNCTION__, value); + DEBUG("Decoded message from parseSignalBitfield: %f", value); // Must call the decoders every time, regardless of if we are going to // decide to send the signal or not. diff --git a/CAN-binder/low-can-binding/can/can-message.cpp b/CAN-binder/low-can-binding/can/can-message.cpp index 10b3232c..057bc71f 100644 --- a/CAN-binder/low-can-binding/can/can-message.cpp +++ b/CAN-binder/low-can-binding/can/can-message.cpp @@ -176,7 +176,7 @@ void can_message_t::set_format(const can_message_format_t new_format) if(new_format == can_message_format_t::STANDARD || new_format == can_message_format_t::EXTENDED || new_format == can_message_format_t::INVALID) format_ = new_format; else - ERROR(binder_interface, "%s: Can set format, wrong format chosen", __FUNCTION__); + ERROR("Can set format, wrong format chosen"); } /// @brief Take a canfd_frame struct to initialize class members @@ -198,15 +198,15 @@ can_message_t can_message_t::convert_from_frame(const struct canfd_frame& frame, switch(nbytes) { case CANFD_MTU: - DEBUG(binder_interface, "%s: Got an CAN FD frame", __FUNCTION__); + DEBUG("Got an CAN FD frame"); maxdlen = CANFD_MAX_DLEN; break; case CAN_MTU: - DEBUG(binder_interface, "%s: Got a legacy CAN frame", __FUNCTION__); + DEBUG("Got a legacy CAN frame"); maxdlen = CAN_MAX_DLEN; break; default: - ERROR(binder_interface, "%s: unsupported CAN frame", __FUNCTION__); + ERROR("unsupported CAN frame"); break; } @@ -260,7 +260,7 @@ can_message_t can_message_t::convert_from_frame(const struct canfd_frame& frame, data.push_back(frame.data[i]); }; - DEBUG(binder_interface, "%s: Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", __FUNCTION__, + DEBUG("Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", id, (uint8_t)format, length, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]); } @@ -285,12 +285,12 @@ can_message_t can_message_t::convert_from_frame(const struct can_frame& frame, s if(nbytes <= CAN_MTU) { - DEBUG(binder_interface, "%s: Got a legacy CAN frame", __FUNCTION__); + DEBUG("Got a legacy CAN frame"); maxdlen = CAN_MAX_DLEN; } else { - ERROR(binder_interface, "%s: unsupported CAN frame", __FUNCTION__); + ERROR("unsupported CAN frame"); } if (frame.can_id & CAN_ERR_FLAG) @@ -339,7 +339,7 @@ can_message_t can_message_t::convert_from_frame(const struct can_frame& frame, s data.push_back(frame.data[i]); }; -// DEBUG(binder_interface, "%s: Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", __FUNCTION__, +// DEBUG("Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X", // id, (uint8_t)format, length, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]); } @@ -362,7 +362,7 @@ struct canfd_frame can_message_t::convert_to_canfd_frame() ::memcpy(frame.data, get_data(), length_); } else - ERROR(binder_interface, "%s: can_message_t not correctly initialized to be sent", __FUNCTION__); + ERROR("can_message_t not correctly initialized to be sent"); return frame; } @@ -383,7 +383,7 @@ struct can_frame can_message_t::convert_to_can_frame() ::memcpy(frame.data, get_data(), length_); } else - ERROR(binder_interface, "%s: can_message_t not correctly initialized to be sent", __FUNCTION__); + ERROR("can_message_t not correctly initialized to be sent"); return frame; } |