PX4 Firmware
PX4 Autopilot Software http://px4.io
param.cpp File Reference
#include <px4_platform_common/px4_config.h>
#include <px4_platform_common/log.h>
#include <px4_platform_common/module.h>
#include <px4_platform_common/posix.h>
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
#include <inttypes.h>
#include <sys/stat.h>
#include <arch/board/board.h>
#include <parameters/param.h>
#include "systemlib/err.h"
Include dependency graph for param.cpp:

Go to the source code of this file.

Macros

#define PARAM_PRINT   PX4_INFO_RAW
 

Enumerations

enum  COMPARE_OPERATOR { COMPARE_OPERATOR::EQUAL = 0, COMPARE_OPERATOR::GREATER = 1 }
 
enum  COMPARE_ERROR_LEVEL { COMPARE_ERROR_LEVEL::DO_ERROR = 0, COMPARE_ERROR_LEVEL::SILENT = 1 }
 

Functions

__BEGIN_DECLS __EXPORT int param_main (int argc, char *argv[])
 
static int do_save (const char *param_file_name)
 
static int do_save_default ()
 
static int do_load (const char *param_file_name)
 
static int do_import (const char *param_file_name)
 
static int do_show (const char *search_string, bool only_changed)
 
static int do_show_all ()
 
static int do_show_quiet (const char *param_name)
 
static int do_show_index (const char *index, bool used_index)
 
static void do_show_print (void *arg, param_t param)
 
static int do_set (const char *name, const char *val, bool fail_on_not_found)
 
static int do_compare (const char *name, char *vals[], unsigned comparisons, enum COMPARE_OPERATOR cmd_op, enum COMPARE_ERROR_LEVEL err_level)
 
static int do_reset (const char *excludes[], int num_excludes)
 
static int do_touch (const char *params[], int num_params)
 
static int do_reset_nostart (const char *excludes[], int num_excludes)
 
static int do_find (const char *name)
 
static void print_usage ()
 

Detailed Description

Author
Lorenz Meier loren.nosp@m.z@px.nosp@m.4.io
Andreas Antener andre.nosp@m.as@u.nosp@m.avent.nosp@m.ure..nosp@m.com

Parameter tool.

Definition in file param.cpp.

Macro Definition Documentation

◆ PARAM_PRINT

#define PARAM_PRINT   PX4_INFO_RAW

Enumeration Type Documentation

◆ COMPARE_ERROR_LEVEL

enum COMPARE_ERROR_LEVEL
strong
Enumerator
DO_ERROR 
SILENT 

Definition at line 73 of file param.cpp.

◆ COMPARE_OPERATOR

enum COMPARE_OPERATOR
strong
Enumerator
EQUAL 
GREATER 

Definition at line 68 of file param.cpp.

Function Documentation

◆ do_compare()

static int do_compare ( const char *  name,
char *  vals[],
unsigned  comparisons,
enum COMPARE_OPERATOR  cmd_op,
enum COMPARE_ERROR_LEVEL  err_level 
)
static

Definition at line 724 of file param.cpp.

References DO_ERROR, EQUAL, f(), GREATER, param_find(), param_get(), PARAM_INVALID, param_name(), param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, param_value_is_default(), and param_value_unsaved().

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_find()

static int do_find ( const char *  name)
static

Definition at line 513 of file param.cpp.

References param_find_no_notification(), PARAM_INVALID, and PARAM_PRINT.

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_import()

static int do_import ( const char *  param_file_name)
static

Definition at line 423 of file param.cpp.

References fd, and param_import().

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_load()

static int do_load ( const char *  param_file_name)
static

Definition at line 393 of file param.cpp.

References fd, and param_load().

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_reset()

static int do_reset ( const char *  excludes[],
int  num_excludes 
)
static

Definition at line 802 of file param.cpp.

References param_reset_all(), and param_reset_excludes().

Referenced by Ekf::controlGpsFusion(), Ekf::controlOpticalFlowFusion(), and param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_reset_nostart()

static int do_reset_nostart ( const char *  excludes[],
int  num_excludes 
)
static

Definition at line 826 of file param.cpp.

References param_find(), param_get(), param_reset_all(), param_reset_excludes(), and param_set().

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_save()

static int do_save ( const char *  param_file_name)
static

Definition at line 368 of file param.cpp.

References fd, and param_export().

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_save_default()

static int do_save_default ( )
static

Definition at line 453 of file param.cpp.

References param_save_default().

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_set()

static int do_set ( const char *  name,
const char *  val,
bool  fail_on_not_found 
)
static

Definition at line 655 of file param.cpp.

References f(), param_find(), param_get(), PARAM_INVALID, param_name(), PARAM_PRINT, param_set(), param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, param_value_is_default(), and param_value_unsaved().

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_show()

static int do_show ( const char *  search_string,
bool  only_changed 
)
static

Definition at line 459 of file param.cpp.

References do_show_print(), param_count(), param_count_used(), param_foreach(), and PARAM_PRINT.

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_show_all()

static int do_show_all ( )
static

Definition at line 469 of file param.cpp.

References do_show_print(), param_count(), param_count_used(), param_foreach(), and PARAM_PRINT.

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_show_index()

static int do_show_index ( const char *  index,
bool  used_index 
)
static

Definition at line 527 of file param.cpp.

References param_for_index(), param_for_used_index(), param_get(), param_get_index(), param_get_used_index(), PARAM_INVALID, param_name(), PARAM_PRINT, param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, param_used(), param_value_is_default(), and param_value_unsaved().

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_show_print()

static void do_show_print ( void *  arg,
param_t  param 
)
static

Definition at line 574 of file param.cpp.

References f(), param_get(), param_get_index(), param_get_used_index(), param_name(), PARAM_PRINT, param_size(), param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, PARAM_TYPE_STRUCT, PARAM_TYPE_STRUCT_MAX, param_used(), param_value_is_default(), and param_value_unsaved().

Referenced by do_show(), and do_show_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_show_quiet()

static int do_show_quiet ( const char *  param_name)
static

Definition at line 479 of file param.cpp.

References param_find_no_notification(), param_get(), PARAM_INVALID, PARAM_PRINT, param_type(), PARAM_TYPE_FLOAT, and PARAM_TYPE_INT32.

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_touch()

static int do_touch ( const char *  params[],
int  num_params 
)
static

Definition at line 815 of file param.cpp.

References param_find(), and PARAM_INVALID.

Referenced by param_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ param_main()

int param_main ( int  argc,
char *  argv[] 
)

Definition at line 181 of file param.cpp.

References do_compare(), DO_ERROR, do_find(), do_import(), do_load(), do_reset(), do_reset_nostart(), do_save(), do_save_default(), do_set(), do_show(), do_show_all(), do_show_index(), do_show_quiet(), do_touch(), EQUAL, GREATER, param_get_default_file(), param_print_status(), param_set_default_file(), print_usage(), and SILENT.

Here is the call graph for this function:

◆ print_usage()

static void print_usage ( void  )
static

Definition at line 102 of file param.cpp.

Referenced by param_main().

Here is the caller graph for this function: