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
22 #include <json-c/json.h>
31 explicit LowCanClient();
32 ~LowCanClient() = default;
36 SignalNoVehicliSpeed = 0,
40 SignalNoAccelPedalPos,
41 SignalNoLightstatusBrake,
45 SignalNoMin = SignalNoVehicliSpeed,
46 SignalNoMax = SignalNum - 1,
49 const std::vector<const char *> kSignalName{
51 "transmission_gear_position",
53 "parking_brake_status",
54 "accelerator.pedal.position",
59 const char *analyzeCanSignal(struct json_object *object);
61 int getCurrentTransGearState();
62 bool getCurrentHeadlampState();
63 bool getCurrentParkingBrakeState();
64 double getCurrentAccelPedalPosition();
65 bool getCurrentAccelPedalState();
66 bool getCurrentLightstatusBrakeState();
68 bool isChangedAccelPedalState();
71 // Disable copy and move
72 LowCanClient(LowCanClient const &) = delete;
73 LowCanClient &operator=(LowCanClient const &) = delete;
74 LowCanClient(LowCanClient &&) = delete;
75 LowCanClient &operator=(LowCanClient &&) = delete;
79 TransGearPosValD1 = 1,
91 const std::vector<const char *> kFilterValue{
93 "", // transmission_gear_position
94 "", // headlamp_status
95 "", // parking_brake_status
96 "", // accelerator.pedal.position
97 "", // lightstatus.brake
102 json_bool headlamp_status;
103 json_bool parking_brake_status;
104 double accel_pedal_pos;
105 bool accel_pedal_stt;
106 json_bool lightstatus_brake_status;
108 bool is_changed_accel_pedal_stt;
113 #endif // TMCAGLWM_LOW_CAN_CLIENT_HPP