Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ calibration offsets.
- **Blood pressure calibration** (Settings → Calibration) — enter reference systolic/diastolic values from a cuff to apply an offset. 56ff/Jring only.
- **Blood sugar calibration** (Settings → Calibration) — enter a reference glucose reading from lab work or a glucometer to calibrate the ring's profile-derived blood sugar estimates. 56ff/Jring only.
- **Privacy & Data** (Settings → Privacy & Data) — demo-data controls (reseed/clear) and the anonymized diagnostics export for bug reports.
- **MQTT** (Settings → MQTT) — publishes real ring vitals, daily activity, sleep stages, and live workout streaming (~5 s throttle) to any MQTT broker with configurable topics, auto-discovery payloads, and background sync intervals. See [docs/mqtt.md](docs/mqtt.md) for topic formats, capability-based sensor selection, and example payloads.

### Simplified Ring Management
- **Forget ring** — removes the ring from the app in one tap. The unbind command is sent to the ring to release it for pairing with other apps.
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/pulseloop/data/dao/Daos.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ interface MeasurementDao {
@Query("SELECT value FROM measurements WHERE kindRaw = :kind AND timestamp <= :before ORDER BY timestamp DESC LIMIT 1")
suspend fun latest(kind: String, before: Long = System.currentTimeMillis()): Double?

/** Latest real (non-demo/mock) measurement of [kind], for exports (MQTT) that must never surface seeded demo data. */
@Query("SELECT * FROM measurements WHERE kindRaw = :kind AND sourceRaw NOT IN ('demo','mock') ORDER BY timestamp DESC LIMIT 1")
suspend fun latestReal(kind: String): MeasurementEntity?

/** Newest measurement of any kind — iOS `latestMeasurementTimestamp()`, the live-data leg of
* the coach check-in's hasRecentData freshness fallback. */
@Query("SELECT MAX(timestamp) FROM measurements")
Expand Down
Loading
Loading