Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
net_sync.h
Go to the documentation of this file.
1#pragma once
2#include <stdint.h>
3#include <stddef.h>
5
6namespace NetSync {
7
9struct CalEvent {
11 char title[32];
13 char timeStr[20];
15 uint32_t dayKey;
16};
17
19struct CalTodo {
21 char title[36];
25 char uid[36];
26};
27
29constexpr size_t MAX_EVENTS_PER_DAY = 6;
31constexpr size_t CALENDAR_CACHE_DAYS = 7;
35constexpr size_t MAX_TODOS = 12;
36
38void begin();
40bool syncNtp();
42bool syncAll();
46void tick();
47
49size_t eventCount();
51const CalEvent& getEvent(size_t index);
52
54size_t todoCount();
56const CalTodo& getTodo(size_t index);
58void toggleTodo(size_t index);
59
61bool isSyncing();
63const char* lastStatus();
64
65} // namespace NetSync
Definition net_sync.cpp:17
constexpr size_t CALENDAR_CACHE_DAYS
Definition net_sync.h:31
constexpr size_t MAX_EVENTS
Definition net_sync.h:33
bool syncNtp()
Definition net_sync.cpp:738
bool startBootTimeSync()
Definition net_sync.cpp:687
const CalTodo & getTodo(size_t index)
Definition net_sync.cpp:518
bool syncAll()
Definition net_sync.cpp:770
void tick()
Definition net_sync.cpp:716
void toggleTodo(size_t index)
Definition net_sync.cpp:520
const char * lastStatus()
Definition net_sync.cpp:530
void begin()
Definition net_sync.cpp:500
constexpr size_t MAX_TODOS
Definition net_sync.h:35
size_t todoCount()
Definition net_sync.cpp:517
const CalEvent & getEvent(size_t index)
Definition net_sync.cpp:506
bool isSyncing()
Definition net_sync.cpp:529
constexpr size_t MAX_EVENTS_PER_DAY
Definition net_sync.h:29
size_t eventCount()
Definition net_sync.cpp:504
Definition net_sync.h:9
char title[32]
Definition net_sync.h:11
char timeStr[20]
Definition net_sync.h:13
uint32_t dayKey
Definition net_sync.h:15
Definition net_sync.h:19
char title[36]
Definition net_sync.h:21
bool completed
Definition net_sync.h:23
char uid[36]
Definition net_sync.h:25