2 # This file is in YAML format (http://www.yaml.org/)
3 # We define a list of rules that will be automatically loaded
4 # When we start the oevents module of the framework daemon
6 # The attributes of a rule are :
7 # - trigger : trigger object
8 # - filters : filters object or list of filters objects
9 # - actions : action object or list of actions objects
11 # We define the following functions :
12 # - CallStatus() : create a trigger object activated on a call status event
13 # - PowerStatus() : create a trigger object activated on a power status event
14 # - HasAttr(name, value) : create a filter that accept signal with a given attribute
15 # - Not(filter) : create a neg filter
16 # - PlaySound(file) : Action that starts to play an audio file
17 # - StopSound(file) : Action that stop an audio file
18 # - SetScenario(name) : Action that sets an audio scenario
21 # - RingTone(cmd) : cmd can be 'start' or 'stop'
22 # - Time(hour, min) : create a trigger activated at the given time
23 # - Debug(msg) : Action that prints a debug message (only for debuging)
26 # Call -> Audio Scenario Handling
28 trigger: IncomingMessage()
29 actions: MessageTone(play)
32 while: CallListContains("incoming")
33 filters: Not(CallListContains("active"))
36 - OccupyResource(Display)
39 while: NewMissedCalls()
40 actions: SetLed("gta04_green_aux", "blink", 128, 1024)
42 while: UnreadMessages()
43 actions: SetLed("gta04_red_aux", "blink", 128, 1024)
47 - Or(CallListContains("outgoing"), CallListContains("active"))
53 - CallListContains("incoming")
59 - Or(CallListContains("outgoing"), CallListContains("active"))
60 - Not(BTHeadsetIsConnected())
62 - SetScenario(gsmhandset)
66 - Or(CallListContains("outgoing"), CallListContains("active"))
67 - BTHeadsetIsConnected()
69 - SetScenario(gsmbluetooth)
73 filters: HasAttr(status, "charging")
74 actions: SetLed("gta04_red_power", "light")
77 filters: HasAttr(status, "critical")
78 actions: SetLed("gta04_red_power", "blink", 512, 512)
81 filters: HasAttr(status, "full")
82 actions: SetLed("gta04_green_power", "light")
84 trigger: PowerStatus()
85 filters: HasAttr(status, "empty")
86 actions: Command('poweroff')