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.
20 #include "can-signals.hpp"
22 #include "../configuration.hpp"
23 #include "../utils/signals.hpp"
24 #include "can-decoder.hpp"
25 #include "../obd2/obd2-signals.hpp"
26 #include "../low-can-binding.hpp"
28 std::string can_signal_t::prefix_ = "messages";
30 can_message_definition_t& can_signal_t::get_message()
35 const std::string& can_signal_t::get_generic_name() const
40 const std::string can_signal_t::get_name() const
42 return prefix_ + "." + generic_name_;
45 const std::string& can_signal_t::get_prefix() const
50 uint8_t can_signal_t::get_bit_position() const
55 uint8_t can_signal_t::get_bit_size() const
60 float can_signal_t::get_factor() const
65 float can_signal_t::get_offset() const
70 float can_signal_t::get_min_value() const
75 float can_signal_t::get_max_value() const
80 frequency_clock_t& can_signal_t::get_frequency()
85 bool can_signal_t::get_send_same() const
90 bool can_signal_t::get_force_send_changed() const
92 return force_send_changed_;
95 std::map<int, std::string> can_signal_t::get_state() const
100 size_t can_signal_t::get_state_count() const
102 return states_.size();
105 bool can_signal_t::get_writable() const
110 SignalDecoder& can_signal_t::get_decoder()
115 SignalEncoder& can_signal_t::get_encoder()
120 bool can_signal_t::get_received() const
124 float can_signal_t::get_last_value() const
129 void can_signal_t::set_prefix(std::string val)
134 void can_signal_t::set_received(bool r)
139 void can_signal_t::set_last_value(float val)