Ubuntu Platform API  3.0.0
A library helping with tight integration into the Ubuntu platform
alarm.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Thomas Voß <thomas.voss@canonical.com>
17  */
18 #ifndef UBUNTU_HARDWARE_ALARM_H_
19 #define UBUNTU_HARDWARE_ALARM_H_
20 
21 #include <ubuntu/status.h>
22 #include <ubuntu/visibility.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
29 typedef enum
30 {
34 
36 
38 typedef enum
39 {
45 
47 
49 typedef struct
50 {
54 
56 
58 typedef struct UbuntuHardwareAlarm* UHardwareAlarm;
59 
63 
67  UHardwareAlarm alarm);
68 
72  UHardwareAlarm alarm);
73 
77  UHardwareAlarm alarm,
78  struct timespec *tz);
79 
83  UHardwareAlarm alarm,
84  const struct timezone *tz);
85 
89  UHardwareAlarm alarm,
90  UHardwareAlarmTimeReference time_reference,
92  const struct timespec *ts);
93 
97  UHardwareAlarm alarm,
98  UHardwareAlarmWaitResult *result);
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif
UHardwareAlarmSleepBehavior
UbuntuHardwareAlarmSleepBehavior UHardwareAlarmSleepBehavior
Definition: alarm.h:46
U_HARDWARE_ALARM_TIME_REFERENCE_RTC
@ U_HARDWARE_ALARM_TIME_REFERENCE_RTC
Definition: alarm.h:32
UHardwareAlarm
struct UbuntuHardwareAlarm * UHardwareAlarm
Definition: alarm.h:58
UHardwareAlarmTimeReference
UbuntuHardwareAlarmTimeReference UHardwareAlarmTimeReference
Definition: alarm.h:35
visibility.h
UbuntuHardwareAlarmWaitResult::reference
UHardwareAlarmTimeReference reference
Definition: alarm.h:51
U_HARDWARE_ALARM_SLEEP_BEHAVIOR_WAKEUP_DEVICE
@ U_HARDWARE_ALARM_SLEEP_BEHAVIOR_WAKEUP_DEVICE
Definition: alarm.h:41
UHardwareAlarmWaitResult
UbuntuHardwareAlarmWaitResult UHardwareAlarmWaitResult
Definition: alarm.h:55
UbuntuHardwareAlarmWaitResult::sleep_behavior
UHardwareAlarmSleepBehavior sleep_behavior
Definition: alarm.h:52
u_hardware_alarm_create
UBUNTU_DLL_PUBLIC UHardwareAlarm u_hardware_alarm_create()
U_HARDWARE_ALARM_TIME_REFERENCE_BOOT
@ U_HARDWARE_ALARM_TIME_REFERENCE_BOOT
Definition: alarm.h:31
UbuntuStatus
UbuntuStatus
Indicates the status of an operation.
Definition: status.h:26
UBUNTU_DLL_PUBLIC
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26
u_hardware_alarm_set_timezone
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_set_timezone(UHardwareAlarm alarm, const struct timezone *tz)
u_hardware_alarm_unref
UBUNTU_DLL_PUBLIC void u_hardware_alarm_unref(UHardwareAlarm alarm)
UbuntuHardwareAlarmSleepBehavior
UbuntuHardwareAlarmSleepBehavior
Definition: alarm.h:38
UbuntuHardwareAlarmWaitResult
Definition: alarm.h:49
u_hardware_alarm_get_elapsed_real_time
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_get_elapsed_real_time(UHardwareAlarm alarm, struct timespec *tz)
u_hardware_alarm_wait_for_next_alarm
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_wait_for_next_alarm(UHardwareAlarm alarm, UHardwareAlarmWaitResult *result)
U_HARDWARE_ALARM_SLEEP_BEHAVIOR_KEEP_DEVICE_ASLEEP
@ U_HARDWARE_ALARM_SLEEP_BEHAVIOR_KEEP_DEVICE_ASLEEP
Definition: alarm.h:43
u_hardware_alarm_set_relative_to_with_behavior
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_set_relative_to_with_behavior(UHardwareAlarm alarm, UHardwareAlarmTimeReference time_reference, UHardwareAlarmSleepBehavior behavior, const struct timespec *ts)
UbuntuHardwareAlarmTimeReference
UbuntuHardwareAlarmTimeReference
Definition: alarm.h:29
u_hardware_alarm_ref
UBUNTU_DLL_PUBLIC void u_hardware_alarm_ref(UHardwareAlarm alarm)
status.h