Skip to content

log_mgmt: Add support for number of log entries in mcumgr#172

Closed
vrahane wants to merge 1 commit intoapache:masterfrom
vrahane:vipul/log_num_entries_support
Closed

log_mgmt: Add support for number of log entries in mcumgr#172
vrahane wants to merge 1 commit intoapache:masterfrom
vrahane:vipul/log_num_entries_support

Conversation

@vrahane
Copy link
Contributor

@vrahane vrahane commented Mar 21, 2024

This adds support for pulling number of entries from individual logs given the index. This change is backwards compatible and does not break anything.

Related mynewt-core PR: apache/mynewt-core#3168
Related mynewt-newtmgr PR: apache/mynewt-newtmgr#205

Example:
Successful/Valid case:

$newtmgr --connstring peer_name="my_dev" --conntype oic_ble log num_entries reboot_log 0
Number of entries: 43
$newtmgr --connstring peer_name="my_dev" --conntype oic_ble log show reboot_log
Status: 0
Next index: 482
Name: reboot_log
Type: STORAGE
   [num_entries]    [index]            [timestamp] |         [module]          [level] [type]    [img] [message]
               0         16     1578455591078191us |       REBOOT (6)     CRITICAL (4)   cbor 71983333 {"cnt":311,"flags":"active bootable confirmed","hash":"719833337dcbb8cb4c0fc7356799faffde5614b93db2762eb769a7e6da3e7c95","img":"24.3.25.121935","rsn":"OTHER: 0x0"}
               1        416     1578474526687539us |       REBOOT (6)     CRITICAL (4)   cbor 9d378656 {"cnt":312,"flags":"active bootable confirmed","hash":"9d37333354ec570426e4284708a1b6d3a66278ee4633f705bb379d331331fe04","img":"24.3.25.173430","rsn":"OTHER: 0x0"}

Error case:

<Invalid log>
$newtmgr --connstring peer_name="my_dev" --conntype oic_ble log num_entries reboot 0
error: 5

<Invalid index>
$newtmgr --connstring peer_name="my_dev" --conntype oic_ble log num_entries reboot 4000
error: 5

@vrahane vrahane force-pushed the vipul/log_num_entries_support branch from c6913a2 to 680807e Compare May 31, 2024 23:56
@vrahane vrahane closed this Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant