summaryrefslogtreecommitdiff
path: root/spike/settings/source/SpikeApp.mc
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-18 23:44:18 +0200
committercirakg <cirakg@cirakg.xyz>2026-10-18 23:44:18 +0200
commitac60fb060414261935ac5e158b26b34e211e1e06 (patch)
treea8f97e1c4b0bf8f1b433d3e8f33a5d30994e7c58 /spike/settings/source/SpikeApp.mc
parent93aa7e3aa291f3328cf34a5a2f86172f41d0affd (diff)
feat(spike): add the M1 settings spike app and make targets
A separate throwaway app (own app ID, no permissions) that shows what the Garmin Connect app delivers per settings field and writes values back, to measure the undocumented settings limits on the real phone and watch. Includes length-marked test strings, `make spike` / `make spike-sim`, `make vectors`, and step-by-step instructions in docs/SETTINGS_SPIKE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'spike/settings/source/SpikeApp.mc')
-rw-r--r--spike/settings/source/SpikeApp.mc43
1 files changed, 43 insertions, 0 deletions
diff --git a/spike/settings/source/SpikeApp.mc b/spike/settings/source/SpikeApp.mc
new file mode 100644
index 0000000..c5adcb2
--- /dev/null
+++ b/spike/settings/source/SpikeApp.mc
@@ -0,0 +1,43 @@
+// Author: cirakg & claude ai
+// Summary: Settings spike entry point: analyses every setting on start and on each change, and writes a status back.
+//
+// The spike measures what Garmin doesn't document (README section 16, M1):
+// how long a text setting may be, which characters survive, whether values
+// the watch writes back reach the phone, and when onSettingsChanged fires.
+// It is a throwaway app with its own app id; nothing here is reused by OTP
+// Wallet except the measured numbers.
+
+import Toybox.Application;
+import Toybox.Lang;
+import Toybox.WatchUi;
+
+class SpikeApp extends Application.AppBase {
+
+ // The analysis shown on screen, refreshed on start and on every change.
+ var report as SpikeReport;
+
+ function initialize() {
+ AppBase.initialize();
+ report = new SpikeReport();
+ }
+
+ // Read the values the watch already has (from the last sync).
+ function onStart(state as Dictionary?) as Void {
+ report.analyseOnStart();
+ DebugSelfTest.run(self);
+ }
+
+ function onStop(state as Dictionary?) as Void {
+ }
+
+ function getInitialView() as [Views] or [Views, InputDelegates] {
+ var view = new SpikeView(report);
+ return [view, new SpikeDelegate(view)];
+ }
+
+ // Called when you save the settings on the phone while the app runs.
+ function onSettingsChanged() as Void {
+ report.settingsChanged();
+ WatchUi.requestUpdate();
+ }
+}