X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=CAN-binder%2Flow-can-binding%2Fcan%2Fcan-message-set.cpp;h=1e352d9a7111bb42b295a3edd5964bbbdf3824da;hb=fa6d02155e06bee279e017c1c844c2b546bf0d1c;hp=063ca275b530043b1c93c33afae4789e80ae2197;hpb=4068ee30a5e041a8e65634ed65c6bbd51a3687dd;p=apps%2Fagl-service-can-low-level.git diff --git a/CAN-binder/low-can-binding/can/can-message-set.cpp b/CAN-binder/low-can-binding/can/can-message-set.cpp index 063ca275..1e352d9a 100644 --- a/CAN-binder/low-can-binding/can/can-message-set.cpp +++ b/CAN-binder/low-can-binding/can/can-message-set.cpp @@ -18,42 +18,41 @@ #include "can-message-set.hpp" +#include "../can/can-message-definition.hpp" + can_message_set_t::can_message_set_t( uint8_t index, - const std::string& name, - uint8_t can_bus_count, - unsigned short can_message_count, - unsigned short can_signal_count, - unsigned short can_command_count, - unsigned short obd2_signal_count, - std::vector > can_messages_definition) + const std::string name, + const std::vector >& can_messages_definition, + const std::vector >& diagnostic_messages) : index_{index} , name_{name} - , can_bus_count_{can_bus_count} - , can_message_count_{can_message_count} - , can_signal_count_{can_signal_count} - , can_command_count_{can_command_count} - , obd2_signal_count_{obd2_signal_count} - , can_messages_definition_{can_messages_definition} + , can_messages_definition_{std::move(can_messages_definition)} + , diagnostic_messages_{std::move(diagnostic_messages)} { for(auto& cmd : can_messages_definition_) { - cmd->set_parent(std::make_shared(*this)); + cmd->set_parent(this); + } + + for(auto& dm : diagnostic_messages_) + { + dm->set_parent(this); } } /// @brief Return vector holding all message definition handled by this message set. -std::vector > can_message_set_t::get_can_message_definition() +std::vector >& can_message_set_t::get_can_message_definition() { return can_messages_definition_; } -std::vector > can_message_set_t::get_can_signals() const +std::vector > can_message_set_t::get_all_can_signals() const { std::vector > can_signals; for(const auto& cmd: can_messages_definition_) { - std::vector > cmd_signals = cmd->get_can_signals(); + std::vector >& cmd_signals = cmd->get_can_signals(); can_signals.insert( can_signals.end(), cmd_signals.begin(), cmd_signals.end() @@ -61,4 +60,9 @@ std::vector > can_message_set_t::get_can_signals() } return can_signals; +} + +std::vector >& can_message_set_t::get_diagnostic_messages() +{ + return diagnostic_messages_; } \ No newline at end of file