Pebble App Framework
v7.1.1
How It Works
CLI
Device API
Phone API
C Coverage
TS Coverage
GitHub
Theme
Pebble App Framework: Device API
Toggle main menu visibility
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
33
typedef
struct
34
{
35
bool
live
;
36
}
PhoneConfig
;
37
41
typedef
struct
42
{
43
int
battery
;
44
}
PhoneSeed
;
45
55
void
phone_store_init
(
PhoneConfig
cfg,
const
PhoneSeed
*seed);
56
58
void
phone_store_subscribe
(
void
(*cb)(
void
));
59
66
int
phone_store_battery
(
void
);
67
78
bool
phone_store_no_plugin
(
void
);
79
phone_store_no_plugin
bool phone_store_no_plugin(void)
Whether the phone said no plugin on it serves the battery.
Definition
phone_store.c:154
phone_store_battery
int phone_store_battery(void)
The phone's battery level.
Definition
phone_store.c:144
phone_store_subscribe
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
phone_store_init
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
phone_level.h
Reads the phone's battery level as the phone sends it.
PhoneConfig
The rules a face hands the store.
Definition
phone_store.h:34
PhoneConfig::live
bool live
True takes the phone's readings and asks for them. False just keeps the seed for screenshots.
Definition
phone_store.h:35
PhoneSeed
Optional prefill, or pinned state when live = false.
Definition
phone_store.h:42
PhoneSeed::battery
int battery
The phone's level from 0 to 100, -1 for none, or -2 for no plugin.
Definition
phone_store.h:43
src
c
pebble
io
stores
phone_store.h
Generated by
1.18.0