From e2af4a871c6a8bcab4733193948833aed9c5ceb8 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Mon, 17 Jul 2017 10:59:10 +0200 Subject: [PATCH] Format Change-Id: I036befbfb38b01d046d35a1364c28e0835dcbd41 Signed-off-by: Romain Forlot --- examples/toyota/configuration-generated.cpp | 20 +++++++------- libs/ini-config/ini-config.cpp | 6 ++-- low-can-binding/binding/application.hpp | 4 +-- low-can-binding/binding/low-can-cb.cpp | 2 +- low-can-binding/binding/low-can-hat.hpp | 2 +- low-can-binding/can/can-message-set.hpp | 2 +- low-can-binding/can/can-signals.cpp | 2 +- low-can-binding/can/can-signals.hpp | 2 +- .../diagnostic/active-diagnostic-request.cpp | 4 +-- .../diagnostic/active-diagnostic-request.hpp | 2 +- low-can-binding/diagnostic/diagnostic-manager.cpp | 12 ++++---- low-can-binding/utils/openxc-utils.cpp | 32 +++++++++++----------- low-can-binding/utils/signals.cpp | 6 ++-- low-can-binding/utils/signals.hpp | 2 +- low-can-binding/utils/socketcan-bcm.cpp | 2 +- low-can-binding/utils/socketcan-raw.cpp | 2 +- low-can-binding/utils/timer.cpp | 10 +++---- 17 files changed, 56 insertions(+), 56 deletions(-) diff --git a/examples/toyota/configuration-generated.cpp b/examples/toyota/configuration-generated.cpp index 4b9dac47..61149c58 100644 --- a/examples/toyota/configuration-generated.cpp +++ b/examples/toyota/configuration-generated.cpp @@ -18,8 +18,8 @@ application_t::application_t() "doors.coffer.open", 88, 1, - 0.00000f, - 0, + 0.00000f, + 0, 0, 0, frequency_clock_t(0.00000f), @@ -38,8 +38,8 @@ application_t::application_t() "doors.driver.open", 78, 1, - 0.00000f, - 0, + 0.00000f, + 0, 0, 0, frequency_clock_t(0.00000f), @@ -58,8 +58,8 @@ application_t::application_t() "doors.passenger.open", 79, 1, - 0.00000f, - 0, + 0.00000f, + 0, 0, 0, frequency_clock_t(0.00000f), @@ -78,8 +78,8 @@ application_t::application_t() "doors.rearleft.open", 86, 1, - 0.00000f, - 0, + 0.00000f, + 0, 0, 0, frequency_clock_t(0.00000f), @@ -98,8 +98,8 @@ application_t::application_t() "doors.rearright.open", 85, 4, - 0.00000f, - 0, + 0.00000f, + 0, 0, 0, frequency_clock_t(0.00000f), diff --git a/libs/ini-config/ini-config.cpp b/libs/ini-config/ini-config.cpp index ef3ab25c..e429b959 100644 --- a/libs/ini-config/ini-config.cpp +++ b/libs/ini-config/ini-config.cpp @@ -17,7 +17,7 @@ #include "ini-config.hpp" -bool starts_with(const std::string& text, const std::string& token) +bool starts_with(const std::string& text, const std::string& token) { if(text.length() < token.length()) return false; return (text.compare(0, token.length(), token) == 0); @@ -62,7 +62,7 @@ ini_config::map ini_config::get_keys(const std::string& section, bool wo_prefix) { map ret; std::string key; - + std::string prefix = section + '/'; for(auto i = config_.begin(); i != config_.end(); @@ -97,4 +97,4 @@ ini_config::line_type ini_config::qualify(std::string& line) } } return line_type::ignore; -} \ No newline at end of file +} diff --git a/low-can-binding/binding/application.hpp b/low-can-binding/binding/application.hpp index fea61a83..e2728060 100644 --- a/low-can-binding/binding/application.hpp +++ b/low-can-binding/binding/application.hpp @@ -33,8 +33,8 @@ /// @brief Class representing a configuration attached to the binding. /// /// It regroups all needed objects instance from other class -/// that will be used along the binding life. It gets a global vision -/// on which signals are implemented for that binding. +/// that will be used along the binding life. It gets a global vision +/// on which signals are implemented for that binding. /// Here, it is only the definition of the class with predefined accessors /// methods used in the binding. /// diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp index be2985fb..a190b2a5 100644 --- a/low-can-binding/binding/low-can-cb.cpp +++ b/low-can-binding/binding/low-can-cb.cpp @@ -182,7 +182,7 @@ static int subscribe_unsubscribe_diagnostic_messages(struct afb_req request, boo auto it = std::find_if(s.begin(), s.end(), [&sig](std::pair > sub){ return (! sub.second->get_diagnostic_message().empty());}); can_subscription = it != s.end() ? - it->second : + it->second : std::make_shared(low_can_subscription_t(event_filter)); // If the requested diagnostic message isn't supported by the car then unsubcribe it // no matter what we want, worse case will be a fail unsubscription but at least we don't diff --git a/low-can-binding/binding/low-can-hat.hpp b/low-can-binding/binding/low-can-hat.hpp index eafb9c69..162a8e59 100644 --- a/low-can-binding/binding/low-can-hat.hpp +++ b/low-can-binding/binding/low-can-hat.hpp @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + #pragma once #include diff --git a/low-can-binding/can/can-message-set.hpp b/low-can-binding/can/can-message-set.hpp index 2a7cb53c..bf53c8c5 100644 --- a/low-can-binding/can/can-message-set.hpp +++ b/low-can-binding/can/can-message-set.hpp @@ -27,7 +27,7 @@ class can_signal_t; class can_message_definition_t; class diagnostic_message_t; -/// @brief A parent wrapper for a particular set of CAN messages and diagnostic messages +/// @brief A parent wrapper for a particular set of CAN messages and diagnostic messages /// (e.g. a vehicle or program). class can_message_set_t { diff --git a/low-can-binding/can/can-signals.cpp b/low-can-binding/can/can-signals.cpp index 45c54cb4..a9645567 100644 --- a/low-can-binding/can/can-signals.cpp +++ b/low-can-binding/can/can-signals.cpp @@ -107,7 +107,7 @@ float can_signal_t::get_offset() const float can_signal_t::get_min_value() const { return min_value_; -} +} float can_signal_t::get_max_value() const { diff --git a/low-can-binding/can/can-signals.hpp b/low-can-binding/can/can-signals.hpp index 1b27622e..ea8c077b 100644 --- a/low-can-binding/can/can-signals.hpp +++ b/low-can-binding/can/can-signals.hpp @@ -56,7 +56,7 @@ typedef openxc_DynamicField (*signal_decoder)(can_signal_t& signal, float value, /// A signal_encoder transforms a number, string or boolean into a raw floating /// point value that fits in the CAN signal. /// -/// @param[in] signal - The CAN signal to encode. +/// @param[in] signal - The CAN signal to encode. /// @param[in] value - The dynamic field to encode. /// @param[out] send - An output parameter. If the encoding failed or the CAN signal should /// not be encoded for some other reason, this will be flipped to false. diff --git a/low-can-binding/diagnostic/active-diagnostic-request.cpp b/low-can-binding/diagnostic/active-diagnostic-request.cpp index 1ccb2e74..71f5980d 100644 --- a/low-can-binding/diagnostic/active-diagnostic-request.cpp +++ b/low-can-binding/diagnostic/active-diagnostic-request.cpp @@ -41,13 +41,13 @@ active_diagnostic_request_t& active_diagnostic_request_t::operator=(const active name_ = adr.name_; decoder_ = adr.decoder_; callback_ = adr.callback_; - recurring_ = adr.recurring_; + recurring_ = adr.recurring_; wait_for_multiple_responses_ = adr.wait_for_multiple_responses_; frequency_clock_ = adr.frequency_clock_; timeout_clock_ = adr.timeout_clock_; socket_ = adr.socket_; } - + return *this; } diff --git a/low-can-binding/diagnostic/active-diagnostic-request.hpp b/low-can-binding/diagnostic/active-diagnostic-request.hpp index ff503d8a..36f9e43c 100644 --- a/low-can-binding/diagnostic/active-diagnostic-request.hpp +++ b/low-can-binding/diagnostic/active-diagnostic-request.hpp @@ -67,7 +67,7 @@ private: DiagnosticRequestHandle* handle_; ///< handle_ - A handle for the request to keep track of it between ///< sending the frames of the request and receiving all frames of the response. std::string name_; ///< name_ - Human readable name, to be used when publishing received responses. - static std::string prefix_; ///< prefix_ - It has to reflect the JSON object which it comes from. It makes easier sorting + static std::string prefix_; ///< prefix_ - It has to reflect the JSON object which it comes from. It makes easier sorting ///< incoming CAN messages. DiagnosticResponseDecoder decoder_; ///< decoder_ - An optional DiagnosticResponseDecoder to parse the payload of responses ///< to this request. If the decoder is NULL, the output will include the raw payload diff --git a/low-can-binding/diagnostic/diagnostic-manager.cpp b/low-can-binding/diagnostic/diagnostic-manager.cpp index 89303f1a..8533503f 100644 --- a/low-can-binding/diagnostic/diagnostic-manager.cpp +++ b/low-can-binding/diagnostic/diagnostic-manager.cpp @@ -41,7 +41,7 @@ diagnostic_manager_t::diagnostic_manager_t() /// to have 1 diagnostic bus which are the first bus declared in the JSON /// description file. Configuration instance will return it. /// -/// this will initialize DiagnosticShims and cancel all active requests +/// this will initialize DiagnosticShims and cancel all active requests /// if there are any. bool diagnostic_manager_t::initialize() { @@ -80,7 +80,7 @@ void diagnostic_manager_t::reset() /// @param[in] data - The data payload for the message. NULL is valid if size is also 0. /// @param[in] size - The size of the data payload, in bytes. /// -/// @return true if the CAN message was sent successfully. +/// @return true if the CAN message was sent successfully. bool diagnostic_manager_t::shims_send(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size) { diagnostic_manager_t& dm = application_t::instance().get_diagnostic_manager(); @@ -185,7 +185,7 @@ void diagnostic_manager_t::cancel_request(active_diagnostic_request_t* entry) } /// @brief Cleanup a specific request if it isn't running and get complete. As it is almost -/// impossible to get that state for a recurring request without waiting for that, you can +/// impossible to get that state for a recurring request without waiting for that, you can /// force the cleaning operation. /// /// @param[in] entry - the request to clean @@ -373,7 +373,7 @@ active_diagnostic_request_t* diagnostic_manager_t::add_recurring_request(Diagnos recurring_requests_.push_back(entry); entry->set_handle(shims_, request); - start_diagnostic_request(&shims_, entry->get_handle()); + start_diagnostic_request(&shims_, entry->get_handle()); } else { @@ -440,7 +440,7 @@ openxc_VehicleMessage diagnostic_manager_t::relay_diagnostic_response(active_dia } /// @brief Will take the CAN message and pass it to the receive functions that will process -/// diagnostic handle for each active diagnostic request then depending on the result we will +/// diagnostic handle for each active diagnostic request then depending on the result we will /// return pass the diagnostic response to decode it. /// /// @param[in] entry - A pointer to an active diagnostic request holding a valid diagnostic handle @@ -494,7 +494,7 @@ openxc_VehicleMessage diagnostic_manager_t::find_and_decode_adr(const can_messag } /// @brief Tell if the CAN message received is a diagnostic response. -/// Request broadcast ID use 0x7DF and assigned ID goes from 0x7E0 to Ox7E7. That allows up to 8 ECU to respond +/// Request broadcast ID use 0x7DF and assigned ID goes from 0x7E0 to Ox7E7. That allows up to 8 ECU to respond /// at the same time. The response is the assigned ID + 0x8, so response ID can goes from 0x7E8 to 0x7EF. /// /// @param[in] cm - CAN message received from the socket. diff --git a/low-can-binding/utils/openxc-utils.cpp b/low-can-binding/utils/openxc-utils.cpp index f39f4184..3b404f09 100644 --- a/low-can-binding/utils/openxc-utils.cpp +++ b/low-can-binding/utils/openxc-utils.cpp @@ -28,7 +28,7 @@ /// and put into the DiagnosticResponse of the VehicleMessage. /// @param[in] parsed_value - raw parsed value of the payload from CAN message /// -/// @return a vehicle message including simple message that will be convert into +/// @return a vehicle message including simple message that will be convert into /// a JSON object before being pushed to the subscribers /// const openxc_VehicleMessage build_VehicleMessage(active_diagnostic_request_t* request, const DiagnosticResponse& response, float parsed_value) @@ -92,13 +92,13 @@ const openxc_VehicleMessage build_VehicleMessage(active_diagnostic_request_t* re /// @param[in] message - simple message to include into openxc_VehicleMessage /// @param[in] timestamp - timestamp from ioctl when reading the socket /// -/// @return a vehicle message including simple message that will be convert into +/// @return a vehicle message including simple message that will be convert into /// a JSON object before being pushed to the subscribers /// const openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& message, uint64_t timestamp) { openxc_VehicleMessage v; - + v.has_type = true, v.type = openxc_VehicleMessage_Type::openxc_VehicleMessage_Type_SIMPLE; v.has_simple_message = true; @@ -114,13 +114,13 @@ const openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& mes /// /// @param[in] message - simple message to include into openxc_VehicleMessage /// -/// @return a vehicle message including simple message that will be convert into +/// @return a vehicle message including simple message that will be convert into /// a JSON object before being pushed to the subscribers /// const openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& message) { openxc_VehicleMessage v; - + v.has_type = true, v.type = openxc_VehicleMessage_Type::openxc_VehicleMessage_Type_SIMPLE; v.has_simple_message = true; @@ -162,7 +162,7 @@ bool is_valid(const openxc_VehicleMessage& v) /// @brief Build an openxc_SimpleMessage associating a name to an openxc_DynamicField /// /// @param[in] name - const string reference name to assign to the created SimpleMessage -/// this will set has_name member to true and assign name to the name member. Maximum size for name is +/// this will set has_name member to true and assign name to the name member. Maximum size for name is /// set to 100 char. /// @param[in] value - const reference with DynamicField to assign to SimpleMessage /// value. @@ -216,12 +216,12 @@ const openxc_DynamicField build_DynamicField(const std::string& value) openxc_DynamicField d; d.has_type = true; d.type = openxc_DynamicField_Type_STRING; - + d.has_string_value = true; d.has_numeric_value = false; d.has_boolean_value = false; ::strncpy(d.string_value, value.c_str(), 100); - + return d; } @@ -239,12 +239,12 @@ const openxc_DynamicField build_DynamicField(double value) openxc_DynamicField d; d.has_type = true; d.type = openxc_DynamicField_Type_NUM; - + d.has_string_value = false; d.has_numeric_value = true; d.has_boolean_value = false; d.numeric_value = value; - + return d; } @@ -260,12 +260,12 @@ const openxc_DynamicField build_DynamicField(bool value) openxc_DynamicField d; d.has_type = true; d.type = openxc_DynamicField_Type_BOOL; - + d.has_string_value = false; d.has_numeric_value = false; d.has_boolean_value = true; d.boolean_value = value; - + return d; } @@ -306,7 +306,7 @@ const openxc_SimpleMessage get_simple_message(const openxc_VehicleMessage& v_msg { if (v_msg.has_simple_message) return v_msg.simple_message; - + openxc_SimpleMessage s_msg = { false, "", false, build_DynamicField(false), false, build_DynamicField(false)}; return s_msg; } @@ -331,10 +331,10 @@ void jsonify_DynamicField(const openxc_DynamicField& field, json_object* value) /// /// @brief Make a JSON object from a SimpleMessage /// -/// @param[in] s_msg - const reference to an openxc_SimpleMessage +/// @param[in] s_msg - const reference to an openxc_SimpleMessage /// struct to convert into a json object. /// @param[out] json - pointer with the DynamicField converted into json object -/// +/// /// @return True if SimpleMessage has been transformed into json object /// and false if not. In such case, a json object is returned { "error": "error msg"} /// @@ -348,4 +348,4 @@ bool jsonify_simple(const openxc_SimpleMessage& s_msg, json_object* json) } json_object_object_add(json, "error", json_object_new_string("openxc_SimpleMessage doesn't have name'")); return false; -} \ No newline at end of file +} diff --git a/low-can-binding/utils/signals.cpp b/low-can-binding/utils/signals.cpp index 5c08eaaf..7011fa5a 100644 --- a/low-can-binding/utils/signals.cpp +++ b/low-can-binding/utils/signals.cpp @@ -37,7 +37,7 @@ namespace utils /// /// @brief return the subscribed_signals map. - /// + /// /// @return Map of subscribed signals. std::map >& signals_manager_t::get_subscribed_signals() { @@ -48,10 +48,10 @@ namespace utils /// @fn std::vector find_signals(const openxc_DynamicField &key) /// @brief return signals name found searching through CAN_signals and OBD2 pid /// - /// @param[in] key : can contain numeric or string value in order to search against + /// @param[in] key : can contain numeric or string value in order to search against /// can signals or obd2 signals name. /// - /// @return Vector of signals name found. + /// @return Vector of signals name found. /// struct signals_found signals_manager_t::find_signals(const openxc_DynamicField &key) { diff --git a/low-can-binding/utils/signals.hpp b/low-can-binding/utils/signals.hpp index c604b87d..ddaf229b 100644 --- a/low-can-binding/utils/signals.hpp +++ b/low-can-binding/utils/signals.hpp @@ -37,7 +37,7 @@ namespace utils std::vector > diagnostic_messages; }; - /// @brief Signal manager singleton hold subscription object with attached afb_event and its mutex + /// @brief Signal manager singleton hold subscription object with attached afb_event and its mutex /// to read and write it safely. /// It can be used to browse CAN signals and Diagnostic messages vectors and find a particular signal to /// subscribe to. diff --git a/low-can-binding/utils/socketcan-bcm.cpp b/low-can-binding/utils/socketcan-bcm.cpp index 39b53f56..750e772d 100644 --- a/low-can-binding/utils/socketcan-bcm.cpp +++ b/low-can-binding/utils/socketcan-bcm.cpp @@ -39,7 +39,7 @@ namespace utils int socketcan_bcm_t::open(std::string device_name) { close(); - + struct ifreq ifr; socket_ = socketcan_t::open(PF_CAN, SOCK_DGRAM, CAN_BCM); diff --git a/low-can-binding/utils/socketcan-raw.cpp b/low-can-binding/utils/socketcan-raw.cpp index 58b443be..ca892e70 100644 --- a/low-can-binding/utils/socketcan-raw.cpp +++ b/low-can-binding/utils/socketcan-raw.cpp @@ -36,7 +36,7 @@ namespace utils int socketcan_raw_t::open(std::string device_name) { close(); - + struct ifreq ifr; socket_ = socketcan_t::open(PF_CAN, SOCK_RAW, CAN_RAW); diff --git a/low-can-binding/utils/timer.cpp b/low-can-binding/utils/timer.cpp index d21b7474..9152a096 100644 --- a/low-can-binding/utils/timer.cpp +++ b/low-can-binding/utils/timer.cpp @@ -16,7 +16,7 @@ */ #include -#include +#include #include #include "timer.hpp" @@ -25,7 +25,7 @@ long long int system_time_us() { struct timespec t_usec; long long int timestamp_usec = 0; - + if(!::clock_gettime(CLOCK_MONOTONIC, &t_usec)) timestamp_usec = (t_usec.tv_nsec / 1000ll) + (t_usec.tv_sec* 1000000ll); return timestamp_usec; @@ -35,7 +35,7 @@ long long int system_time_ms() { struct timespec t_msec; long long int timestamp_msec = 0; - + if(!::clock_gettime(CLOCK_MONOTONIC, &t_msec)) timestamp_msec = (t_msec.tv_nsec / 1000000ll) + (t_msec.tv_sec* 1000ll); return timestamp_msec; @@ -45,7 +45,7 @@ long long int system_time_s() { struct timespec t_sec; long long int timestamp_sec = 0; - + if(!::clock_gettime(CLOCK_MONOTONIC, &t_sec)) timestamp_sec = t_sec.tv_sec; return timestamp_sec; @@ -76,7 +76,7 @@ float frequency_clock_t::frequency_to_period() const return frequency_ == 0 ? 0 : 1 / frequency_; } -/// @brief Return a timeval struct based on the frequency_ member. used to +/// @brief Return a timeval struct based on the frequency_ member. used to /// specified CAN BCM timers. const struct timeval frequency_clock_t::get_timeval_from_period() const { -- 2.16.6