|
1 <!-- defines a rules to snooze and stop an active alarm on a doubletap or turndown event --> |
|
2 <script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/"> |
|
3 |
|
4 <!-- active sensor channels when alarm expires --> |
|
5 <if> |
|
6 <equals> |
|
7 <contextRef source='Sensor' type='Setting.Active'/> |
|
8 <string>Off</string> |
|
9 </equals> |
|
10 <actions> |
|
11 </actions> |
|
12 </if> |
|
13 <!-- Check if we have an active alarm and we receive an event --> |
|
14 <elseIf> |
|
15 <and> |
|
16 <!-- Must have an active alarm and receive new double tap event or orientation event from sensor --> |
|
17 <!-- ...alarm is active... --> |
|
18 <notEqual> |
|
19 <contextRef source='AlarmUI' type='State'/> |
|
20 <string>Inactive</string> |
|
21 </notEqual> |
|
22 <or> |
|
23 <and> |
|
24 <!-- Check that double tap interaction is set --> |
|
25 <equals> |
|
26 <contextRef source='Sensor' type='Setting.TappingInteraction.SilenceAlarm'/> |
|
27 <string>On</string> |
|
28 </equals> |
|
29 <!-- ...and we receive a new doubletap event from sensors --> |
|
30 <contextUpdated> |
|
31 <contextRef source='Sensor' type='Event.DoubleTap'/> |
|
32 </contextUpdated> |
|
33 </and> |
|
34 <and> |
|
35 <!-- Check that turning interaction is set --> |
|
36 <equals> |
|
37 <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceAlarm'/> |
|
38 <string>On</string> |
|
39 </equals> |
|
40 <!-- ...and previous orientation is not 'Undefined' ... --> |
|
41 <notEqual> |
|
42 <contextRef source='Sensor' type='Event.Orientation.Previous'/> |
|
43 <string>Undefined</string> |
|
44 </notEqual> |
|
45 <!-- ...and we receive a new orientation event from sensors... --> |
|
46 <contextChanged> |
|
47 <contextRef source='Sensor' type='Event.Orientation'/> |
|
48 </contextChanged> |
|
49 <equals> |
|
50 <contextRef source='Sensor' type='Event.Orientation'/> |
|
51 <string>DisplayDownwards</string> |
|
52 </equals> |
|
53 </and> |
|
54 </or> |
|
55 </and> |
|
56 <actions> |
|
57 <!-- snooze the alarm --> |
|
58 <AlarmUI.Snooze dummy='dummy'/> |
|
59 |
|
60 <!-- request vibra feedback --> |
|
61 <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/> |
|
62 </actions> |
|
63 </elseIf> |
|
64 <!-- stop an active alarm on a 'Stop' command --> |
|
65 <elseIf> |
|
66 <and> |
|
67 <!-- alarm is active... --> |
|
68 <notEqual> |
|
69 <contextRef source='AlarmUI' type='State'/> |
|
70 <string>Inactive</string> |
|
71 </notEqual> |
|
72 <!-- ...and we got a new stop command --> |
|
73 <contextUpdated> |
|
74 <contextRef source='AlarmUI' type='Command'/> |
|
75 </contextUpdated> |
|
76 <equals> |
|
77 <contextRef source='AlarmUI' type='Command'/> |
|
78 <string>Stop</string> |
|
79 </equals> |
|
80 </and> |
|
81 <actions> |
|
82 <!-- stop the alarm --> |
|
83 <AlarmUI.Stop dummy='dummy'/> |
|
84 |
|
85 <!-- request vibra feedback --> |
|
86 <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/> |
|
87 </actions> |
|
88 </elseIf> |
|
89 <!-- snooze an active alarm on a 'Snooze' command --> |
|
90 <elseIf> |
|
91 <and> |
|
92 <!-- alarm is active... --> |
|
93 <notEqual> |
|
94 <contextRef source='AlarmUI' type='State'/> |
|
95 <string>Inactive</string> |
|
96 </notEqual> |
|
97 <!-- ...and we got a new stop command --> |
|
98 <contextUpdated> |
|
99 <contextRef source='AlarmUI' type='Command'/> |
|
100 </contextUpdated> |
|
101 <equals> |
|
102 <contextRef source='AlarmUI' type='Command'/> |
|
103 <string>Snooze</string> |
|
104 </equals> |
|
105 </and> |
|
106 <actions> |
|
107 <!-- snooze the alarm --> |
|
108 <AlarmUI.Snooze dummy='dummy'/> |
|
109 |
|
110 <!-- request vibra feedback --> |
|
111 <Vibra Mode='Start' Delay='0' Repeats='2' RepeatInterval='200' Duration='50' Intensity='50'/> |
|
112 </actions> |
|
113 </elseIf> |
|
114 </script> |