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 SignalNoVehicliSpeed = 0,
39 SignalNoAccelPedalPos,
40 SignalNoLightstatusBrake,
44 SignalNoMin = SignalNoVehicliSpeed,
45 SignalNoMax = SignalNum - 1,
48 const std::vector<const char*> kSignalName_{
50 "transmission_gear_position",
52 "parking_brake_status",
53 "accelerator.pedal.position",
58 const char* analyzeCanSignal(struct json_object *object);
60 int getCurrentTransGearState();
61 bool getCurrentHeadlampState();
62 bool getCurrentParkingBrakeState();
63 double getCurrentAccelPedalPosition();
64 bool getCurrentAccelPedalState();
65 bool getCurrentLightstatusBrakeState();
67 bool isChangedAccelPedalState();
70 // Disable copy and move
71 LowCanClient(LowCanClient const &) = delete;
72 LowCanClient &operator=(LowCanClient const &) = delete;
73 LowCanClient(LowCanClient &&) = delete;
74 LowCanClient &operator=(LowCanClient &&) = delete;
76 enum TransGearPosVal {
77 TransGearPosValD1 = 1,
89 const std::vector<const char*> kFilterValue_{
91 "", // transmission_gear_position
92 "", // headlamp_status
93 "", // parking_brake_status
94 "", // accelerator.pedal.position
95 "", // lightstatus.brake
100 json_bool headlamp_status_;
101 json_bool parking_brake_status_;
102 double accel_pedal_pos_;
103 bool accel_pedal_stt_;
104 json_bool lightstatus_brake_status_;
106 bool is_changed_accel_pedal_stt_;
112 #endif // TMCAGLWM_LOW_CAN_CLIENT_HPP