feat(telemetry): dotaz na polohu nahřeje duty-cyklovanou GPS na příště

Uzel s `gps duty` odpovídal na telemetrii polohou starou až celý
GPS_DUTY_SYNC_INTERVAL_SECS (u nás 30 min). Dotaz s LOCATION právem teď
předsune nejbližší okno na hned, takže NÁSLEDUJÍCÍ dotaz dostane čerstvou
polohu. Při periodickém sběru to stojí jeden cyklus a nepotřebuje to,
aby uzel cokoli věděl o rozvrhu sběru.

Čekat na fix v rámci té odpovědi nejde: odpověď se skládá a odesílá
synchronně (BaseChatMesh.cpp:290), zatímco warm fix trval na T1000-E
změřených ~65 s -- a klient čeká 10 s. Meshtastic to ostatně řeší stejně,
position request tam vrací poslední známou polohu a GPS jede na vlastním
`gps_update_interval`.

Metoda je na SensorManageru, takže ji mají obě implementace: T1000
(vlastní manager) i EnvironmentSensorManager (SenseCAPy). Budí jen když
uzel opravdu duty-cykluje -- `gps on` už běží a `gps off` je přání
uživatele, které telemetrický dotaz nemá přebíjet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pwhe5XoCuuEbBCNLvsJBPL
This commit is contained in:
tthandClaude Opus 5 committed 2026-09-01 00:19:09 +02:00
1 parent 7ffb8d0b8f
commit 9383ec2221
6 files changed
+37

No files matched your search

+6
View File
@@ -652,6 +652,12 @@ uint8_t MyMesh::onContactRequest(const ContactInfo &contact, uint32_t sender_tim
permissions &= perm_mask;
if (permissions & TELEM_PERM_BASE) { // only respond if base permission bit is set
if (permissions & TELEM_PERM_LOCATION) {
// Nudge a duty-cycled GPS awake. This reply still carries the position
// we already have -- the fix is ~65 s away and the reply goes out now --
// but the next request lands after the window and gets a fresh one.
sensors.requestLocationRefresh();
}
telemetry.reset();
telemetry.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f);
// query other sensors -- target specific