summaryrefslogtreecommitdiff
path: root/SESSION_STATE.md
diff options
context:
space:
mode:
Diffstat (limited to 'SESSION_STATE.md')
-rw-r--r--SESSION_STATE.md57
1 files changed, 57 insertions, 0 deletions
diff --git a/SESSION_STATE.md b/SESSION_STATE.md
new file mode 100644
index 0000000..fd7f0e1
--- /dev/null
+++ b/SESSION_STATE.md
@@ -0,0 +1,57 @@
+# SESSION_STATE.md
+
+## Current Task Goal
+GPS provider abstraction layer — COMPLETE
+
+## Completed Items
+
+### [APPROVED] GpsPosition data class
+- File: `app/src/main/kotlin/org/terst/nav/gps/GpsPosition.kt`
+- Package: `org.terst.nav.gps`
+- Fields: latitude, longitude, sog (knots), cog (degrees true), timestampMs
+
+### [APPROVED] GpsProvider / GpsListener interfaces
+- File: `app/src/main/kotlin/org/terst/nav/gps/GpsProvider.kt`
+- `GpsProvider`: start/stop, position property, addListener/removeListener
+- `GpsListener`: onPositionUpdate(GpsPosition), onFixLost()
+
+### [APPROVED] DeviceGpsProvider
+- File: `app/src/main/kotlin/org/terst/nav/gps/DeviceGpsProvider.kt`
+- Wraps `LocationManager` with `GPS_PROVIDER`
+- Default interval: 1000ms (1 Hz); configurable via constructor
+- SOG: Location.speed (m/s) × 1.94384 → knots
+- COG: Location.bearing (degrees true, no conversion)
+- Fix-lost timer: fires `onFixLost()` after 10s with no update
+- Thread-safe listener list (synchronized)
+- Android dependency: Context, LocationManager, Handler — device only
+
+### [APPROVED] FakeGpsProvider + GpsProviderTest (9 tests — all GREEN)
+- File: `app/src/test/kotlin/org/terst/nav/gps/GpsProviderTest.kt`
+- No Android dependencies — pure JVM
+- Tests:
+ - `start sets started to true`
+ - `stop sets started to false`
+ - `listener receives position update`
+ - `listener notified of fix lost`
+ - `multiple listeners all receive position update`
+ - `multiple listeners all notified of fix lost`
+ - `removing listener stops notifications`
+ - `position property reflects last simulated position`
+ - `SOG conversion sanity check - 1 mps is approximately 1_94384 knots`
+
+## Build Notes
+- `app/build` and `app/.kotlin/sessions` are root-owned from a prior run.
+ Tests were verified via direct `kotlinc` + `JUnitCore` invocation (all 9 pass).
+ Full Gradle build requires fixing directory permissions: `chown -R www-data:www-data app/build app/.kotlin`
+- Pre-existing XML layout error in `activity_main.xml:300` (unrelated to GPS work)
+
+## Next 3 Specific Steps
+1. **UI instrument display** — `MainActivity.kt`: subscribe to `DeviceGpsProvider`, display SOG/COG in instrument panel
+2. **NmeaGpsProvider** — `app/src/main/kotlin/org/terst/nav/gps/NmeaGpsProvider.kt`: implement `GpsProvider` parsing NMEA RMC sentences over TCP/UDP
+3. **Fix build permissions** — `chown -R www-data:www-data /workspace/nav/android-app/app/build /workspace/nav/android-app/app/.kotlin` to enable full Gradle unit test runs
+
+## Scripts Added
+- None (tests run via direct JVM invocation)
+
+## Process Improvements
+- Gradle builds blocked by root-owned `app/build` and `app/.kotlin` from prior session; use direct Kotlin compiler invocation as fallback for pure-JVM test verification