2 * Copyright (C) 2015, 2016, 2017 "IoT.bzh"
3 * Author "Romain Forlot" <romain.forlot@iot.bzh>
4 * Author "Loïc Collignon" <loic.collignon@iot.bzh>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
25 #include <linux/can.h>
26 #include <condition_variable>
28 #include "openxc.pb.h"
29 #include "message/can-message.hpp"
30 #include "../utils/config-parser.hpp"
31 #include "../binding/low-can-subscription.hpp"
33 /// @brief A container for a CAN module paried with a certain bus.
35 /// There are three things that control the operating mode of the CAN controller:
37 /// - Should arbitrary CAN message writes be allowed? See rawWritable.
38 /// - Should translated, simple vehicle message writes be allowed? See the
39 /// 'writable' field in signals defined for this bus.
46 std::string device_name;
47 float max_message_frequency; //<! maxMessageFrequency - the default maximum frequency for all CAN messages when
48 /// using the raw passthrough mode. To disable frequency limit, set
50 bool raw_writable; //<! rawWritable - Set to True if the CAN bus connection should allow raw CAN messages
51 /// writes. This is independent from the CanSignal 'writable' option, which
52 /// can also be set to allow translated writes back to this bus.
53 bool passthrough_can_messages; //<! passthroughCanMessages - Set to True if low-level CAN messages should be able to send to the
54 /// output interface, not just signals as simple vehicle messages.
57 int get_index() const;
58 const std::string get_bus_name() const;
59 const std::string get_bus_device_name() const;
60 const float max_message_frequency() const;
61 bool get_raw_writable() const;
62 bool get_passthrough_can_messages() const;