aboutsummaryrefslogtreecommitdiffstats
path: root/.gitignore
blob: d718309019872d6c5c4b81d31f784a7fb43ea9ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
amixer
autom4te.cache
config.log
build/*
dist/*
!.gitignore
.dep.inc
CMakeFiles/
CMakeCache.txt
nbproject/private/*
cmake_install.cmake
.vscode
stress-out*
node_modules/
_book/
*.kdev4
nbproject/*
doxygen-output
hlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Copyright (C) 2015, 2016 "IoT.bzh"
 * Author "Romain Forlot" <romain.forlot@iot.bzh>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *	 http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "application.hpp"

#include "../utils/signals.hpp"
#include "../utils/openxc-utils.hpp"
#include "low-can-socket.hpp"

/// @brief Return singleton instance of configuration object.
application_t& application_t::instance()
{
	static application_t config;
	return config;
}

can_bus_t& application_t::get_can_bus_manager()
{
	return can_bus_manager_;
}

std::map<std::string, std::shared_ptr<low_can_socket_t> >& application_t::get_can_devices()
{
	return can_devices_;
}

diagnostic_manager_t& application_t::get_diagnostic_manager()
{
	return diagnostic_manager_;
}

uint8_t application_t::get_active_message_set() const
{
	return active_message_set_;
}

std::vector<std::shared_ptr<can_message_set_t> > application_t::get_can_message_set()
{
	return can_message_set_;
}

std::vector<std::shared_ptr<can_signal_t> > application_t::get_all_can_signals()
{
	return can_message_set_[active_message_set_]->get_all_can_signals();
}

std::vector<std::shared_ptr<diagnostic_message_t> >& application_t::get_diagnostic_messages()
{
	return can_message_set_[active_message_set_]->get_diagnostic_messages();
}

std::vector<std::shared_ptr<can_message_definition_t> >& application_t::get_can_message_definition()
{
	return can_message_set_[active_message_set_]->get_can_message_definition();
}

uint32_t application_t::get_signal_id(diagnostic_message_t& sig) const
{
	return sig.get_pid();
}

uint32_t application_t::get_signal_id(can_signal_t& sig) const
{
	return sig.get_message()->get_id();
}

void application_t::set_active_message_set(uint8_t id)
{
	active_message_set_ = id;
}