#include <param.h>
Definition at line 230 of file param.h.
rosflight_firmware::Params::Params |
( |
ROSflight & |
_rf | ) |
|
void rosflight_firmware::Params::change_callback |
( |
uint16_t |
id | ) |
|
Callback for executing actions that need to be taken when a parameter value changes.
- Parameters
-
id | The ID of the parameter that was changed |
Definition at line 328 of file param.cpp.
uint8_t rosflight_firmware::Params::compute_checksum |
( |
void |
| ) |
|
|
private |
float rosflight_firmware::Params::get_param_float |
( |
uint16_t |
id | ) |
const |
|
inline |
Get the value of a floating point parameter by id.
- Parameters
-
id | The ID of the parameter |
- Returns
- The value of the parameter
Definition at line 326 of file param.h.
int rosflight_firmware::Params::get_param_int |
( |
uint16_t |
id | ) |
const |
|
inline |
Get the value of an integer parameter by id.
- Parameters
-
id | The ID of the parameter |
- Returns
- The value of the parameter
Definition at line 319 of file param.h.
const char* rosflight_firmware::Params::get_param_name |
( |
uint16_t |
id | ) |
const |
|
inline |
Get the name of a parameter.
- Parameters
-
id | The ID of the parameter |
- Returns
- The name of the parameter
Definition at line 333 of file param.h.
param_type_t rosflight_firmware::Params::get_param_type |
( |
uint16_t |
id | ) |
const |
|
inline |
Get the type of a parameter.
- Parameters
-
id | The ID of the parameter |
- Returns
- The type of the parameter This returns one of three possible types PARAM_TYPE_INT32, PARAM_TYPE_FLOAT, or PARAM_TYPE_INVALID See line 165
Definition at line 343 of file param.h.
void rosflight_firmware::Params::init |
( |
| ) |
|
Initialize parameter values.
Definition at line 99 of file param.cpp.
void rosflight_firmware::Params::init_param_float |
( |
uint16_t |
id, |
|
|
const char |
name[PARAMS_NAME_LENGTH], |
|
|
float |
value |
|
) |
| |
|
private |
void rosflight_firmware::Params::init_param_int |
( |
uint16_t |
id, |
|
|
const char |
name[PARAMS_NAME_LENGTH], |
|
|
int32_t |
value |
|
) |
| |
|
private |
uint16_t rosflight_firmware::Params::lookup_param_id |
( |
const char |
name[PARAMS_NAME_LENGTH] | ) |
|
Gets the id of a parameter from its name.
- Parameters
-
name | The name of the parameter |
- Returns
- The ID of the parameter if the name is valid, PARAMS_COUNT otherwise (invalid ID)
Definition at line 340 of file param.cpp.
bool rosflight_firmware::Params::read |
( |
void |
| ) |
|
Read parameter values from non-volatile memory.
- Returns
- True if successful, false otherwise
Definition at line 298 of file param.cpp.
void rosflight_firmware::Params::set_defaults |
( |
void |
| ) |
|
Set all parameters to default values.
Definition at line 112 of file param.cpp.
void rosflight_firmware::Params::set_listeners |
( |
ParamListenerInterface *const |
listeners[], |
|
|
size_t |
num_listeners |
|
) |
| |
Specify listeners for parameter changes.
- Parameters
-
listeners | An array of pointers to objects that implement the ParamListenerInterface interface |
num_listeners | The length of the array passed as the listeners parameter |
Definition at line 292 of file param.cpp.
bool rosflight_firmware::Params::set_param_by_name_float |
( |
const char |
name[PARAMS_NAME_LENGTH], |
|
|
float |
value |
|
) |
| |
Sets the value of a floating point parameter by name and calls the parameter change callback.
- Parameters
-
name | The name of the parameter |
value | The new value |
- Returns
- True if a parameter value was changed, false otherwise
Definition at line 396 of file param.cpp.
bool rosflight_firmware::Params::set_param_by_name_int |
( |
const char |
name[PARAMS_NAME_LENGTH], |
|
|
int32_t |
value |
|
) |
| |
Sets the value of a parameter by name and calls the parameter change callback.
- Parameters
-
name | The name of the parameter |
value | The new value |
- Returns
- True if a parameter value was changed, false otherwise
Definition at line 390 of file param.cpp.
bool rosflight_firmware::Params::set_param_float |
( |
uint16_t |
id, |
|
|
float |
value |
|
) |
| |
Sets the value of a floating point parameter by ID and calls the parameter callback.
- Parameters
-
id | The ID of the parameter |
value | The new value |
- Returns
- True if a parameter was changed, false otherwise
Definition at line 378 of file param.cpp.
bool rosflight_firmware::Params::set_param_int |
( |
uint16_t |
id, |
|
|
int32_t |
value |
|
) |
| |
Sets the value of a parameter by ID and calls the parameter change callback.
- Parameters
-
id | The ID of the parameter |
value | The new value |
- Returns
- True if a parameter value was changed, false otherwise
Definition at line 366 of file param.cpp.
bool rosflight_firmware::Params::write |
( |
void |
| ) |
|
Write current parameter values to non-volatile memory.
- Returns
- True if successful, false otherwise
Definition at line 315 of file param.cpp.
size_t rosflight_firmware::Params::num_listeners_ |
|
private |
params_t rosflight_firmware::Params::params |
|
private |
constexpr uint8_t rosflight_firmware::Params::PARAMS_NAME_LENGTH = 16 |
|
static |
The documentation for this class was generated from the following files: