PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
Wakeup

Scheduled app launches. More...

Data Structures

struct  WakeupInfo
 Wakeup event passed to the app it launches. More...
 

Macros

#define WAKEUP_EVENT_WINDOW   60
 Time reserved around each event, in seconds, in which no other event can be scheduled.
 
#define MAX_WAKEUP_EVENTS_PER_APP   8
 Maximum number of events per app.
 
#define WAKEUP_CATCHUP_WINDOW   (WAKEUP_EVENT_WINDOW / 2)
 Reduced gap, in seconds, between events caught up after a time change or after the service was disabled (e.g.
 

Typedefs

typedef int32_t WakeupId
 WakeupId is an identifier for a wakeup event.
 

Functions

void wakeup_init (void)
 Initialize the service.
 
void wakeup_enable (bool enabled)
 Enable or disable the service.
 
TimerID wakeup_get_current (void)
 Get the timer used to schedule events, for tests.
 
WakeupId wakeup_get_next_scheduled (void)
 Get the next scheduled event, for tests.
 
void wakeup_migrate_timezone (int utc_diff)
 Convert events scheduled in local time to UTC after the timezone was set.
 
void wakeup_handle_significant_clock_change (void)
 Handle a significant time change (over 15 s, timezone or DST).
 
void wakeup_handle_clock_change (void)
 Handle any time change, including small RTC calibrations.
 

Detailed Description

Scheduled app launches.

Kernel side of the app wakeup API. Events are stored in the "wakeup" settings file and the next one is scheduled with a new_timer. When an event fires, its app is launched with APP_LAUNCH_WAKEUP, or receives a PEBBLE_WAKEUP_EVENT if already running. Events missed while the watch was off can be reported with a popup.


Data Structure Documentation

◆ WakeupInfo

struct WakeupInfo

Wakeup event passed to the app it launches.

Data Fields
WakeupId wakeup_id Event identifier, its scheduling timestamp.
int32_t wakeup_reason Reason given by the app when scheduling the event.

Macro Definition Documentation

◆ MAX_WAKEUP_EVENTS_PER_APP

#define MAX_WAKEUP_EVENTS_PER_APP   8

Maximum number of events per app.

◆ WAKEUP_CATCHUP_WINDOW

#define WAKEUP_CATCHUP_WINDOW   (WAKEUP_EVENT_WINDOW / 2)

Reduced gap, in seconds, between events caught up after a time change or after the service was disabled (e.g.

low power mode).

◆ WAKEUP_EVENT_WINDOW

#define WAKEUP_EVENT_WINDOW   60

Time reserved around each event, in seconds, in which no other event can be scheduled.

Typedef Documentation

◆ WakeupId

typedef int32_t WakeupId

WakeupId is an identifier for a wakeup event.

Function Documentation

◆ wakeup_enable()

void wakeup_enable ( bool  enabled)

Enable or disable the service.

While disabled no event fires; pending ones are caught up when re-enabled.

Parameters
enabledTrue to enable.

◆ wakeup_get_current()

TimerID wakeup_get_current ( void  )

Get the timer used to schedule events, for tests.

Returns
Timer identifier.

◆ wakeup_get_next_scheduled()

WakeupId wakeup_get_next_scheduled ( void  )

Get the next scheduled event, for tests.

Returns
Event identifier.

◆ wakeup_handle_clock_change()

void wakeup_handle_clock_change ( void  )

Handle any time change, including small RTC calibrations.

Reschedules the next event without deleting events or showing popups.

◆ wakeup_handle_significant_clock_change()

void wakeup_handle_significant_clock_change ( void  )

Handle a significant time change (over 15 s, timezone or DST).

Deletes past events, shows missed event popups and reschedules, on KernelBG.

◆ wakeup_init()

void wakeup_init ( void  )

Initialize the service.

Deletes expired events, shows a popup for apps that missed an event while the watch was off and asked to be notified, and schedules the next event.

◆ wakeup_migrate_timezone()

void wakeup_migrate_timezone ( int  utc_diff)

Convert events scheduled in local time to UTC after the timezone was set.

Parameters
utc_diffLocal time minus UTC, in seconds.