How nordicsemiconductor/android-nrf-connect-device-manager works
Main Components
• Core Library (mcumgr-core): This module holds the transport-independent implementation of the McuManager protocol. It contains the basic framework, common utilities, managers (such as DefaultManager, ImageManager, BasicManager, StatsManager, CrashManager, SettingsManager, LogManager, FsManager, ShellManager), and response classes.
• BLE Transport Module (mcumgr-ble): A dedicated module that implements BLE transport using Nordic’s Android-BLE-Library. It builds on the core to provide Bluetooth-specific communication with the devices.
• Sample Application (sample): A demo application that uses the library – it not only demonstrates how to consume the API but also incorporates dependency injection (with Dagger 2), UI fragments, activities, and supporting resources.
• Build and Deployment Infrastructure: The root also includes Gradle build files, Fastlane scripts, GitHub workflows, and other infrastructure assets, which are important for continuous integration and deployment.
Relationships and Interactions
• The FirmwareUpgradeManager (part of the core) orchestrates the firmware upgrade process, interacting with the transport to send commands to the device.
• The BLE module provides the concrete implementation for the McuMgrTransport interface. Represent this as an implementation detail that “plugs into” the core library.
• The external dependency on the Nordic BLE library and any other significant frameworks (e.g., for dependency injection and asynchronous task management) can be drawn as external systems or libraries that interact with your BLE module or sample app.
Architectural Patterns
• Layered/Modular Architecture: The separation between transport-agnostic core functionality (protocol and managers) and the specific BLE transport module is a clear case of modular design.