Fix: wrong signature due to reference discarding "const".
[apps/agl-service-can-low-level.git] / src / can / can-signals.cpp
1 /*
2  * Copyright (C) 2015, 2016 "IoT.bzh"
3  * Author "Romain Forlot" <romain.forlot@iot.bzh>
4  *
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
8  *
9  *       http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 #include <fnmatch.h>
19
20 #include "can-signals.hpp"
21
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"
27
28 can_message_definition_t& can_signal_t::get_message()
29 {
30         return message_;
31 }
32
33 std::string& can_signal_t::get_generic_name()
34 {
35         return generic_name_;
36 }
37
38 uint8_t can_signal_t::get_bit_position() const
39 {
40         return bit_position_;
41 }
42
43 uint8_t can_signal_t::get_bit_size() const
44 {
45         return bit_size_;
46 }
47
48 float can_signal_t::get_factor() const
49 {
50         return factor_;
51 }
52
53 float can_signal_t::get_offset() const
54 {
55         return offset_;
56 }
57
58 float can_signal_t::get_min_value() const
59 {
60         return min_value_;
61 }       
62
63 float can_signal_t::get_max_value() const
64 {
65         return max_value_;
66 }
67
68 FrequencyClock& can_signal_t::get_frequency()
69 {
70         return frequency_;
71 }
72
73 bool can_signal_t::get_send_same() const
74 {
75         return send_same_;
76 }
77
78 bool can_signal_t::get_force_send_changed() const
79 {
80         return force_send_changed_;
81 }
82
83 std::map<int, std::string> can_signal_t::get_state() const
84 {
85         return states_;
86 }
87
88 size_t can_signal_t::get_state_count() const
89 {
90         return states_.size();
91 }
92
93 bool can_signal_t::get_writable() const
94 {
95         return writable_;
96 }
97
98 SignalDecoder& can_signal_t::get_decoder()
99 {
100         return decoder_;
101 }
102
103 SignalEncoder& can_signal_t::get_encoder()
104 {
105         return encoder_;
106 }
107
108 bool can_signal_t::get_received() const
109 {
110         return received_;
111 }
112 float can_signal_t::get_last_value() const
113 {
114         return last_value_;
115 }
116
117 void can_signal_t::set_received(bool r)
118 {
119         received_ = r;
120 }
121
122 void can_signal_t::set_last_value(float val)
123 {
124         last_value_ = val;
125 }