aboutsummaryrefslogtreecommitdiffstats
path: root/CAN-binder/low-can-binding/binding/configuration.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-10 18:39:25 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-10 18:45:56 +0200
commitd253ada94487232ccd33b68a69fd44ff7840fab7 (patch)
tree67f5959138d0ddcad413f9ee692d087200e0b4df /CAN-binder/low-can-binding/binding/configuration.cpp
parent3e2be4237ac6f3e8bcec8b10d295182cefe67330 (diff)
Use a tree instead of separated object lists. WIP
Now we respect JSON description file, which is can_message_set contains can_message_definition which contains can_signals. Diagnostic messages aren't processed for now. Change-Id: I94aaf5eded14dd84395bd4fd749df58dee5f533e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/binding/configuration.cpp')
-rw-r--r--CAN-binder/low-can-binding/binding/configuration.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/CAN-binder/low-can-binding/binding/configuration.cpp b/CAN-binder/low-can-binding/binding/configuration.cpp
index 0c0c9ba8..da9d16b2 100644
--- a/CAN-binder/low-can-binding/binding/configuration.cpp
+++ b/CAN-binder/low-can-binding/binding/configuration.cpp
@@ -52,9 +52,9 @@ const std::vector<can_message_set_t>& configuration_t::get_can_message_set()
return can_message_set_;
}
-std::vector<can_signal_t>& configuration_t::get_can_signals()
+std::vector<std::shared_ptr<can_signal_t> > configuration_t::get_can_signals()
{
- return can_signals_[active_message_set_];
+ return can_message_set_[active_message_set_].get_can_signals();
}
std::vector<diagnostic_message_t>& configuration_t::get_diagnostic_messages()
@@ -62,14 +62,9 @@ std::vector<diagnostic_message_t>& configuration_t::get_diagnostic_messages()
return diagnostic_messages_[active_message_set_];
}
-const std::vector<can_message_definition_t>& configuration_t::get_can_message_definition()
+std::vector<std::shared_ptr<can_message_definition_t> > configuration_t::get_can_message_definition()
{
- return can_message_definition_[active_message_set_];
-}
-
-can_message_definition_t& configuration_t::get_can_message_definition(std::uint8_t message_set_id, std::uint8_t message_id)
-{
- return can_message_definition_[message_set_id][message_id];
+ return can_message_set_[active_message_set_].get_can_message_definition();
}
uint32_t configuration_t::get_signal_id(diagnostic_message_t& sig) const
@@ -79,7 +74,7 @@ uint32_t configuration_t::get_signal_id(diagnostic_message_t& sig) const
uint32_t configuration_t::get_signal_id(can_signal_t& sig) const
{
- return sig.get_message().get_id();
+ return sig.get_message()->get_id();
}
void configuration_t::set_active_message_set(uint8_t id)