diff options
| author | Claudomator Agent <agent@claudomator> | 2026-03-14 01:47:20 +0000 |
|---|---|---|
| committer | Claudomator Agent <agent@claudomator> | 2026-03-14 01:47:20 +0000 |
| commit | 010d25c3e7e37ba109117a93e4d1c0f8802b01a9 (patch) | |
| tree | 13240873666277df79eab89d71643ee9f00d7158 /SESSION_STATE.md | |
| parent | 3f18f770e9d33c5e5d0657c6160fa8f30b21831f (diff) | |
Add GpsProvider interface and DeviceGpsProvider (FusedLocation)
- GpsPosition: lat/lon/sog (knots)/cog (degrees true)/timestampMs
- GpsProvider + GpsListener interfaces for provider abstraction
- DeviceGpsProvider wraps LocationManager GPS_PROVIDER (1 Hz default)
SOG: m/s × 1.94384 knots; fix-lost timeout 10s
- FakeGpsProvider + 9 passing JVM unit tests (no Android deps)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'SESSION_STATE.md')
| -rw-r--r-- | SESSION_STATE.md | 57 |
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 |
