32 #pragma GCC diagnostic ignored "-Wstrict-aliasing" 43 #include "rosflight.h" 78 for (p = reinterpret_cast<const char *>(&
params.
names);
81 for (p = reinterpret_cast<const char *>(&
params.
types);
void send_parameter_list()
char names[PARAMS_COUNT][PARAMS_NAME_LENGTH]
virtual void memory_init()=0
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 add_callback(std::function< void(int)> callback, uint16_t param_id)
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.
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.
std::function< void(int)> callbacks[PARAMS_COUNT]
param_value_t values[PARAMS_COUNT]