add source for ces2019
[apps/agl-service-windowmanager-2017.git] / policy_manager / stm / zipc / StateTransitionor / RestrictionMode / ZREM_RestrictionMode.c
1 /************************************************************/
2 /*     ZREM_RestrictionMode.c                               */
3 /*     RestrictionMode State transition model source file   */
4 /*     ZIPC Designer Version 1.2.0                          */
5 /************************************************************/
6 #include "../ZST_include.h"
7
8 /* State management variable */
9 static uint8_t ZREM_RestrictionModeState[ZREM_RESTRICTIONMODESTATENOMAX];
10
11 static void ZREM_RestrictionModes0e1( void );
12 static void ZREM_RestrictionModes1e0( void );
13 static void ZREM_RestrictionModes0Event( void );
14 static void ZREM_RestrictionModes1Event( void );
15
16 /****************************************/
17 /* Action function                      */
18 /*   STM : RestrictionMode              */
19 /*   State : restriction_mode_on( No 0 )*/
20 /*   Event : evt_restriction_mode_off( No 1 ) */
21 /****************************************/
22 static void ZREM_RestrictionModes0e1( void )
23 {
24     ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
25     stm_rem_start_activity_restriction_mode_off();
26 }
27
28 /****************************************/
29 /* Action function                      */
30 /*   STM : RestrictionMode              */
31 /*   State : restriction_mode_off( No 1 ) */
32 /*   Event : evt_restriction_mode_on( No 0 ) */
33 /****************************************/
34 static void ZREM_RestrictionModes1e0( void )
35 {
36     ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES0;
37     stm_rem_start_activity_restriction_mode_on();
38 }
39
40 /****************************************/
41 /* Event appraisal function             */
42 /*   STM : RestrictionMode              */
43 /*   State : restriction_mode_on( No 0 )*/
44 /****************************************/
45 static void ZREM_RestrictionModes0Event( void )
46 {
47     /*evt_restriction_mode_off*/
48     if( g_stm_event == StmEvtNoRestrictionModeOff )
49     {
50         ZREM_RestrictionModes0e1();
51     }
52     else
53     {
54         /*Else and default design have not done.*/
55         /*Please confirm the STM and design else and default.*/
56     }
57 }
58
59 /****************************************/
60 /* Event appraisal function             */
61 /*   STM : RestrictionMode              */
62 /*   State : restriction_mode_off( No 1 ) */
63 /****************************************/
64 static void ZREM_RestrictionModes1Event( void )
65 {
66     /*evt_restriction_mode_on*/
67     if( g_stm_event == StmEvtNoRestrictionModeOn )
68     {
69         ZREM_RestrictionModes1e0();
70     }
71     else
72     {
73         /*Else and default design have not done.*/
74         /*Please confirm the STM and design else and default.*/
75     }
76 }
77
78 /****************************************/
79 /* Event call function                  */
80 /*   STM : RestrictionMode              */
81 /****************************************/
82 void stm_rem_event_call( void )
83 {
84     stm_rem_start_stm();
85     switch( ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] )
86     {
87     case ZREM_RESTRICTIONMODES0:
88         ZREM_RestrictionModes0Event();
89         break;
90     case ZREM_RESTRICTIONMODES1:
91         ZREM_RestrictionModes1Event();
92         break;
93     default:
94         /*Not accessible to this else (default).*/
95         break;
96     }
97 }
98
99 /****************************************/
100 /* Initial function                     */
101 /*   STM : RestrictionMode              */
102 /****************************************/
103 void stm_rem_initialize( void )
104 {
105     ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODES1;
106     stm_rem_start_activity_restriction_mode_off();
107 }
108
109 /****************************************/
110 /* Terminate function                   */
111 /*   STM : RestrictionMode              */
112 /****************************************/
113 void ZREM_RestrictionModeTerminate( void )
114 {
115     ZREM_RestrictionModeState[ZREM_RESTRICTIONMODE] = ( uint8_t )ZREM_RESTRICTIONMODETERMINATE;
116 }
117