2 * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef TMCAGLWM_LOW_CAN_CLIENT_HPP
18 #define TMCAGLWM_LOW_CAN_CLIENT_HPP
23 #include <json-c/json.h>
31 explicit LowCanClient();
32 ~LowCanClient() = default;
35 void analyzeCanSignal(struct json_object *object);
36 bool isChangedParkingBrakeState();
37 bool isChangedCarState();
38 bool isChangedLampState();
39 const char* getCurrentParkingBrakeState();
40 const char* getCurrentCarState();
41 const char* getCurrentLampState();
44 // Disable copy and move
45 LowCanClient(LowCanClient const &) = delete;
46 LowCanClient &operator=(LowCanClient const &) = delete;
47 LowCanClient(LowCanClient &&) = delete;
48 LowCanClient &operator=(LowCanClient &&) = delete;
50 const int kNumEvent_ = 4;
51 const std::vector<const char*> kEventName_{
53 "transmission_gear_position",
55 "parking_brake_status"
60 json_bool parking_brake_status_;
61 json_bool headlamp_status_;
63 std::string prv_parking_brake_state_;
64 std::string crr_parking_brake_state_;
65 std::string prv_car_state_;
66 std::string crr_car_state_;
67 std::string prv_lamp_state_;
68 std::string crr_lamp_state_;
70 bool is_changed_parking_brake_state_;
71 bool is_changed_car_state_;
72 bool is_changed_lamp_state_;
78 #endif // TMCAGLWM_LOW_CAN_CLIENT_HPP