Loading...
Searching...
No Matches
phone_store.h
Go to the documentation of this file.
1
20#pragma once
21#include <pebble.h>
22
23#include "wire/phone_level.h"
24
29
33typedef struct
34{
35 bool live;
37
41typedef struct
42{
43 int battery;
44} PhoneSeed;
45
55void phone_store_init(PhoneConfig cfg, const PhoneSeed *seed);
56
58void phone_store_subscribe(void (*cb)(void));
59
66int phone_store_battery(void);
67
78bool phone_store_no_plugin(void);
79
bool phone_store_no_plugin(void)
Whether the phone said no plugin on it serves the battery.
Definition phone_store.c:154
int phone_store_battery(void)
The phone's battery level.
Definition phone_store.c:144
void phone_store_subscribe(void(*cb)(void))
Hand it the function to call when the level changes (the screen redraw).
Definition phone_store.c:99
void phone_store_init(PhoneConfig cfg, const PhoneSeed *seed)
Start the store with its rules. Pass seed = NULL for normal use.
Definition phone_store.c:108
Reads the phone's battery level as the phone sends it.
The rules a face hands the store.
Definition phone_store.h:34
bool live
True takes the phone's readings and asks for them. False just keeps the seed for screenshots.
Definition phone_store.h:35
Optional prefill, or pinned state when live = false.
Definition phone_store.h:42
int battery
The phone's level from 0 to 100, -1 for none, or -2 for no plugin.
Definition phone_store.h:43