GPS Device
Loading...
Searching...
No Matches
Data Log Command Handlers

Functions

static ERR_te datalog_cmd_list_handler (uint32_t argc, char **argv)
 CLI handler for the "list" command. Logs the names of all active data log handles.

Detailed Description

Function Documentation

◆ datalog_cmd_list_handler()

ERR_te datalog_cmd_list_handler ( uint32_t argc,
char ** argv )
static

CLI handler for the "list" command. Logs the names of all active data log handles.

Expected invocation: datalog list

Iterates over the internal handle pool and logs the name of every slot that is currently in use.

Parameters
[in]argcArgument count. Must be exactly 2.
[in]argvArgument list: argv[0] = "datalog", argv[1] = "list".
Returns
  • ERR_OK on success
  • ERR_INVALID_ARGUMENT if argc != 2

Definition at line 517 of file datalog.c.

517 {
518 if(argc != 2) {
519 LOG_ERROR(
520 internal_state.subsys,
521 internal_state.log_level,
522 "datalog_cmd_list_handler: invalid arguments"
523 );
525 }
526
527 for(uint32_t i = 0; i < CONFIG_DATALOG_MAX_OBJECTS; i++) {
528 if(internal_state.datalogs[i].in_use == true) {
529 LOG_INFO(
530 internal_state.subsys,
531 internal_state.log_level,
532 "%s",
533 internal_state.datalogs[i].name
534 );
535 }
536 }
537
538 return ERR_OK;
539}
static struct internal_state_s internal_state
Singleton instance of the SysTick driver internal state.
@ ERR_OK
Definition err.h:36
@ ERR_INVALID_ARGUMENT
Definition err.h:38
#define LOG_ERROR(subsys, lvl, fmt,...)
Definition log.h:258
#define LOG_INFO(subsys, lvl, fmt,...)
Definition log.h:255