2 * Copyright (C) 2015, 2016 "IoT.bzh"
3 * Author "Romain Forlot" <romain.forlot@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 #include "application.hpp"
19 #include "../utils/signals.hpp"
20 #include "../utils/openxc-utils.hpp"
21 #include "low-can-socket.hpp"
23 /// @brief Return singleton instance of configuration object.
24 application_t& application_t::instance()
26 static application_t config;
30 can_bus_t& application_t::get_can_bus_manager()
32 return can_bus_manager_;
35 std::map<std::string, std::shared_ptr<low_can_socket_t> >& application_t::get_can_devices()
40 diagnostic_manager_t& application_t::get_diagnostic_manager()
42 return diagnostic_manager_;
45 uint8_t application_t::get_active_message_set() const
47 return active_message_set_;
50 std::vector<std::shared_ptr<can_message_set_t> > application_t::get_can_message_set()
52 return can_message_set_;
55 std::vector<std::shared_ptr<can_signal_t> > application_t::get_all_can_signals()
57 return can_message_set_[active_message_set_]->get_all_can_signals();
60 std::vector<std::shared_ptr<diagnostic_message_t> >& application_t::get_diagnostic_messages()
62 return can_message_set_[active_message_set_]->get_diagnostic_messages();
65 std::vector<std::shared_ptr<can_message_definition_t> >& application_t::get_can_message_definition()
67 return can_message_set_[active_message_set_]->get_can_message_definition();
70 uint32_t application_t::get_signal_id(diagnostic_message_t& sig) const
75 uint32_t application_t::get_signal_id(can_signal_t& sig) const
77 return sig.get_message()->get_id();
80 void application_t::set_active_message_set(uint8_t id)
82 active_message_set_ = id;