ble: barometer on its own connection - simultaneous HR+baro, auto-connect, UI
Separate BleBaroService so the HR strap and the barometer each hold their own GATT link and work at the same time (one adapter, several LE connections). Verified on device against a PC BlueZ emulator of the sensor: BleHR and BleBaro deliver in parallel, no cross-talk. - BleBaroService: dedicated baro connection (scan-before-connect + direct-connect fallback, ESS subscribe, writes ble_baro_data.json). MainActivity routes baro connects to it and auto-connects both HR (ble_device.json) and baro (baro_device.json) at start. - Rust: ble_baro_disconnect, ble_save_baro_device. - Settings: a 'Датчики (BLE)' section - heart-rate and barometer as separate rows with their own slots, bind/connect/unbind, and a live pressure/temperature/altitude readout. - Tracking: altitude_baro_m stored per point, preferred in elevation stats (null without baro). - Record screen: 'Высота' from the barometer (1 Hz, dot marker), temperature from the sensor. - Fixes: direct-connect on scan timeout; Locale.US JSON (RU decimal comma broke the parse); parsing routed by characteristic (baro no longer written into the pulse); VR/HR stop returns to the tracks list instead of into details. - tools/baro-sensor/emulate_baro.py: PC BlueZ peripheral that emulates the sensor for testing. Emulator-verified only; real board still pending.
This commit is contained in:
parent
82f3dc9d4a
commit
9251c1dd90
12 changed files with 653 additions and 34 deletions
|
|
@ -22,6 +22,27 @@
|
|||
## Состояние
|
||||
Проверено компиляцией (сборка 0.1.538, без ошибок). На устройстве НЕ проверено - нет железа.
|
||||
|
||||
## Продолжение того же дня: обвязка, UI, проверка эмулятором
|
||||
|
||||
Железа ещё нет, поэтому эмулировали датчик на ПК (`tools/baro-sensor/emulate_baro.py` -
|
||||
BlueZ D-Bus GATT-сервер, вещает ESS `0x181A` с давлением/температурой), телефон читал его
|
||||
реальным путём. Проверено на устройстве: `BleHR: HR:70` и `BleBaro: Baro:... Pa` одновременно.
|
||||
|
||||
Сделано:
|
||||
- `BleBaroService` - отдельный сервис/соединение для барометра, работает параллельно с
|
||||
пульсометром (один адаптер держит несколько LE-связей). Баро-подключения маршрутизируются
|
||||
в него из `MainActivity`. Авто-подключение при старте: баро из `baro_device.json`, пульс из
|
||||
`ble_device.json` (оба сами цепляются).
|
||||
- Rust: `ble_baro_disconnect`, `ble_save_baro_device`. JS сохраняет baro-устройство при привязке.
|
||||
- Настройки: секция "Датчики (BLE)" - пульсометр и барометр раздельно, свои слоты и кнопки,
|
||||
живой показ давления/температуры/высоты.
|
||||
- Трекинг: `altitude_baro_m` в точках, предпочитается в статистике высот (null без датчика).
|
||||
- Экран записи: "Высота" от барометра (обновление 1 Гц, пометка точкой), температура с датчика
|
||||
(белая, с десятой).
|
||||
- Починки по пути: directConnect при таймауте скана; Locale.US в JSON (была запятая от RU-локали);
|
||||
маршрутизация парсинга по характеристике (баро не писал в пульс); навигация после Стоп в VR/ЧСС
|
||||
(на список, а не в детали).
|
||||
|
||||
## Осталось (по приходу платы)
|
||||
- Активировать модуль: `BARO.start()` при подключении baro-устройства, задать `BARO.getGpsAlt`.
|
||||
- Привязать высоту барометра к треку поездки (в точки / поправка высот П.5).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue