Loading...
Searching...
No Matches
calendar_wire.h
Go to the documentation of this file.
1
14#pragma once
15#include <stdbool.h>
16#include <stdint.h>
17#include <time.h>
18
23
24// CALENDAR_SLOTS_MAX, CAL_TITLE_LEN and CAL_LOC_LEN are generated from the phone's cap table, so
25// the two sides of the strip cannot drift
26#include "wire/wire_caps.g.h"
27
32typedef struct
33{
34 time_t start;
35 time_t end;
36 bool all_day;
40
42typedef struct
43{
44 uint8_t count;
47
63bool calendar_wire_decode(const uint8_t *buf, uint16_t len, CalendarStrip *out);
64
bool calendar_wire_decode(const uint8_t *buf, uint16_t len, CalendarStrip *out)
Unpacks an agenda off the wire.
Definition calendar_wire.c:12
One event. start and end are absolute epochs so the readouts stay fresh against the watch's own clock...
Definition calendar_wire.h:33
bool all_day
True shows a weekday or date instead of a time.
Definition calendar_wire.h:36
char location[CAL_LOC_LEN]
The place, or empty when there is none.
Definition calendar_wire.h:38
time_t start
Absolute epoch of the event start.
Definition calendar_wire.h:34
time_t end
Absolute epoch of the event end so we can show how long it runs.
Definition calendar_wire.h:35
char title[CAL_TITLE_LEN]
The event summary, or empty when there is none.
Definition calendar_wire.h:37
The agenda strip. count is 0 until a reading lands.
Definition calendar_wire.h:43
uint8_t count
How many events are filled (0 means none yet).
Definition calendar_wire.h:44
Strip caps and marker values shared by the phone and the watch.
#define CAL_LOC_LEN
An event location, 16 characters plus its terminator.
Definition wire_caps.g.h:27
#define CAL_TITLE_LEN
An event title, 24 characters plus its terminator.
Definition wire_caps.g.h:26
#define CALENDAR_SLOTS_MAX
How many events the agenda strip carries.
Definition wire_caps.g.h:24