Ubuntu Platform API  2.2.0
A library helping with tight integration into the Ubuntu platform
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
alarm.h File Reference
#include <ubuntu/status.h>
#include <ubuntu/visibility.h>
+ Include dependency graph for alarm.h:

Go to the source code of this file.

Data Structures

struct  UbuntuHardwareAlarmWaitResult
 

Typedefs

typedef
UbuntuHardwareAlarmTimeReference 
UHardwareAlarmTimeReference
 
typedef
UbuntuHardwareAlarmSleepBehavior 
UHardwareAlarmSleepBehavior
 
typedef
UbuntuHardwareAlarmWaitResult 
UHardwareAlarmWaitResult
 
typedef struct
UbuntuHardwareAlarm * 
UHardwareAlarm
 

Enumerations

enum  UbuntuHardwareAlarmTimeReference {
  U_HARDWARE_ALARM_TIME_REFERENCE_BOOT,
  U_HARDWARE_ALARM_TIME_REFERENCE_RTC
}
 
enum  UbuntuHardwareAlarmSleepBehavior {
  U_HARDWARE_ALARM_SLEEP_BEHAVIOR_WAKEUP_DEVICE,
  U_HARDWARE_ALARM_SLEEP_BEHAVIOR_KEEP_DEVICE_ASLEEP
}
 

Functions

UBUNTU_DLL_PUBLIC UHardwareAlarm u_hardware_alarm_create ()
 
UBUNTU_DLL_PUBLIC void u_hardware_alarm_ref (UHardwareAlarm alarm)
 
UBUNTU_DLL_PUBLIC void u_hardware_alarm_unref (UHardwareAlarm alarm)
 
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_get_elapsed_real_time (UHardwareAlarm alarm, struct timespec *tz)
 
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_set_timezone (UHardwareAlarm alarm, const struct timezone *tz)
 
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_set_relative_to_with_behavior (UHardwareAlarm alarm, UHardwareAlarmTimeReference time_reference, UHardwareAlarmSleepBehavior behavior, const struct timespec *ts)
 
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_wait_for_next_alarm (UHardwareAlarm alarm, UHardwareAlarmWaitResult *result)
 

Typedef Documentation

typedef struct UbuntuHardwareAlarm* UHardwareAlarm

Opaque type modelling access to the kernel/hw-level alarm capabilities.

Definition at line 58 of file alarm.h.

Enumeration Type Documentation

Describes if an alarm is able to wakup the device from sleep.

Enumerator
U_HARDWARE_ALARM_SLEEP_BEHAVIOR_WAKEUP_DEVICE 

Alarm will wakeup the device from sleep.

U_HARDWARE_ALARM_SLEEP_BEHAVIOR_KEEP_DEVICE_ASLEEP 

Alarm will not wakeup the device and will be delivered on the next wakeup of the device

Definition at line 38 of file alarm.h.

The time reference that alarms are setup to.

Enumerator
U_HARDWARE_ALARM_TIME_REFERENCE_BOOT 

Relative to the device's boot time, including sleep.

U_HARDWARE_ALARM_TIME_REFERENCE_RTC 

Wall clock time in UTC.

Definition at line 29 of file alarm.h.

Function Documentation

UBUNTU_DLL_PUBLIC UHardwareAlarm u_hardware_alarm_create ( )

Creates an instance and/or increments its refcount.

UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_get_elapsed_real_time ( UHardwareAlarm  alarm,
struct timespec *  tz 
)

Query the time that elapsed since boot, including deep sleeps.

UBUNTU_DLL_PUBLIC void u_hardware_alarm_ref ( UHardwareAlarm  alarm)

Increments the instance's ref count.

UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_set_relative_to_with_behavior ( UHardwareAlarm  alarm,
UHardwareAlarmTimeReference  time_reference,
UHardwareAlarmSleepBehavior  behavior,
const struct timespec *  ts 
)

Sets and arms a timer.

UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_set_timezone ( UHardwareAlarm  alarm,
const struct timezone *  tz 
)

Reports a timezone change to kernel and HW.

UBUNTU_DLL_PUBLIC void u_hardware_alarm_unref ( UHardwareAlarm  alarm)

Decrements the instance's ref count.

UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_wait_for_next_alarm ( UHardwareAlarm  alarm,
UHardwareAlarmWaitResult result 
)

Blocks until the next alarm occurs.