Pebble Foundation Classes
0.2.0
C++ for Pebble
|
Handling time components. More...
Classes | |
class | Pebble::TickTimer |
Typedefs | |
typedef void(* | TickHandler) (struct tm *tick_time, TimeUnits units_changed) |
typedef void(* | TickHandler) (struct tm *tick_time, TimeUnits units_changed) |
Enumerations | |
enum | TimeUnits { SECOND_UNIT = 1 << 0, MINUTE_UNIT = 1 << 1, HOUR_UNIT = 1 << 2, DAY_UNIT = 1 << 3, MONTH_UNIT = 1 << 4, YEAR_UNIT = 1 << 5, SECOND_UNIT = 1 << 0, MINUTE_UNIT = 1 << 1, HOUR_UNIT = 1 << 2, DAY_UNIT = 1 << 3, MONTH_UNIT = 1 << 4, YEAR_UNIT = 1 << 5 } |
enum | TimeUnits { SECOND_UNIT = 1 << 0, MINUTE_UNIT = 1 << 1, HOUR_UNIT = 1 << 2, DAY_UNIT = 1 << 3, MONTH_UNIT = 1 << 4, YEAR_UNIT = 1 << 5, SECOND_UNIT = 1 << 0, MINUTE_UNIT = 1 << 1, HOUR_UNIT = 1 << 2, DAY_UNIT = 1 << 3, MONTH_UNIT = 1 << 4, YEAR_UNIT = 1 << 5 } |
Functions | |
void | tick_timer_service_subscribe (TimeUnits tick_units, TickHandler handler) |
void | tick_timer_service_unsubscribe (void) |
Handling time components.
The TickTimerService allows your app to be called every time one Time component has changed. This is extremely important for watchfaces. Your app can choose on which time component change a tick should occur. Time components are defined by a TimeUnits enum bitmask.
Callback type for tick timer events
tick_time | the time at which the tick event was triggered |
units_changed | which unit change triggered this tick event |
Callback type for tick timer events
tick_time | the time at which the tick event was triggered |
units_changed | which unit change triggered this tick event |
enum TimeUnits |
Time unit flags that can be used to create a bitmask for use in tick_timer_service_subscribe(). This will also be passed to TickHandler.
enum TimeUnits |
Time unit flags that can be used to create a bitmask for use in tick_timer_service_subscribe(). This will also be passed to TickHandler.
void tick_timer_service_subscribe | ( | TimeUnits | tick_units, |
TickHandler | handler | ||
) |
Subscribe to the tick timer event service. Once subscribed, the handler gets called on every requested unit change. Calling this function multiple times will override the units and handler (i.e., only the last tick_units and handler passed will be used).
handler | The callback to be executed on tick events |
tick_units | a bitmask of all the units that have changed |
void tick_timer_service_unsubscribe | ( | void | ) |
Unsubscribe from the tick timer event service. Once unsubscribed, the previously registered handler will no longer be called.