Golioth Firmware SDK
Loading...
Searching...
No Matches
settings.h File Reference
#include <golioth/golioth_status.h>
#include <golioth/client.h>
#include <golioth/config.h>
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Typedefs

typedef enum golioth_settings_status(* golioth_int_setting_cb) (int32_t new_value, void *arg)
 
typedef enum golioth_settings_status(* golioth_bool_setting_cb) (bool new_value, void *arg)
 
typedef enum golioth_settings_status(* golioth_float_setting_cb) (float new_value, void *arg)
 
typedef enum golioth_settings_status(* golioth_string_setting_cb) (const char *new_value, size_t new_value_len, void *arg)
 

Enumerations

enum  golioth_settings_status {
  GOLIOTH_SETTINGS_SUCCESS = 0 , GOLIOTH_SETTINGS_KEY_NOT_RECOGNIZED = 1 , GOLIOTH_SETTINGS_KEY_NOT_VALID = 2 , GOLIOTH_SETTINGS_VALUE_FORMAT_NOT_VALID = 3 ,
  GOLIOTH_SETTINGS_VALUE_OUTSIDE_RANGE = 4 , GOLIOTH_SETTINGS_VALUE_STRING_TOO_LONG = 5 , GOLIOTH_SETTINGS_GENERAL_ERROR = 6
}
 Enumeration of Settings status codes. More...
 
enum  golioth_settings_value_type {
  GOLIOTH_SETTINGS_VALUE_TYPE_UNKNOWN , GOLIOTH_SETTINGS_VALUE_TYPE_INT , GOLIOTH_SETTINGS_VALUE_TYPE_BOOL , GOLIOTH_SETTINGS_VALUE_TYPE_FLOAT ,
  GOLIOTH_SETTINGS_VALUE_TYPE_STRING
}
 Different types of setting values. More...
 

Functions

struct golioth_settings * golioth_settings_init (struct golioth_client *client)
 
enum golioth_status golioth_settings_deinit (struct golioth_settings *settings)
 
enum golioth_status golioth_settings_register_int (struct golioth_settings *settings, const char *setting_name, golioth_int_setting_cb callback, void *callback_arg)
 
enum golioth_status golioth_settings_register_int_with_range (struct golioth_settings *settings, const char *setting_name, int32_t min_val, int32_t max_val, golioth_int_setting_cb callback, void *callback_arg)
 
enum golioth_status golioth_settings_register_bool (struct golioth_settings *settings, const char *setting_name, golioth_bool_setting_cb callback, void *callback_arg)
 Same as golioth_settings_register_int, but for type bool.
 
enum golioth_status golioth_settings_register_float (struct golioth_settings *settings, const char *setting_name, golioth_float_setting_cb callback, void *callback_arg)
 Same as golioth_settings_register_int, but for type float.
 
enum golioth_status golioth_settings_register_string (struct golioth_settings *settings, const char *setting_name, golioth_string_setting_cb callback, void *callback_arg)
 Same as golioth_settings_register_int, but for type string.