Commit Graph

24 Commits

Author SHA1 Message Date
James Rich
a74d5d470a feat(core): implement batched node info handling for mesh handshake
This commit optimizes the mesh handshake protocol by introducing explicit support for `NodeInfoBatch` messages. It updates the configuration flow to handle both primary batched node delivery and legacy single-node delivery for backwards compatibility with older firmware.

Key changes include:

- **Batch Processing Optimization:**
    - Added `handleNodeInfoBatch` to the `MeshConfigFlowManager` interface to allow bulk processing of node information, reducing per-item overhead during the initial handshake.
    - Updated `MeshConfigFlowManagerImpl` to accumulate batched nodes efficiently using `addAll`.
    - Refactored `FromRadioPacketHandlerImpl` to delegate batch processing directly to the manager instead of iterating through individual items.

- **Handshake Protocol Updates:**
    - Updated `HandshakeConstants` to distinguish between `BATCH_NODE_INFO_NONCE` (primary Stage 2) and `NODE_INFO_NONCE` (legacy Stage 2).
    - Modified `handleConfigComplete` logic to trigger Stage 2 completion for both batched and legacy nonces.
    - Ensured `MeshConnectionManager` prioritizes the batch nonce when requesting node information.

- **Testing & Simulation:**
    - Created `MeshConfigFlowManagerImplTest` to validate node accumulation, batch handling, and handshake nonce routing.
    - Improved `MockInterface` to better simulate real-world packet ordering by delaying live traffic until after the handshake completion coroutine has processed the node database.
    - Added verification tests to ensure the connection manager uses the correct batching nonces.

Specific changes:
- Added `handleNodeInfoBatch` implementation to `MeshConfigFlowManagerImpl`.
- Updated documentation in `HandshakeConstants` regarding two-stage mesh handshake protocol.
- Refactored `MockInterface.sendStage2NodeInfoResponse` to handle packet encoding and simulation delays.
- Added unit tests covering edge cases for empty and mixed node info batches.
2026-04-03 10:51:17 -05:00
James Rich
b708b2ff76 feat: implement batched NodeInfo delivery in handshake protocol
This commit introduces support for `NodeInfoBatch` messages, allowing the application to receive and process multiple node records efficiently during the second stage of the device handshake. This replaces the legacy approach of sending node information individually, improving synchronization performance.

Key changes include:

- **Handshake Protocol:**
    - Added `BATCH_NODE_INFO_NONCE` to `HandshakeConstants`.
    - Updated `MeshConnectionManagerImpl` to request batched node information by default during the handshake process.
    - Updated `MeshConfigFlowManagerImpl` to handle the batch-specific completion nonce, ensuring Stage 2 of the handshake finalizes correctly.

- **Packet Handling:**
    - Enhanced `FromRadioPacketHandlerImpl` to detect `node_info_batch` packets.
    - Implemented logic to iterate through batched items and process each `NodeInfo` record via the `MeshConfigFlowManager`.
    - Updated connection progress reporting to reflect the count of nodes received within a batch.

- **Testing and Simulation:**
    - Updated `MockInterface` to simulate batched node delivery, refactoring the mock response logic into distinct Stage 1 (config) and Stage 2 (node info) phases.
    - Added a unit test in `FromRadioPacketHandlerImplTest` to verify that batched items are correctly routed and that the UI connection status is updated.

Specific changes:
- Modified `HandshakeConstants` to document the transition to batched NodeInfo delivery in Stage 2.
- Updated `MeshConnectionManagerImpl.startNodeInfoOnly()` to use the new batch nonce.
- Added `nodeInfoBatch` processing branch to the `handleFromRadio` logic.
2026-04-03 10:51:17 -05:00
James Rich
0167063497 feat(analytics): expand DataDog RUM integration and align with iOS parity (#4970) 2026-04-01 20:27:28 +00:00
James Rich
e249461e3c feat(tak): introduce built-in Local TAK Server and mesh integration (#4951)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-04-01 20:21:25 +00:00
James Rich
c75c9b34d6 feat: implement XModem file transfers and enhance BLE connection robustness (#4959) 2026-03-31 03:49:31 +00:00
James Rich
a005231d94 Refactor map layer management and navigation infrastructure (#4921)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-26 00:29:24 +00:00
James Rich
8ce17defb7 refactor: remove demoscenario and enhance BLE connection stability (#4914)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-25 14:24:42 +00:00
James Rich
96060a0a4d refactor: coroutine dispatchers and modernize testing infrastructure (#4901)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-24 01:31:48 +00:00
James Rich
57242d905c refactor: Consolidate UI preference handling (#4895) 2026-03-23 19:36:02 +00:00
James Rich
c38bfc64de Refactor command handling, enhance tests, and improve discovery logic (#4878)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-22 05:42:27 +00:00
James Rich
d136b162a4 feat: Implement iOS support and unify Compose Multiplatform infrastructure (#4876) 2026-03-21 23:19:13 +00:00
James Rich
c4087c2ab7 feat: Migrate to Room 3.0 and update related documentation and tracks (#4865) 2026-03-20 21:40:08 +00:00
James Rich
06b9f8c77a feat: Enhance test coverage (#4847)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-19 03:09:19 +00:00
James Rich
dcbbc0823b feat: Integrate Mokkery and Turbine into KMP testing framework (#4845) 2026-03-18 18:33:37 -05:00
James Rich
8c964a15ca feat: Integrate notification management and preferences across platforms (#4819)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-17 01:17:34 +00:00
James Rich
6e81ceec91 feat: Complete ViewModel extraction and update documentation (#4817) 2026-03-16 20:05:50 +00:00
James Rich
84bb6d24e4 docs: summarize KMP migration progress and architectural decisions (#4770)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-13 02:23:25 +00:00
James Rich
ac6bb5479b feat: introduce Desktop target and expand Kotlin Multiplatform (KMP) architecture (#4761)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-12 21:14:49 +00:00
James Rich
875cf1cff2 refactor: migrate from Hilt to Koin and expand KMP common modules (#4746)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-10 01:19:46 +00:00
James Rich
cffbd08806 refactor: migrate core modules to Kotlin Multiplatform and consolidat… (#4735)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-06 22:06:50 +00:00
James Rich
b9b68d2779 refactor: migrate preferences to DataStore and decouple core:domain for KMP (#4731) 2026-03-05 20:37:35 -06:00
James Rich
68b2b6d88e refactor(ble): improve connection lifecycle and enhance OTA reliability (#4721)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-05 18:58:34 +00:00
James Rich
b0258d0cf1 feat: Add "Mark all as read" and unread message count indicators (#4720) 2026-03-05 18:18:34 +00:00
James Rich
2c49db8041 feat/decoupling (#4685)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-03 13:15:28 +00:00