aboutsummaryrefslogtreecommitdiffstats
path: root/src/policy_manager/zipc
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-09 16:09:40 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-05-09 16:09:40 +0900
commite6d867b95a5e32ce5f50106b05020bd9888ae8a3 (patch)
tree17e5d38510f2decbf6d16db86e1cd8a71ce4c37e /src/policy_manager/zipc
parenta660fd2bc4e232dd8bb61febd1eae1e26d674804 (diff)
Add policy of switching parking brake state to dummy stm for validation
Change-Id: I547e578526d6ce934c9fa8aa86170cea5a2f17e7 Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src/policy_manager/zipc')
-rw-r--r--src/policy_manager/zipc/dummy_stm.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/policy_manager/zipc/dummy_stm.c b/src/policy_manager/zipc/dummy_stm.c
index 78e25d7..459f58c 100644
--- a/src/policy_manager/zipc/dummy_stm.c
+++ b/src/policy_manager/zipc/dummy_stm.c
@@ -94,7 +94,7 @@ int g_prv_apps_state_car_stop = 0;
int stmTransitionState(int event, stm_state_t* state) {
int event_no, category_no, area_no;
- int apps_state, car_state, lamp_state;
+ int apps_state, parking_brake_state, car_state, lamp_state;
event_no = event & STM_MSK_EVT_NO;
category_no = event & STM_MSK_CTG_NO;
@@ -105,6 +105,7 @@ int stmTransitionState(int event, stm_state_t* state) {
// Get previous state
apps_state = g_prv_state.layer.apps.state;
+ parking_brake_state = g_prv_state.parking_brake.state;
car_state = g_prv_state.car.state;
lamp_state = g_prv_state.lamp.state;
@@ -254,6 +255,18 @@ int stmTransitionState(int event, stm_state_t* state) {
break;
}
break;
+ case STM_EVT_NO_PARKING_BRAKE_OFF:
+ if (gStmParkingBrakeStateNoOff != parking_brake_state) {
+ g_crr_state.parking_brake.state = gStmParkingBrakeStateNoOff;
+ g_crr_state.parking_brake.is_changed = STM_TRUE;
+ }
+ break;
+ case STM_EVT_NO_PARKING_BRAKE_ON:
+ if (gStmParkingBrakeStateNoOn != parking_brake_state) {
+ g_crr_state.parking_brake.state = gStmParkingBrakeStateNoOn;
+ g_crr_state.parking_brake.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;