summaryrefslogtreecommitdiffstats
path: root/movement/watch_faces/complications/totp_face.h
diff options
context:
space:
mode:
authorWesley Ellis <tahnok@gmail.com>2021-11-22 21:20:57 -0500
committerWesley Ellis <tahnok@gmail.com>2021-11-22 21:37:21 -0500
commitb7ed9adb6c41089da75d258d7148fa87d2f76d20 (patch)
tree6cfe28b0652d193d46e36590cd831db68fc8fb85 /movement/watch_faces/complications/totp_face.h
parent7817e6696e438c8af74342ef10b576975a0e5448 (diff)
downloadSensor-Watch-b7ed9adb6c41089da75d258d7148fa87d2f76d20.tar.gz
Sensor-Watch-b7ed9adb6c41089da75d258d7148fa87d2f76d20.tar.bz2
Sensor-Watch-b7ed9adb6c41089da75d258d7148fa87d2f76d20.zip
Add initial TOTP watch face impl
Vendor code from https://github.com/Netthaw/TOTP-MCU to do the heavy lifting of computing SHA-1 and HMAC and the rest of TOTP Also implement a date_time to unix timestamp method
Diffstat (limited to 'movement/watch_faces/complications/totp_face.h')
-rw-r--r--movement/watch_faces/complications/totp_face.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/movement/watch_faces/complications/totp_face.h b/movement/watch_faces/complications/totp_face.h
new file mode 100644
index 00000000..1fecb82a
--- /dev/null
+++ b/movement/watch_faces/complications/totp_face.h
@@ -0,0 +1,19 @@
+#ifndef TOTP_FACE_H_
+#define TOTP_FACE_H_
+
+#include "movement.h"
+
+void totp_face_setup(movement_settings_t *settings, void ** context_ptr);
+void totp_face_activate(movement_settings_t *settings, void *context);
+bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
+void totp_face_resign(movement_settings_t *settings, void *context);
+
+static const watch_face_t totp_face = {
+ totp_face_setup,
+ totp_face_activate,
+ totp_face_loop,
+ totp_face_resign,
+ NULL
+};
+
+#endif // TOTP_FACE_H_ \ No newline at end of file