aboutsummaryrefslogtreecommitdiffstats
path: root/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-07-11 16:21:37 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-08-15 01:49:00 +0000
commit1859dd4135f5d019f16a1333df318ecd1211afb9 (patch)
treee8b5e087215b087143f7982bf459d1d60ed45f65 /policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
parentc1d85371b1eb693128cf9553c356ea77e609d9a3 (diff)
Readd policy table generated by ZIPC for EXAMPLEflounder_5.99.4flounder_5.99.3flounder/5.99.4flounder/5.99.35.99.45.99.3
This patch reverts commit e4222ca8da3b02afca5625fa2cef6832aa8ce90e and update it. To Policy Manager, add the source code of policy table which is generated by ZIPC for EXAMPLE. If use this example, please comment out line 22 and uncomment line 23 in policy_manager/CMakeLists.txt as follows: #set(STM_DIR stub) set(STM_DIR zipc) If try to show split layout, please set bool value "ON" to TRY_SPLIT_LAYOUT at line 28 in policy_manager/CMakeLists.txt as follows: set(TRY_SPLIT_LAYOUT OFF CACHE BOOL "Enable to show split layout") The generated source codes by ZIPC are "Common" and "StateTransitionor" in policy_manager/stm/zipc/. Bug-AGL: SPEC-1537 Change-Id: I1f91cf728eab79c229c5b4b12b9e1bdd338f64aa Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c')
-rw-r--r--policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c168
1 files changed, 168 insertions, 0 deletions
diff --git a/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
new file mode 100644
index 0000000..7fe5700
--- /dev/null
+++ b/policy_manager/stm/zipc/StateTransitionor/RestrictionMode/ZREM_RestrictionMode.c
@@ -0,0 +1,168 @@
+/************************************************************/
+/* ZREM_RestrictionMode.c */
+/* RestrictionMode State transition model source file */
+/* ZIPC Designer Version 1.2.0 */
+/************************************************************/
+#include "../ZST_include.h"
+
+/* State management variable */
+static uint8_t ZREM_RestrictionModeState[ZREM_RESTRICTIONMODESTATENOMAX];
+
+static void ZREM_RestrictionModes0e1( void );
+static void ZREM_RestrictionModes0e2( void );
+static void ZREM_RestrictionModes1e0( void );
+static void ZREM_RestrictionModes0Event( void );
+static void ZREM_RestrictionModes1Event( void );
+static void ZREM_RestrictionModes2Event( void );
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_off( No 0 ) */
+/* Event : evt_restriction_mode_1_on( No 1 ) */
+/****************************************/
+static void ZREM_RestrictionModes0e1( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
+ stm_rem_start_activity_restriction_mode_1_on();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_off( No 0 ) */
+/* Event : evt_restriction_mode_2_on( No 2 ) */
+/****************************************/
+static void ZREM_RestrictionModes0e2( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES2;
+ stm_rem_start_activity_restriction_mode_2_on();
+}
+
+/****************************************/
+/* Action function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_1_on( No 1 ) */
+/* Event : evt_restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZREM_RestrictionModes1e0( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
+ stm_rem_start_activity_restriction_mode_off();
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_off( No 0 ) */
+/****************************************/
+static void ZREM_RestrictionModes0Event( void )
+{
+ /*evt_restriction_mode_1_on*/
+ if( g_stm_event == StmEvtNoRestrictionMode1On )
+ {
+ ZREM_RestrictionModes0e1();
+ }
+ /*evt_restriction_mode_2_on*/
+ else if( g_stm_event == StmEvtNoRestrictionMode2On )
+ {
+ ZREM_RestrictionModes0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_1_on( No 1 ) */
+/****************************************/
+static void ZREM_RestrictionModes1Event( void )
+{
+ /*evt_restriction_mode_off*/
+ if( g_stm_event == StmEvtNoRestrictionModeOff )
+ {
+ ZREM_RestrictionModes1e0();
+ }
+ /*evt_restriction_mode_2_on*/
+ else if( g_stm_event == StmEvtNoRestrictionMode2On )
+ {
+ ZREM_RestrictionModes0e2();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event appraisal function */
+/* STM : RestrictionMode */
+/* State : restriction_mode_2_on( No 2 ) */
+/****************************************/
+static void ZREM_RestrictionModes2Event( void )
+{
+ /*evt_restriction_mode_off*/
+ if( g_stm_event == StmEvtNoRestrictionModeOff )
+ {
+ ZREM_RestrictionModes1e0();
+ }
+ /*evt_restriction_mode_1_on*/
+ else if( g_stm_event == StmEvtNoRestrictionMode1On )
+ {
+ ZREM_RestrictionModes0e1();
+ }
+ else
+ {
+ /*Else and default design have not done.*/
+ /*Please confirm the STM and design else and default.*/
+ }
+}
+
+/****************************************/
+/* Event call function */
+/* STM : RestrictionMode */
+/****************************************/
+void stm_rem_event_call( void )
+{
+ stm_rem_start_stm();
+ switch( ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] )
+ {
+ case ZREM_RESTRICTIONMODES0:
+ ZREM_RestrictionModes0Event();
+ break;
+ case ZREM_RESTRICTIONMODES1:
+ ZREM_RestrictionModes1Event();
+ break;
+ case ZREM_RESTRICTIONMODES2:
+ ZREM_RestrictionModes2Event();
+ break;
+ default:
+ /*Not accessible to this else (default).*/
+ break;
+ }
+}
+
+/****************************************/
+/* Initial function */
+/* STM : RestrictionMode */
+/****************************************/
+void stm_rem_initialize( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
+ stm_rem_start_activity_restriction_mode_off();
+}
+
+/****************************************/
+/* Terminate function */
+/* STM : RestrictionMode */
+/****************************************/
+void ZREM_RestrictionModeTerminate( void )
+{
+ ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODETERMINATE;
+}
+