alarmui/group/alarmui_activate.rul
branchRCL_3
changeset 23 51372538e3d3
parent 16 55d60436f00b
equal deleted inserted replaced
22:07e82e2b738b 23:51372538e3d3
       
     1 <script xmlns="http://www.nokia.com/ns/cep/script/1.0/" xmlns:cep="http://www.nokia.com/ns/cep/1.0/">
       
     2     <!-- If sensor settings are off, nothing needs to be done -->
       
     3     <if>
       
     4         <or>
       
     5             <!-- Sensor settings are disabled -->
       
     6             <not>
       
     7 	            <equals>
       
     8 	                <contextRef source='Sensor' type='Setting.Active' value='On'/>
       
     9 	            </equals>
       
    10             </not>
       
    11 	        <!-- Turning interaction is disabled -->
       
    12 	        <not>
       
    13 	            <equals>
       
    14 	                <contextRef source='Sensor' type='Setting.TurningInteraction.SilenceAlarm' value='On'/>
       
    15 	            </equals>
       
    16 	        </not>
       
    17         </or>
       
    18         <actions>
       
    19             <!-- Do nothing -->
       
    20         </actions>
       
    21     </if>
       
    22     
       
    23     <!-- Enable sensor services -->
       
    24     <elseIf>
       
    25 		<!-- Alarm is active -->
       
    26 		<not>
       
    27             <contextUpdated>
       
    28                 <contextRef source='AlarmUI' type='State' value='Inactive'/>
       
    29             </contextUpdated>
       
    30 		</not>
       
    31 	    <actions>
       
    32 	            <!-- Activate orientation channel (0x01) from sensor source (0x10282DF0) -->
       
    33 	            <sourceCommand uid='0x10282DF0'>
       
    34 	                <sensorCommand channelId='0x01' id='activate'/>
       
    35 	            </sourceCommand>
       
    36 	            <!-- Publish context that indicates that alarm is active -->
       
    37 	            <publishContext define='true'>
       
    38 	                <contextRef source='Alarm' type='Status.Active' value='true'/>
       
    39 	            </publishContext>
       
    40 	    </actions>
       
    41     </elseIf>
       
    42 
       
    43     <!-- Disable sensor services -->
       
    44     <elseIf>
       
    45         <!-- Alarm is not active -->
       
    46         <contextUpdated>
       
    47             <contextRef source='AlarmUI' type='State' value='Inactive'/>
       
    48         </contextUpdated>
       
    49 	    <actions>
       
    50 	            <!-- Activate orientation channel (0x01) from sensor source (0x10282DF0) -->
       
    51 	            <sourceCommand uid='0x10282DF0'>
       
    52 	                <sensorCommand channelId='0x01' id='deactivate'/>
       
    53 	            </sourceCommand>
       
    54 	            <!-- Publish context that indicates that alarm is not active -->
       
    55 	            <publishContext define='true'>
       
    56 	                <contextRef source='Alarm' type='Status.Active' value='false'/>
       
    57 	            </publishContext>
       
    58 	    </actions>
       
    59     </elseIf>
       
    60 </script>