summaryrefslogtreecommitdiffstats
path: root/low-can-binding/can
diff options
context:
space:
mode:
Diffstat (limited to 'low-can-binding/can')
-rw-r--r--low-can-binding/can/can-bus.cpp8
-rw-r--r--low-can-binding/can/can-bus.hpp1
-rw-r--r--low-can-binding/can/message-definition.cpp4
3 files changed, 13 insertions, 0 deletions
diff --git a/low-can-binding/can/can-bus.cpp b/low-can-binding/can/can-bus.cpp
index 40e080f8..11b7770c 100644
--- a/low-can-binding/can/can-bus.cpp
+++ b/low-can-binding/can/can-bus.cpp
@@ -69,6 +69,14 @@ void can_bus_t::set_can_devices(json_object *mapping)
}
}
+/// @brief Fills the CAN device map member with given values
+///
+/// @param[in] mapping configuration section.
+void can_bus_t::set_can_devices(const std::vector<std::pair<std::string, std::string> >& mapping)
+{
+ can_devices_mapping_ = mapping;
+}
+
/// @brief Take a decoded message to determine if its value complies with the desired
/// filters.
///
diff --git a/low-can-binding/can/can-bus.hpp b/low-can-binding/can/can-bus.hpp
index 5aa7a1d5..88b1dd4e 100644
--- a/low-can-binding/can/can-bus.hpp
+++ b/low-can-binding/can/can-bus.hpp
@@ -70,6 +70,7 @@ public:
~can_bus_t();
void set_can_devices(json_object *mapping);
+ void set_can_devices(const std::vector<std::pair<std::string, std::string> >& mapping);
int get_can_device_index(const std::string& bus_name) const;
const std::string get_can_device_name(const std::string& id_name) const;
diff --git a/low-can-binding/can/message-definition.cpp b/low-can-binding/can/message-definition.cpp
index dab502af..051c2d3c 100644
--- a/low-can-binding/can/message-definition.cpp
+++ b/low-can-binding/can/message-definition.cpp
@@ -56,6 +56,10 @@ message_definition_t::message_definition_t(const std::string bus,
signals_{signals}
{}
+const std::string message_definition_t::get_bus_name() const{
+ return bus_;
+}
+
const std::string message_definition_t::get_bus_device_name() const
{
return application_t::instance().get_can_bus_manager()