PX4 Firmware
PX4 Autopilot Software http://px4.io
flashparams.cpp File Reference
#include <px4_platform_common/defines.h>
#include <px4_platform_common/posix.h>
#include <px4_platform_common/shutdown.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <errno.h>
#include <parameters/param.h>
#include "systemlib/uthash/utarray.h"
#include <parameters/tinybson/tinybson.h>
#include "flashparams.h"
#include "flashfs.h"
Include dependency graph for flashparams.cpp:

Go to the source code of this file.

Classes

struct  param_wbuf_s
 Storage for modified parameters. More...
 
struct  param_import_state
 

Macros

#define debug(fmt, args...)   do { } while(0)
 

Functions

static int param_export_internal (bool only_unsaved)
 
static int param_import_callback (bson_decoder_t decoder, void *priv, bson_node_t node)
 
static int param_import_internal (bool mark_saved)
 
int flash_param_save (bool only_unsaved)
 
int flash_param_load ()
 
int flash_param_import ()
 

Macro Definition Documentation

◆ debug

#define debug (   fmt,
  args... 
)    do { } while(0)

Function Documentation

◆ flash_param_import()

int flash_param_import ( )

Definition at line 369 of file flashparams.cpp.

References param_import_internal().

Referenced by param_import().

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

◆ flash_param_load()

int flash_param_load ( )

Definition at line 363 of file flashparams.cpp.

References param_import_internal(), and param_reset_all().

Referenced by param_load_default().

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

◆ flash_param_save()

int flash_param_save ( bool  only_unsaved)

Definition at line 358 of file flashparams.cpp.

References param_export_internal().

Here is the call graph for this function:

◆ param_export_internal()

static int param_export_internal ( bool  only_unsaved)
static

Definition at line 78 of file flashparams.cpp.

References BSON_BIN_BINARY, bson_encoder_append_binary(), bson_encoder_append_double(), bson_encoder_append_int(), bson_encoder_buf_data(), bson_encoder_buf_size(), bson_encoder_fini(), bson_encoder_init_buf(), debug, f(), param_value_u::f, param_value_u::i, OK, param_wbuf_s::param, param_get_value_ptr_external(), param_name(), param_size(), param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, PARAM_TYPE_STRUCT, PARAM_TYPE_STRUCT_MAX, param_values, parameter_flashfs_alloc(), parameter_flashfs_free(), parameter_flashfs_read(), parameter_flashfs_write(), parameters_token, param_wbuf_s::unsaved, utarray_next, and param_wbuf_s::val.

Referenced by flash_param_save().

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

◆ param_import_callback()

static int param_import_callback ( bson_decoder_t  decoder,
void *  priv,
bson_node_t  node 
)
static

Definition at line 214 of file flashparams.cpp.

References BSON_BIN_BINARY, BSON_BINDATA, bson_decoder_copy_data(), bson_decoder_data_pending(), BSON_DOUBLE, BSON_EOO, BSON_INT32, bson_node_s::d, debug, f(), bson_node_s::i, param_import_state::mark_saved, bson_node_s::name, param_wbuf_s::param, param_find_no_notification(), PARAM_INVALID, param_set_external(), param_size(), param_type(), PARAM_TYPE_FLOAT, PARAM_TYPE_INT32, state, bson_node_s::subtype, and bson_node_s::type.

Referenced by param_import_internal().

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

◆ param_import_internal()

static int param_import_internal ( bool  mark_saved)
static

Definition at line 327 of file flashparams.cpp.

References bson_decoder_init_buf(), bson_decoder_next(), debug, param_import_state::mark_saved, param_import_callback(), parameter_flashfs_read(), and parameters_token.

Referenced by flash_param_import(), and flash_param_load().

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