Editing Documentation/Maemo 5 Developer Guide/Using Generic Platform Components/Alarm Framework

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 16: Line 16:
* Choosing to postpone the alarm if it is missed
* Choosing to postpone the alarm if it is missed
* Executing a given file (e.g. a program or a script)
* Executing a given file (e.g. a program or a script)
-
* Sending a message to a [[Documentation/Maemo 5 Developer Guide/DBus/DBus Basics|D-Bus message bus]]
+
* Sending a message to a D-Bus message bus
* Querying for existing alarm events in a given period of time
* Querying for existing alarm events in a given period of time
* Deleting an existing alarm event
* Deleting an existing alarm event
Line 30: Line 30:
A single event may be set to repeat itself over and over again, at regular intervals or based on time and date. The alarmd daemon will remember these events over system shutdowns too.
A single event may be set to repeat itself over and over again, at regular intervals or based on time and date. The alarmd daemon will remember these events over system shutdowns too.
-
The alarmd daemon can also be asked to start the system up for an event, even when powered off. These events may also be set to run in a hidden power-on mode, where the display stays off, but the device is on. The alarm daemon also supports the use of <code>osso-systemui-alarm</code> to show an alarm dialog for the event, which can be followed by a power up device confirmation dialog, if the device is in the hidden power-up mode.
+
The alarmd daemon can also be asked to start the system up for an event, even when powered off. These events may also be set to run in a hidden power-on mode, where the display stays off, but the device is on. The alarm daemon also supports the use of osso-systemui-alarm to show an alarm dialog for the event, which can be followed by a power up device confirmation dialog, if the device is in the hidden power-up mode.
Communication with the alarmd daemon is performed through D-Bus. It listens to both system and session buses. The easiest way is to use the C client API library, which offers straightforward API to modify the queue.
Communication with the alarmd daemon is performed through D-Bus. It listens to both system and session buses. The easiest way is to use the C client API library, which offers straightforward API to modify the queue.
-
The alarm queue used by the alarmd daemon is stored in file <code>alarm_queue.ini</code>, located in <code>/var/cache/alarmd</code> directory.
+
The alarm queue used by the alarmd daemon is stored in file alarm_queue.ini, located in <code>/var/cache/alarmd</code> directory.
== Alarm Events ==
== Alarm Events ==
-
Alarm events and the functions to manage them are defined in the <code>libalarm.h</code> header file located in <code>/usr/include/alarmd</code>. It is a part of the [http://maemo.org/packages/view/libalarm-dev/ libalarm-dev] Debian package.
+
Alarm events and the functions to manage them are defined in libalarm.h header file located in <code>/usr/include/alarmd</code>. It is a part of the <code>libalarm-dev</code> Debian package.
Alarm event structures contains basic information about the alarm such as:
Alarm event structures contains basic information about the alarm such as:
Line 109: Line 109:
}
}
</source>
</source>
-
 
+
{{ambox|text=Use of absolute time triggering, i.e., alarm_time field of the alarm event, allows 1-second precision. Alarms that use broken-down time, i.e., alarm_tm field, trigger alarms at the start of the next full minute from the alarm. The two fields should not be set simultaneously. Alarm_time-set alarms do not take timezone changes into account.}}
-
{{ambox|text=Use of absolute time triggering, i.e., <code>alarm_time</code> field of the alarm event, allows 1-second precision. Alarms that use broken-down time, i.e., the <code>alarm_tm</code> field, trigger alarms at the start of the next full minute from the alarm. The two fields should not be set simultaneously. Alarm_time-set alarms do not take timezone changes into account.}}
+
===Fetching Details of Alarm Event===
===Fetching Details of Alarm Event===
Line 153: Line 152:
To delete an alarm event, the <code>alarmd_event_del()</code> function needs to be called, passing the event cookie as a parameter.
To delete an alarm event, the <code>alarmd_event_del()</code> function needs to be called, passing the event cookie as a parameter.
-
 
<source lang="c">
<source lang="c">
static void delete_alarm(cookie_t cookie)
static void delete_alarm(cookie_t cookie)
Line 171: Line 169:
The <code>alarmd_event_query()</code> function can be used for querying alarms in the queue.
The <code>alarmd_event_query()</code> function can be used for querying alarms in the queue.
-
 
<source lang="c">
<source lang="c">
static void list_alarms()
static void list_alarms()

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: