37 #include "rosflight.h" 42 #ifndef GIT_VERSION_HASH 43 #define GIT_VERSION_HASH 0x00 44 #pragma message "GIT_VERSION_HASH Undefined, setting to 0x00!" 46 #ifndef GIT_VERSION_STRING 47 #define GIT_VERSION_STRING "empty" 48 #pragma message "GIT_VERSION_STRING Undefined, setting to \"empty\"!" 88 for (p = reinterpret_cast<const char *>(&
params.
names);
91 for (p = reinterpret_cast<const char *>(&
params.
types);
105 "Unable to load parameters; using default values");
void send_parameter_list()
char names[PARAMS_COUNT][PARAMS_NAME_LENGTH]
virtual void memory_init()=0
void log(CommLinkInterface::LogSeverity severity, const char *fmt,...)
virtual bool memory_write(const void *src, size_t len)=0
uint16_t lookup_param_id(const char name[PARAMS_NAME_LENGTH])
Gets the id of a parameter from its name.
param_type_t types[PARAMS_COUNT]
void set_defaults(void)
Set all parameters to default values.
void change_callback(uint16_t id)
Callback for executing actions that need to be taken when a parameter value changes.
bool read(void)
Read parameter values from non-volatile memory.
void init_param_int(uint16_t id, const char name[PARAMS_NAME_LENGTH], int32_t value)
bool set_param_float(uint16_t id, float value)
Sets the value of a floating point parameter by ID and calls the parameter callback.
CommManager comm_manager_
void send_param_value(uint16_t param_id)
static constexpr uint8_t PARAMS_NAME_LENGTH
void set_listeners(ParamListenerInterface *const listeners[], size_t num_listeners)
Specify listeners for parameter changes.
virtual void param_change_callback(uint16_t param_id)=0
virtual bool memory_read(void *dest, size_t len)=0
bool 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.
ParamListenerInterface *const * listeners_
void init_param_float(uint16_t id, const char name[PARAMS_NAME_LENGTH], float value)
void init()
Initialize parameter values.
bool 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...
uint8_t compute_checksum(void)
bool write(void)
Write current parameter values to non-volatile memory.
bool set_param_int(uint16_t id, int32_t value)
Sets the value of a parameter by ID and calls the parameter change callback.
param_value_t values[PARAMS_COUNT]