mcumgr-core

Core functionality of the Mcu Manager library.

This module defines the base transport interface, the protocol managers, and the response data structures used to communicate with devices running nRF Connect SDK, Zephyr, or Apache Mynewt.

Key Components

  • McuMgrTransport: The interface for sending and receiving SMP packets.

  • Managers: Specialized classes for different Mcu Manager groups:

    • DefaultManager: OS-level commands like echo, reset, and task statistics.

    • ImageManager: Firmware image management (list, upload, test, confirm).

    • FsManager: File system operations (download, upload).

    • StatsManager: Statistics retrieval.

    • LogManager: Log retrieval.

  • McuMgrResponse: Base class for all Mcu Manager responses, handling CBOR/JSON decoding.

Example

To use a manager, you need an implementation of McuMgrTransport (e.g., McuMgrBleTransport from the :mcumgr-ble module).

// Initialize a manager (e.g., DefaultManager)
DefaultManager manager = new DefaultManager(transport);

// Send an echo command asynchronously
manager.echo("Hello World!", new McuMgrCallback<McuMgrEchoResponse>() {
@Override
public void onResponse(@NonNull McuMgrEchoResponse response) {
// Handle success
String echo = response.r;
}

@Override
public void onError(@NonNull McuMgrException error) {
// Handle error
}
});

Packages

Link copied to clipboard

Contains core classes and interfaces, such as McuManager, McuMgrTransport, and McuMgrCallback.

Link copied to clipboard
Link copied to clipboard

Contains classes for firmware upgrade, including FirmwareUpgradeManager for McuBoot and SUIT.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Defines library-specific exceptions, like McuMgrException and McuMgrTimeoutException.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Contains all group managers used to interact with the device.

Link copied to clipboard

Contains the base response class and sub-packages for group-specific response DTO.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard