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.
18 #include "application.hpp"
20 #include "../utils/signals.hpp"
21 #include "../utils/openxc-utils.hpp"
22 #include "low-can-socket.hpp"
24 /// @brief Return singleton instance of configuration object.
25 application_t& application_t::instance()
27 static application_t config;
31 can_bus_t& application_t::get_can_bus_manager()
33 return can_bus_manager_;
36 std::map<std::string, std::shared_ptr<low_can_socket_t> >& application_t::get_can_devices()
41 diagnostic_manager_t& application_t::get_diagnostic_manager()
43 return diagnostic_manager_;
46 uint8_t application_t::get_active_message_set() const
48 return active_message_set_;
51 std::vector<std::shared_ptr<can_message_set_t> > application_t::get_can_message_set()
53 return can_message_set_;
56 std::vector<std::shared_ptr<can_signal_t> > application_t::get_all_can_signals()
58 return can_message_set_[active_message_set_]->get_all_can_signals();
61 std::vector<std::shared_ptr<diagnostic_message_t> >& application_t::get_diagnostic_messages()
63 return can_message_set_[active_message_set_]->get_diagnostic_messages();
66 std::vector<std::shared_ptr<can_message_definition_t> >& application_t::get_can_message_definition()
68 return can_message_set_[active_message_set_]->get_can_message_definition();
71 uint32_t application_t::get_signal_id(diagnostic_message_t& sig) const
76 uint32_t application_t::get_signal_id(can_signal_t& sig) const
78 return sig.get_message()->get_id();
81 void application_t::set_active_message_set(uint8_t id)
83 active_message_set_ = id;