mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-17 02:23:49 +01:00
sys/sc_suit: add seq_no command
This commit is contained in:
parent
e3f9252947
commit
180be1d6ee
@ -23,15 +23,33 @@
|
|||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include "suit/transport/coap.h"
|
#include "suit/transport/coap.h"
|
||||||
|
#include "suit/storage.h"
|
||||||
|
|
||||||
|
static void _print_usage(char **argv)
|
||||||
|
{
|
||||||
|
printf("Usage: %s fetch <manifest url>\n", argv[0]);
|
||||||
|
printf(" %s seq_no\n", argv[0]);
|
||||||
|
}
|
||||||
|
|
||||||
int _suit_handler(int argc, char **argv)
|
int _suit_handler(int argc, char **argv)
|
||||||
{
|
{
|
||||||
if (argc != 2) {
|
if (argc < 2) {
|
||||||
printf("Usage: %s <manifest url>\n", argv[0]);
|
_print_usage(argv);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
suit_coap_trigger((uint8_t *)argv[1], strlen(argv[1]));
|
if (strcmp(argv[1], "fetch") == 0) {
|
||||||
|
suit_coap_trigger((uint8_t *)argv[2], strlen(argv[2]));
|
||||||
|
}
|
||||||
|
else if (strcmp(argv[1], "seq_no") == 0) {
|
||||||
|
uint32_t seq_no = 0;
|
||||||
|
suit_storage_get_highest_seq_no(&seq_no);
|
||||||
|
printf("seq_no: %" PRIu32 "\n", seq_no);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_print_usage(argv);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user