Loading...
Searching...
No Matches
dev_config.h
Go to the documentation of this file.
1
19#pragma once
20#include <pebble.h>
21#include "health/hrv_log.h"
24
29
36
38typedef struct
39{
40 const uint32_t *key;
42 int32_t number;
43 const char *text;
45
47typedef enum
48{
49 DEV_STORE_WEATHER,
50 DEV_STORE_HEALTH,
51 DEV_STORE_SYSTEM,
52 DEV_STORE_PHONE,
53 DEV_STORE_MUSIC,
54 DEV_STORE_STOCKS,
55 DEV_STORE_CALENDAR,
56 DEV_STORE_LOCATION,
58} DevStore;
59
61#define DEV_NONE 0xFF
62
64typedef struct
65{
66 uint16_t first;
67 uint16_t count;
68 const char *layout;
69 uint8_t readings;
70} DevStep;
71
73typedef struct
74{
75 uint16_t minute;
76 uint8_t date;
79
81typedef struct
82{
83 int16_t year;
84 uint8_t month;
85 uint8_t day;
86 uint8_t weekday;
87 uint16_t year_day;
88} DevDate;
89
91typedef struct
92{
93 uint16_t first;
94 uint16_t count;
95} DevRun;
96
98typedef struct
99{
100 int panel;
101 int size;
102} DevPanel;
103
105typedef struct
106{
107 uint8_t hour;
108 uint8_t bpm;
110
112typedef struct
113{
114 uint16_t minute;
115 uint8_t ms;
117 bool asleep;
119
121typedef struct
122{
123 const char *title;
124 const char *location;
125 bool all_day;
126 int32_t in_minutes;
127 int32_t minutes;
128 int32_t in_days;
129} DevEvent;
130
132typedef struct
133{
136 uint16_t hr_day_count;
138 uint16_t hrv_count;
139} DevHealth;
140
142typedef struct
143{
145 int32_t alarm_in_min;
146} DevSystem;
147
155void dev_show_panel(int panel, int size);
156
164void dev_show_layout(const char *layout);
165
166#if DEV_MODE
167
175
184bool dev_config_holds(uint32_t key);
185
192uint8_t dev_config_pick(DevStore store);
193
200void dev_config_pin(struct tm *when);
201
208bool dev_config_seed(DevStore store);
209
216uint16_t dev_config_walk_count(void);
217
226void dev_config_walk_show(uint16_t step);
227
228#else
229
231static inline void dev_config_apply_settings(void) {}
232
234static inline uint8_t dev_config_pick(DevStore store) { (void)store; return DEV_NONE; }
235
237static inline void dev_config_pin(struct tm *when) { (void)when; }
238
240static inline bool dev_config_seed(DevStore store) { (void)store; return false; }
241
243static inline uint16_t dev_config_walk_count(void) { return 0; }
244
246static inline void dev_config_walk_show(uint16_t step) { (void)step; }
247
248#endif
249
HrvState
What the wearer was doing through a reading's burst.
Definition hrv_log.h:34
static uint8_t dev_config_pick(DevStore store)
Has no seeds with dev mode off.
Definition dev_config.h:234
static void dev_config_walk_show(uint16_t step)
Does nothing with dev mode off.
Definition dev_config.h:246
#define DEV_NONE
The mark for no pick in a set of readings: a store left to the fixture, or a date left to the watch.
Definition dev_config.h:61
static void dev_config_pin(struct tm *when)
Leaves the time alone with dev mode off.
Definition dev_config.h:237
void dev_show_layout(const char *layout)
Shows one whole layout, for a walk with a step that has one. The face defines it, and the dev plugin ...
static uint16_t dev_config_walk_count(void)
Has no walk with dev mode off.
Definition dev_config.h:243
DevValueType
How a setting's value travels, the way the settings page sends it.
Definition dev_config.h:32
DevStore
The stores a dev build seeds, for asking whether the config seeds one.
Definition dev_config.h:48
static bool dev_config_seed(DevStore store)
Seeds nothing with dev mode off.
Definition dev_config.h:240
void dev_show_panel(int panel, int size)
Shows one panel on its own at one size, for a walk that lists panels. The face defines it,...
static void dev_config_apply_settings(void)
Does nothing with dev mode off.
Definition dev_config.h:231
@ DEV_VALUE_TEXT
Text.
Definition dev_config.h:34
@ DEV_VALUE_NUMBER
A whole number, a toggle as 0 or 1, or a colour as 0xRRGGBB.
Definition dev_config.h:33
@ DEV_STORE_COUNT
How many stores there are, not a store of its own.
Definition dev_config.h:57
Active health store. It subscribes to the watch's health service itself and holds the readings,...
The heart rate variability readings kept for a face's panels: the last few with what the wearer was d...
A pinned date, counted the way a struct tm counts it.
Definition dev_config.h:82
uint16_t year_day
0 for the first of January
Definition dev_config.h:87
uint8_t month
0 for January
Definition dev_config.h:84
uint8_t weekday
0 for Sunday
Definition dev_config.h:86
int16_t year
Years since 1900.
Definition dev_config.h:83
uint8_t day
The day of the month.
Definition dev_config.h:85
One agenda event, placed against the watch's clock when the stores are seeded.
Definition dev_config.h:122
int32_t in_days
For an all-day event, how many days after today it falls.
Definition dev_config.h:128
int32_t minutes
For a timed event, how long it runs.
Definition dev_config.h:127
bool all_day
True for an all-day event.
Definition dev_config.h:125
int32_t in_minutes
For a timed event, how many minutes from now it starts.
Definition dev_config.h:126
const char * location
The place, or empty.
Definition dev_config.h:124
const char * title
The title.
Definition dev_config.h:123
One health seed, with the day's heart rate and the HRV log the store builds from it.
Definition dev_config.h:133
uint16_t hr_day_count
How many readings hr_day holds.
Definition dev_config.h:136
const DevHrvReading * hrv_log
The HRV log, or NULL to leave it out.
Definition dev_config.h:137
HealthSeed seed
The readings and curves the seed takes as they are.
Definition dev_config.h:134
uint16_t hrv_count
How many readings hrv_log holds.
Definition dev_config.h:138
const DevHourReading * hr_day
The day's heart rate, or NULL to leave that part out.
Definition dev_config.h:135
One heart rate reading for the day's chart.
Definition dev_config.h:106
uint8_t bpm
The reading.
Definition dev_config.h:108
uint8_t hour
The hour it lands in, 0 for midnight.
Definition dev_config.h:107
One HRV reading for the log, placed by its minute of the day.
Definition dev_config.h:113
HrvState state
What the wearer was doing.
Definition dev_config.h:116
bool asleep
Whether Pebble said the wearer was asleep.
Definition dev_config.h:117
uint8_t ms
The reading.
Definition dev_config.h:115
uint16_t minute
Its minute of the day, which is never after the pinned clock.
Definition dev_config.h:114
One screen of a panel walk.
Definition dev_config.h:99
int panel
The panel, as the face's C knows it.
Definition dev_config.h:100
int size
Its size, as the face's C knows it.
Definition dev_config.h:101
The clock, date, and seeds one screen shows. The launch's comes first in the table.
Definition dev_config.h:74
uint8_t store[DEV_STORE_COUNT]
Which seed each store takes, by DevStore, or DEV_NONE for the fixture.
Definition dev_config.h:77
uint8_t date
Which pinned date, or DEV_NONE for the watch's own.
Definition dev_config.h:76
uint16_t minute
The pinned clock, as minutes past midnight.
Definition dev_config.h:75
A run of rows in a table, such as one agenda's events.
Definition dev_config.h:92
uint16_t count
How many rows it holds.
Definition dev_config.h:94
uint16_t first
Where the run starts.
Definition dev_config.h:93
One setting the config applies, by its message key.
Definition dev_config.h:39
DevValueType type
How the value travels.
Definition dev_config.h:41
const uint32_t * key
The MESSAGE_KEY_ it goes on, which the SDK fills in at launch.
Definition dev_config.h:40
int32_t number
The value, for a number.
Definition dev_config.h:42
const char * text
The value, for text.
Definition dev_config.h:43
One screen of a walk the config lays out as steps.
Definition dev_config.h:65
uint8_t readings
Which set of readings it shows, by its place in the table of sets.
Definition dev_config.h:69
const char * layout
What it hands dev_show_layout, or NULL to leave the layout alone.
Definition dev_config.h:68
uint16_t first
Where its settings start in the walk's settings table.
Definition dev_config.h:66
uint16_t count
How many settings it applies.
Definition dev_config.h:67
One system seed, with its next alarm counted from when the stores are seeded.
Definition dev_config.h:143
int32_t alarm_in_min
Minutes until the next alarm, or 0 for none.
Definition dev_config.h:145
SystemSeed seed
The battery and the link.
Definition dev_config.h:144
Optional prefill, or pinned readings when live = false. A part's seed is only taken when the face nam...
Definition health_store.h:113
Optional prefill, or pinned state when live = false.
Definition system_store.h:88
Active system store: the watch's own battery, bluetooth and next-alarm state. It subscribes to the ba...