diff options
author | 2018-05-17 16:48:33 +0900 | |
---|---|---|
committer | 2018-05-17 16:52:10 +0900 | |
commit | 9f61fdc39edd93c7da5b77b4bc92963e4df31b82 (patch) | |
tree | 4c9648fdef3435581a327ca0a7a11ad8d2e03148 /src/low_can_client.hpp | |
parent | a9f97575b05a5e49ace1f34e608bbb5aabdb8311 (diff) |
App (ResourceManager) class has the current car info
and LowCanClient does not check whether CAN signal value is changed
Change-Id: I41dfd0772f8fb4db70c4b5c0caa35791600abc54
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src/low_can_client.hpp')
-rw-r--r-- | src/low_can_client.hpp | 73 |
1 files changed, 31 insertions, 42 deletions
diff --git a/src/low_can_client.hpp b/src/low_can_client.hpp index 9cd10e2..4bc3747 100644 --- a/src/low_can_client.hpp +++ b/src/low_can_client.hpp @@ -31,16 +31,37 @@ public: explicit LowCanClient(); ~LowCanClient() = default; + enum SignalNo { + SignalNoVehicliSpeed = 0, + SignalNoTransGearPos, + SignalNoHeadlame, + SignalNoParkingBrake, + SignalNoAccelPedalPos, + + SignalNum, + + SignalNoMin = SignalNoVehicliSpeed, + SignalNoMax = SignalNum - 1, + }; + + const std::vector<const char*> kSignalName_{ + "vehicle.speed", + "transmission_gear_position", + "headlamp_status", + "parking_brake_status", + "accelerator.pedal.position", + }; + void initialize(); - void analyzeCanSignal(struct json_object *object); - bool isChangedTransGearState(); - bool isChangedLampState(); - bool isChangedParkingBrakeState(); + const char* analyzeCanSignal(struct json_object *object); + + int getCurrentTransGearState(); + bool getCurrentHeadlampState(); + bool getCurrentParkingBrakeState(); + double getCurrentAccelPedalPosition(); + bool getCurrentAccelPedalState(); + bool isChangedAccelPedalState(); - const char* getCurrentTransGearState(); - const char* getCurrentLampState(); - const char* getCurrentParkingBrakeState(); - const char* getCurrentAccelPedalState(); private: // Disable copy and move @@ -62,27 +83,6 @@ private: TransGearPosValN, }; - enum SignalNo { - SignalNoVehicliSpeed = 0, - SignalNoTransGearPos, - SignalNoHeadlame, - SignalNoParkingBrake, - SignalNoAccelPedalPos, - - SignalNum, - - SignalNoMin = SignalNoVehicliSpeed, - SignalNoMax = SignalNum - 1, - }; - - const std::vector<const char*> kEventName_{ - "vehicle.speed", - "transmission_gear_position", - "headlamp_status", - "parking_brake_status", - "accelerator.pedal.position", - }; - const std::vector<const char*> kFilterValue_{ "", "", @@ -96,20 +96,9 @@ private: json_bool headlamp_status_; json_bool parking_brake_status_; double accel_pedal_pos_; + bool accel_pedal_stt_; - std::string prv_trans_gear_state_; - std::string crr_trans_gear_state_; - std::string prv_lamp_state_; - std::string crr_lamp_state_; - std::string prv_parking_brake_state_; - std::string crr_parking_brake_state_; - std::string prv_accel_pedal_state_; - std::string crr_accel_pedal_state_; - - bool is_changed_trans_gear_state_; - bool is_changed_lamp_state_; - bool is_changed_parking_brake_state_; - bool is_changed_accel_pedal_state_; + bool is_changed_accel_pedal_stt_; }; } // namespace wm |