K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches
parameter.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Data Structures

union  kfsw_param_scalar
 
struct  kfsw_param_value
 
struct  kfsw_param_info
 
struct  kfsw_param_table_info
 
struct  kfsw_param_definition
 
struct  kfsw_param_definition_set
 
struct  kfsw_param_stats
 

Macros

#define KFSW_PARAM_STRING_MAX   CONFIG_KFSW_PARAM_STRING_MAX
 
#define KFSW_PARAM_WIRE_BYTES   58U
 
#define KFSW_PARAM_TABLE_WIRE_MAX   2048U
 
#define KFSW_PARAM_DESCRIPTION_MAX   64U
 
#define KFSW_PARAM_TABLE_FITS_THE_LINK(definitions)
 
#define KFSW_PARAM_NAME_MAX   32U
 
#define KFSW_PARAM_TABLE_INVALID   0U
 
#define KFSW_PARAM_TABLE_CORE_FIRST   1U
 
#define KFSW_PARAM_TABLE_CORE_LAST   24U
 
#define KFSW_PARAM_TABLE_SERVICE_FIRST   25U
 
#define KFSW_PARAM_TABLE_SERVICE_LAST   49U
 
#define KFSW_PARAM_TABLE_MODULE_FIRST   50U
 
#define KFSW_PARAM_TABLE_MODULE_LAST   99U
 
#define KFSW_PARAM_OFFSET_MAX   255U
 
#define KFSW_PARAM_FLAG_READ_ONLY   0x00000001UL
 
#define KFSW_PARAM_FLAG_CONFIGURATION   0x00000004UL
 
#define KFSW_PARAM_FLAG_SYSTEM_INFO   0x00000040UL
 
#define KFSW_PARAM_FLAG_DEBUG   0x00000200UL
 
#define KFSW_PARAM_FLAG_PERSISTENT   0x00010000UL
 
#define KFSW_PARAM_FLAG_OWNER_STORE   0x00080000UL
 
#define KFSW_PARAM_FLAG_LIVE   0x00020000UL
 
#define KFSW_PARAM_FLAG_LOCAL_ONLY   0x00040000UL
 
#define KFSW_PARAM_ID(table, offset)   ((uint16_t)(((uint16_t)(table) << 8) | (uint8_t)(offset)))
 
#define KFSW_PARAM_PARAM_TABLE_ID   26U
 
#define KFSW_PARAM_PARAM_TABLE_NAME   "param"
 

Types

typedef int(* kfsw_param_validator_t) (const union kfsw_param_scalar *value)
 
typedef int(* kfsw_param_text_validator_t) (const char *text)
 
typedef int(* kfsw_param_data_validator_t) (const uint8_t *data, size_t size)
 
typedef int(* kfsw_param_apply_t) (const union kfsw_param_scalar *value)
 
typedef void(* kfsw_param_changed_t) (const union kfsw_param_scalar *value)
 
typedef void(* kfsw_param_text_changed_t) (const char *text)
 
typedef void(* kfsw_param_data_changed_t) (const uint8_t *data, size_t size)
 
typedef void(* kfsw_param_sample_t) (void *value)
 
typedef bool(* kfsw_param_visitor_t) (const struct kfsw_param_info *info, void *context)
 
typedef bool(* kfsw_param_table_visitor_t) (const struct kfsw_param_table_info *info, void *context)
 

Enumerations

enum  kfsw_param_type {
  KFSW_PARAM_U8 , KFSW_PARAM_U16 , KFSW_PARAM_U32 , KFSW_PARAM_U64 ,
  KFSW_PARAM_I8 , KFSW_PARAM_I16 , KFSW_PARAM_I32 , KFSW_PARAM_I64 ,
  KFSW_PARAM_X8 , KFSW_PARAM_X16 , KFSW_PARAM_X32 , KFSW_PARAM_X64 ,
  KFSW_PARAM_FLOAT , KFSW_PARAM_DOUBLE , KFSW_PARAM_STRING , KFSW_PARAM_DATA ,
  KFSW_PARAM_INVALID
}
 

Functions

int kfsw_param_init (const struct kfsw_param_definition_set *const *sets, size_t set_count)
 
bool kfsw_param_is_initialized (void)
 
int kfsw_param_parse_text (const char *text, struct kfsw_param_value *value)
 
int kfsw_param_get (const char *name, struct kfsw_param_value *value)
 
int kfsw_param_set (const char *name, const struct kfsw_param_value *value)
 
int kfsw_param_get_by_id (uint16_t id, struct kfsw_param_value *value)
 
int kfsw_param_get_info (const char *name, struct kfsw_param_info *info)
 
int kfsw_param_visit (kfsw_param_visitor_t visitor, void *context)
 
int kfsw_param_visit_tables (kfsw_param_table_visitor_t visitor, void *context)
 
int kfsw_param_remote_tables (uint16_t node, kfsw_param_table_visitor_t visitor, void *context)
 
size_t kfsw_param_table_count (void)
 
int kfsw_param_get_stats (struct kfsw_param_stats *stats)
 
bool kfsw_param_autosave_enabled (void)
 
const char * kfsw_param_band_name (uint8_t table)
 
const char * kfsw_param_mode_name (uint32_t flags)
 
int kfsw_param_persist_save (void)
 
int kfsw_param_persist_load (void)
 
int kfsw_param_persist_clear (void)
 
int kfsw_param_persist_table_count (uint8_t table, uint16_t *count)
 
uint32_t kfsw_param_persist_bytes (void)
 
uint32_t kfsw_param_persist_max_bytes (void)
 
int kfsw_param_restore_defaults (void)
 
int kfsw_param_server_start (void)
 
int kfsw_param_remote_refresh (uint16_t node)
 
int kfsw_param_remote_get (uint16_t node, const char *name, struct kfsw_param_value *value)
 
int kfsw_param_remote_get_many (uint16_t node, const char *const *names, size_t count, struct kfsw_param_value *values)
 
int kfsw_param_remote_get_many_until (uint16_t node, const char *const *names, size_t count, struct kfsw_param_value *values, int64_t deadline)
 
int kfsw_param_remote_visit_until (uint16_t node, kfsw_param_visitor_t visitor, void *context, int64_t deadline)
 
int kfsw_param_remote_set (uint16_t node, const char *name, const struct kfsw_param_value *value)
 
int kfsw_param_remote_visit (uint16_t node, kfsw_param_visitor_t visitor, void *context)
 
int kfsw_param_remote_visit_table (uint16_t node, uint8_t table, kfsw_param_visitor_t visitor, void *context)
 
const char * kfsw_param_type_name (enum kfsw_param_type type)
 

Variables

const struct kfsw_param_definition_set kfsw_param_param_definitions
 

Description

Local, remote, and persistent parameter API.