diff options
author | 2018-04-27 19:01:36 +0900 | |
---|---|---|
committer | 2018-04-27 19:01:36 +0900 | |
commit | 55be85ed4bdfea6fc037d781b8cd8f58487718d1 (patch) | |
tree | 279a88e26c74aee58f11e2a5d20348569ce34667 /src/policy_manager/zipc/dummy_stm.h | |
parent | d50188f726b15a0ae2777bf2d91ee88836feeac5 (diff) |
Add PolicyManager, related classes and some config files
- PolicyManager
Decide next layout by using occured event and current state
based on policy table.
This PolicyManger is reference and the OEMs can replace it.
- LayoutManager
Change the current layout to the layout
which decided by PolicyManager.
NOTE:
The functions of this class had been included in App class.
The part of function of this class remain there yet.
- LowCanClient
Receive the CAN signal from low level CAN service.
- app.db
Define the applications name and its role.
This file will be deleted
when the names and roles can be given by other module.
- layout.cb
Define the layouts and areas which are included by the layout.
- role.db
Define the roles of the applications.
Change-Id: I2f84bdf5e68355e022f516cee9a1db88efe58825
Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src/policy_manager/zipc/dummy_stm.h')
-rw-r--r-- | src/policy_manager/zipc/dummy_stm.h | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/src/policy_manager/zipc/dummy_stm.h b/src/policy_manager/zipc/dummy_stm.h new file mode 100644 index 0000000..18af99b --- /dev/null +++ b/src/policy_manager/zipc/dummy_stm.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2018 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TMCAGLWM_DUMMY_STM_HPP +#define TMCAGLWM_DUMMY_STM_HPP + +// TODO: This file should be existed in STM + +// +#define STM_TRUE 1 +#define STM_FALSE 0 + +// Event number +#define STM_EVT_NO_ACTIVATE 0x01 +#define STM_EVT_NO_DEACTIVATE 0x02 +#define STM_EVT_NO_CAR_STOP 0x03 +#define STM_EVT_NO_CAR_RUN 0x04 +#define STM_EVT_NO_TIMER_EXPIRED 0x05 +#define STM_EVT_NO_LAMP_OFF 0x06 +#define STM_EVT_NO_LAMP_ON 0x07 + +// Category number +#define STM_CTG_NO_HOMESCREEN 0x0100 +#define STM_CTG_NO_MAP 0x0200 +#define STM_CTG_NO_GENERAL 0x0300 +#define STM_CTG_NO_SPLITABLE 0x0400 +#define STM_CTG_NO_POPUP 0x0500 +#define STM_CTG_NO_SYSTEM_ALERT 0x0600 + +// Area number +#define STM_ARA_NO_FULL 0x010000 +#define STM_ARA_NO_NORMAL 0x020000 +#define STM_ARA_NO_SPLIT_MAIN 0x030000 +#define STM_ARA_NO_SPLIT_SUB 0x040000 +#define STM_ARA_NO_ON_SCREEN 0x050000 + +// Mask +#define STM_MSK_EVT_NO 0x0000FF +#define STM_MSK_CTG_NO 0x00FF00 +#define STM_MSK_ARA_NO 0xFF0000 + +// Enum for state +enum stm_car_state_ { + gStmCarStateNoStop = 0, + gStmCarStateNoRun +}; + +enum stm_lamp_state_ { + gStmLampStateNoOff = 0, + gStmLampStateNoOn +}; + +enum stm_layout_ { + gStmLayoutNoNone = 0, + gStmLayoutNoPu, + gStmLayoutNoSa, + gStmLayoutNoM1, + gStmLayoutNoM2, + gStmLayoutNoMf, + gStmLayoutNoS1, + gStmLayoutNoS2, + gStmLayoutNoG, + gStmLayoutNoHs +}; + + +#if 0 +// String for state +const char* gStmCarStateNo2Name[] { + "car_stop", + "car_run" +}; + +const char* gStmLampStateNo2Name[] { + "lamp_off", + "lamp_on" +}; + +const char* gStmLayoutNo2Name[] { + "none", + "pu", + "sa", + "m1", + "m2", + "mf", + "s1", + "s2", + "g", + "hs", +}; +#endif + +typedef struct stm_base_state_ { + int is_changed; + int state; +} stm_base_state; + +typedef struct stm_layer_state_ { + stm_base_state on_screen; + stm_base_state apps; + stm_base_state homescreen; +} stm_layer_state; + +// Struct for state +typedef struct { + stm_base_state car; + stm_base_state lamp; + stm_layer_state layer; +} stm_state_t; + +int stmTransitionState(int event_no, stm_state_t* state); + + +#endif // TMCAGLWM_DUMMY_STM_HPP |