The zephyr_grp log module name was incorrectly named
MGMT_SETTINGS and module registration has been using module name
mgmt_zephyr_basic, which is also incorrect.
Both have been changed to mcumgr_zephyr_grp.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds transport dedicated menu and gathers all transport
options under that menu; each transport gets its own menu, witch
gathers options specific for that transport
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Adds new command that allows to retrieve MCUMGR parameters.
Currently the command returns MCUMGR buffer size and count.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The IMG_MGMT_UL_CHUNK_SIZE is no longer used to control size of
intermediate buffer used for application image chunk processing,
instead directly request trasport buffer is used.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The echo sentence is now directly copied from request transport
buffer to response buffer, without use of intermediate buffer.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Now the chunk of uploaded file is directly read from the transport
buffer, net_buf, and is no longer copied into intermediate buffer
so the real size of chunk is actually how much the sender could
fit into MCUMGR_BUF_SIZE, less the other fields.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds private, for internal mcumgr use only, utility
function for bulk processing of CBOR map entries.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit switches OS group commands to use zcbor instead
of TinyCBOR for processing SMP requests.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Removes no longer needed elements of struct mgmt_ctxt.
Removes mgmt_ctxt_init, mgmt_streamer_init_reader and init_reader
from struct mgmt_streamer_cfg as they are no longer needed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit removes cbor_decoder_reader from cbo_nb_reader and
adds zcbor state variable to the structure.
All the code that has been supporting the cbor_decder_reader
has been removed and/or replaced with zcbor/net_buf specific.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Replaces TinyCBOR cbor_decoder_reader with cbor_nb_reader in
SMP processing code.
The SMP source code has been relying on internal elements of the
cbor_decoder_reader and had to be rewritten to use net_buf
structures, that are part of cbor_nb_reader, instead.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
With transition to zcbor, the cbor_encoder_writer structure of
TinyCBOR is no longer used.
This commit replaces the structure with cbor_nb_writer, which
gathers zcbor processing structure with netbuf into one object.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit modifies cbor_nb_writer to handle zcbor.
Proper initialization code has been added to cbor_nb_writer_init.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add a name for the choice of authentication modes so that it
can be default to a certain type in project's Kconfig.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The commit splits the main mcumgr Kconfigs into primary Kconfig
that collect general mcumgr options for Zephyr (Zephyr specific
commands, transports, and so on), into lib/Kconfig
that collects library options and command groups' Kconfigs.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Previously, the hash of the firmware is checked while we are
downloading the firmware. This isn't ideal as the validity of
the firmware written into the flash is not verified and can be
corrupted. Furthermore, checking while downloading will have an
negative impact to the download speed as the CPU need to do
more work during the data transfer.
This PR removes the previous verify-hash-while-download
implementation and use the flash_img_check API instead.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
After the firmware is downloaded in hawkbit_probe, a series of
operations are done by using the fact that the conditions of
an if-else statement will be ran until a match.
This patches separate these condition into individual
if-condition for better readability
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The commit add checks whether frame received from BT transport
will really fit into allocated net_buf form mcumgr.
Fixes: #44271
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit moves shell command buffer to stack and changes
initialization to just just put null at the beginning, before calling
a function that will fill in the buffer, and at the end, after the call.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Moves Zephyr specific code to common source file and removes
no longer needed interface headers.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit makes stats collection conditional so in case when
CBOR container encoding fails the stats collecting function
will not be called.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Fixes a twister test issue whereby handler_found and valid_hdr variables
are checked prior to being set.
Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
The IMG_MGMT_VERBOSE_ERR Kconfig option has not been really working
since the SMP response that it would setup was reset in case of
error, so in any instance that it would actually be used.
Fixes#32545
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds support for passing "rsn" explanation strings,
for "rc" code, in error SMP responses.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The zephyr_fs_mgmt_truncate has been replaced with fs_unlink
since there is no point to specially check for file existence
before just removing it.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The fs_mgmt_file_upload_rsp has been renamed fs_mgmt_file_rsp
and is used everywhere where "rc" code and "off" is placed into
response, instead of duplicating code that does the task.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>