The agenda as the phone packs it, and the reader that unpacks it. More...
Go to the source code of this file.
Data Structures | |
| struct | CalendarEvent |
| One event. start and end are absolute epochs so the readouts stay fresh against the watch's own clock. The phone fills end with a sensible default when the feed omits DTEND. More... | |
| struct | CalendarStrip |
| The agenda strip. count is 0 until a reading lands. More... | |
Functions | |
| bool | calendar_wire_decode (const uint8_t *buf, uint16_t len, CalendarStrip *out) |
| Unpacks an agenda off the wire. | |
The agenda as the phone packs it, and the reader that unpacks it.
The phone sends the agenda as one run of bytes with the events laid end to end, each carrying its own lengths. Nothing about it is fixed width, so the reader walks it and checks every step against the length it was handed. The bytes come off a phone, so none of it is trusted: the lengths are the phone's word for how long things are and the room is ours.
The packer on the other side is ts/pkjs/wire.ts, and the two have to agree exactly.