alarmui/group/alarmui_activate.rul
branchRCL_3
changeset 27 55d60436f00b
child 78 356f28cd5ca0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/alarmui/group/alarmui_activate.rul	Tue May 11 16:12:24 2010 +0300
@@ -0,0 +1,60 @@
+<script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
+    <!-- If sensor settings are off, nothing needs to be done -->
+    <if>
+        <or>
+            <!-- Sensor settings are disabled -->
+            <not>
+	            <equals>
+	                <contextRef source='Sensor' type='Setting.Active' value='On'/>
+	            </equals>
+            </not>
+	        <!-- Turning interaction is disabled -->
+	        <not>
+	            <equals>
+	                <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceAlarm' value='On'/>
+	            </equals>
+	        </not>
+        </or>
+        <actions>
+            <!-- Do nothing -->
+        </actions>
+    </if>
+    
+    <!-- Enable sensor services -->
+    <elseIf>
+		<!-- Alarm is active -->
+		<not>
+            <contextUpdated>
+                <contextRef source='AlarmUI' type='State' value='Inactive'/>
+            </contextUpdated>
+		</not>
+	    <actions>
+	            <!-- Activate orientation channel (0x01) from sensor source (0x10282DF0) -->
+	            <sourceCommand uid='0x10282DF0'>
+	                <sensorCommand channelId='0x01' id='activate'/>
+	            </sourceCommand>
+	            <!-- Publish context that indicates that alarm is active -->
+	            <publishContext define='true'>
+	                <contextRef source='Alarm' type='Status.Active' value='true'/>
+	            </publishContext>
+	    </actions>
+    </elseIf>
+
+    <!-- Disable sensor services -->
+    <elseIf>
+        <!-- Alarm is not active -->
+        <contextUpdated>
+            <contextRef source='AlarmUI' type='State' value='Inactive'/>
+        </contextUpdated>
+	    <actions>
+	            <!-- Activate orientation channel (0x01) from sensor source (0x10282DF0) -->
+	            <sourceCommand uid='0x10282DF0'>
+	                <sensorCommand channelId='0x01' id='deactivate'/>
+	            </sourceCommand>
+	            <!-- Publish context that indicates that alarm is not active -->
+	            <publishContext define='true'>
+	                <contextRef source='Alarm' type='Status.Active' value='false'/>
+	            </publishContext>
+	    </actions>
+    </elseIf>
+</script>
\ No newline at end of file