aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-14 17:22:57 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-05-14 17:24:48 +0900
commitbfadb522b21256fde7283746b90116c237e57a5b (patch)
tree099baa7b078029a19430372bace46dee64958be6 /src
parent701f1ff00b3b6cf5f5a50b4cf3f65e176cb26460 (diff)
PolicyManager can judge the current car state
and remove judgement process of it from LowCanClient because it should be judged by PolicyManager Change-Id: I94467332665e34b751604cafe5d43f3abd4d7cfd Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/low_can_client.cpp40
-rw-r--r--src/low_can_client.hpp5
-rw-r--r--src/main.cpp16
-rw-r--r--src/policy_manager/zipc/dummy_stm.c23
-rw-r--r--src/policy_manager/zipc/dummy_stm.h10
5 files changed, 5 insertions, 89 deletions
diff --git a/src/low_can_client.cpp b/src/low_can_client.cpp
index a42e641..025418a 100644
--- a/src/low_can_client.cpp
+++ b/src/low_can_client.cpp
@@ -38,12 +38,9 @@ LowCanClient::LowCanClient() :
crr_parking_brake_state_("parking_brake_on"),
prv_accel_pedal_state_("accel_pedal_off"),
crr_accel_pedal_state_("accel_pedal_off"),
- prv_car_state_("car_stop"),
- crr_car_state_("car_stop"),
is_changed_lamp_state_(false),
is_changed_parking_brake_state_(false),
- is_changed_accel_pedal_state_(false),
- is_changed_car_state_(false)
+ is_changed_accel_pedal_state_(false)
{
HMI_DEBUG("wm:lcc", "Call");
}
@@ -170,15 +167,6 @@ void LowCanClient::analyzeCanSignal(struct json_object *object) {
}
HMI_DEBUG("wm:lcc", "Current accelerator pedal state:%s", this->crr_accel_pedal_state_.c_str());
- // Update car state
- if ((0 == this->vehicle_speed_) || (true == this->parking_brake_status_)) {
- this->crr_car_state_ = "car_stop";
- }
- else {
- this->crr_car_state_ = "car_run";
- }
- HMI_DEBUG("wm:lcc", "Current car state:%s", this->crr_car_state_.c_str());
-
// If lamp state is changed,
// backup current state for previous state and set flag
if (this->prv_lamp_state_ != this->crr_lamp_state_) {
@@ -205,15 +193,6 @@ void LowCanClient::analyzeCanSignal(struct json_object *object) {
this->prv_accel_pedal_state_ = this->crr_accel_pedal_state_;
this->is_changed_accel_pedal_state_ = true;
}
-
- // If car state is changed,
- // backup current state for previous state and set flag
- if (this->prv_car_state_ != this->crr_car_state_) {
- HMI_DEBUG("wm:lcc", "Car state is changed: %s -> %s",
- this->prv_car_state_.c_str(), this->crr_car_state_.c_str());
- this->prv_car_state_ = this->crr_car_state_;
- this->is_changed_car_state_ = true;
- }
}
bool LowCanClient::isChangedLampState() {
@@ -237,13 +216,6 @@ bool LowCanClient::isChangedAccelPedalState() {
return this->is_changed_accel_pedal_state_;
}
-bool LowCanClient::isChangedCarState() {
- HMI_DEBUG("wm:lcc", "Call");
-
- // Return changed flag
- return this->is_changed_car_state_;
-}
-
const char* LowCanClient::getCurrentLampState() {
HMI_DEBUG("wm:lcc", "Call");
@@ -274,15 +246,5 @@ const char* LowCanClient::getCurrentAccelPedalState() {
return this->crr_accel_pedal_state_.c_str();
}
-const char* LowCanClient::getCurrentCarState() {
- HMI_DEBUG("wm:lcc", "Call");
-
- // Clear changed flag
- this->is_changed_car_state_ = false;
-
- // Return current car state
- return this->crr_car_state_.c_str();
-}
-
} // namespace wm
diff --git a/src/low_can_client.hpp b/src/low_can_client.hpp
index 5ba671e..58d0d8f 100644
--- a/src/low_can_client.hpp
+++ b/src/low_can_client.hpp
@@ -36,11 +36,9 @@ public:
bool isChangedLampState();
bool isChangedParkingBrakeState();
bool isChangedAccelPedalState();
- bool isChangedCarState();
const char* getCurrentLampState();
const char* getCurrentParkingBrakeState();
const char* getCurrentAccelPedalState();
- const char* getCurrentCarState();
private:
// Disable copy and move
@@ -90,13 +88,10 @@ private:
std::string crr_parking_brake_state_;
std::string prv_accel_pedal_state_;
std::string crr_accel_pedal_state_;
- std::string prv_car_state_;
- std::string crr_car_state_;
bool is_changed_lamp_state_;
bool is_changed_parking_brake_state_;
bool is_changed_accel_pedal_state_;
- bool is_changed_car_state_;
};
} // namespace wm
diff --git a/src/main.cpp b/src/main.cpp
index 762981f..3a60b94 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -699,22 +699,6 @@ void on_event(const char *event, struct json_object *object){
}
});
}
- else if (g_afb_instance->lcc_.isChangedCarState()) {
- // If car state is changed
- HMI_DEBUG("wm", "Car state is changed");
-
- // Get car state
- const char* car_state = g_afb_instance->lcc_.getCurrentCarState();
-
- // Allocate window resource
- g_afb_instance->app.allocateWindowResource(car_state, nullptr,
- nullptr, nullptr,
- [](const char* errmsg){
- if (errmsg != nullptr) {
- HMI_ERROR("wm", errmsg);
- }
- });
- }
else if (g_afb_instance->lcc_.isChangedLampState()) {
// If lamp state is changed
HMI_DEBUG("wm", "Lamp state is changed");
diff --git a/src/policy_manager/zipc/dummy_stm.c b/src/policy_manager/zipc/dummy_stm.c
index d695486..968b086 100644
--- a/src/policy_manager/zipc/dummy_stm.c
+++ b/src/policy_manager/zipc/dummy_stm.c
@@ -8,8 +8,6 @@ const char* gStmEventName[] = {
"parking_brake_on",
"accel_pedal_off",
"accel_pedal_on",
- "car_stop",
- "car_run",
"timer_expired",
"lamp_off",
"lamp_on"
@@ -22,8 +20,6 @@ const int gStmEventNo[] = {
STM_EVT_NO_PARKING_BRAKE_ON,
STM_EVT_NO_ACCEL_PEDAL_OFF,
STM_EVT_NO_ACCEL_PEDAL_ON,
- STM_EVT_NO_CAR_STOP,
- STM_EVT_NO_CAR_RUN,
STM_EVT_NO_TIMER_EXPIRED,
STM_EVT_NO_LAMP_OFF,
STM_EVT_NO_LAMP_ON
@@ -390,25 +386,6 @@ int stmTransitionState(int event, stm_state_t* state) {
g_crr_state.accel_pedal.is_changed = STM_TRUE;
}
break;
- case STM_EVT_NO_CAR_STOP:
- if (gStmCarStateNoStop != car_state) {
- g_crr_state.layer.apps.state = g_prv_apps_state_car_stop;
- g_crr_state.layer.apps.is_changed = STM_TRUE;
-
- g_crr_state.car.state = gStmCarStateNoStop;
- g_crr_state.car.is_changed = STM_TRUE;
- }
- break;
- case STM_EVT_NO_CAR_RUN:
- if (gStmCarStateNoRun != car_state) {
- g_prv_apps_state_car_stop = apps_state;
- g_crr_state.layer.apps.state = gStmLayoutNoM1;
- g_crr_state.layer.apps.is_changed = STM_TRUE;
-
- g_crr_state.car.state = gStmCarStateNoRun;
- g_crr_state.car.is_changed = STM_TRUE;
- }
- break;
case STM_EVT_NO_LAMP_OFF:
if (gStmLampStateNoOff != lamp_state) {
g_crr_state.lamp.state = gStmLampStateNoOff;
diff --git a/src/policy_manager/zipc/dummy_stm.h b/src/policy_manager/zipc/dummy_stm.h
index 4c71ac7..42c5148 100644
--- a/src/policy_manager/zipc/dummy_stm.h
+++ b/src/policy_manager/zipc/dummy_stm.h
@@ -30,11 +30,9 @@
#define STM_EVT_NO_PARKING_BRAKE_ON 0x04
#define STM_EVT_NO_ACCEL_PEDAL_OFF 0x05
#define STM_EVT_NO_ACCEL_PEDAL_ON 0x06
-#define STM_EVT_NO_CAR_STOP 0x07
-#define STM_EVT_NO_CAR_RUN 0x08
-#define STM_EVT_NO_TIMER_EXPIRED 0x09
-#define STM_EVT_NO_LAMP_OFF 0x0A
-#define STM_EVT_NO_LAMP_ON 0x0B
+#define STM_EVT_NO_TIMER_EXPIRED 0x07
+#define STM_EVT_NO_LAMP_OFF 0x08
+#define STM_EVT_NO_LAMP_ON 0x09
// Category number
#define STM_CTG_NO_HOMESCREEN 0x0100
@@ -61,7 +59,7 @@
#define STM_MSK_ARA_NO 0xFF0000
// Number of events, categories and areas
-#define STM_NUM_EVT 11
+#define STM_NUM_EVT 9
#define STM_NUM_CTG 7
#define STM_NUM_ARA 8