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.
Meshtastic-Android
This is a tool for using Android (and Compose Desktop) with open-source mesh radios. For more information see our webpage: meshtastic.org. If you are looking for the device side code, see here.
This project is currently beta testing across various providers. If you have questions or feedback please Join our discussion forum or the Discord Group . We would love to hear from you!
Get Meshtastic
The easiest, and fastest way to get the latest beta releases is to use our github releases. It is recommend to use these with Obtainium to get the latest updates.
Alternatively, these other providers are also available, but may be slower to update.
The play store is the last to update of these options, but if you want to join the Play Store testing program go to this URL and opt-in to become a tester. If you encounter any problems or have questions, ask us on the discord, create an issue, or post in the forum and we'll help as we can.
Documentation
The project's documentation is generated with Dokka and hosted on GitHub Pages. It is automatically updated on every push to the main branch.
Generating Locally
You can generate the documentation locally to preview your changes.
- Run the Dokka task:
./gradlew dokkaGeneratePublicationHtml - View the output:
The generated HTML files will be located in the
build/dokka/htmldirectory. You can open theindex.htmlfile in your browser to view the documentation.
Architecture
Modern Android Development (MAD)
The app follows modern Android development practices, built on top of a shared Kotlin Multiplatform (KMP) Core:
- KMP Modules: Business logic (
core:domain), data sources (core:data,core:database,core:datastore), and communications (core:network,core:ble) are entirely platform-agnostic, targeting Android and Compose Desktop. - UI: JetBrains Compose Multiplatform (Material 3) using Compose Multiplatform resources.
- State Management: Unidirectional Data Flow (UDF) with ViewModels, Coroutines, and Flow.
- Dependency Injection: Koin with Koin Annotations (K2 Compiler Plugin).
- Navigation: JetBrains Navigation 3 (Multiplatform routing with RESTful deep linking).
- Data Layer: Repository pattern with Room KMP (local DB), DataStore (prefs), and Protobuf (device comms).
Bluetooth Low Energy (BLE)
The BLE stack uses a multiplatform interface-driven architecture. Platform-agnostic interfaces live in commonMain, utilizing the Kable multiplatform BLE library to handle device communication across all supported targets (Android, Desktop). This provides a robust, Coroutine-based architecture for reliable device communication while remaining fully KMP compatible. See core/ble/README.md for details.
Translations
You can help translate the app into your native language using Crowdin.
API & Integration
Developers can integrate with the Meshtastic Android app using our published API library via JitPack. This allows third-party applications (like the ATAK plugin) to communicate with the mesh service via AIDL.
For detailed integration instructions, see core/api/README.md.
Additionally, the app includes a built-in Local TAK Server feature that can be enabled in settings. This runs a local TCP server on port 8089 to allow ATAK clients to connect directly and route their traffic over the mesh.
Building the Android App
Warning
Debug and release builds can be installed concurrently. This is solely to enable smoother development, and you should avoid running both apps simultaneously. To ensure proper function, force quit the app not in use.
https://meshtastic.org/docs/development/android/
Note: when building the google flavor locally you will need to supply your own Google Maps Android SDK api key MAPS_API_KEY in local.properties in order to use Google Maps.
e.g.
MAPS_API_KEY=your_google_maps_api_key_here
Contributing guidelines
For detailed instructions on how to contribute, please see our CONTRIBUTING.md file. For details on our release process, see the RELEASE_PROCESS.md file.
Repository Statistics
Copyright 2025, Meshtastic LLC. GPL-3.0 license




![Download at https://play.google.com/store/apps/details?id=com.geeksville.mesh]](https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png)