summaryrefslogtreecommitdiff
path: root/mesh/mesh-config.h
diff options
context:
space:
mode:
authorInga Stotland <inga.stotland@intel.com>2019-07-14 16:23:16 -0700
committerBrian Gix <brian.gix@intel.com>2019-07-15 14:48:04 -0700
commitc4bf0626fb621559ecaea7e1eadf22d386b7ee63 (patch)
tree2d9499be4b18a0454860e9b90d47b2c59eb0d7a0 /mesh/mesh-config.h
parentd8b2bef41b36971f567885cdefbf50d3269a9631 (diff)
downloadbluez-c4bf0626fb621559ecaea7e1eadf22d386b7ee63.tar.gz
mesh: Replace storage_save_config with mesh_config_save_config
This moves writing out of node configuration from storage.c down to mesh-config-<format-specific>.c to allow for more generic storage layout. New generalized API in mesh-config.h: mesh_config_save_config(struct mesh_config *cfg, bool no_wait, mesh_config_status_func_t cb, void *user_data) replaces the old one in storage.h: storage_save_config(struct mesh_node *node, bool no_wait, mesh_status_func_t cb, void *user_data) Currently, only JSON format is supported for storing node configuration: mesh_config_save_config is implemented in mesh-config-json.c
Diffstat (limited to 'mesh/mesh-config.h')
-rw-r--r--mesh/mesh-config.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesh/mesh-config.h b/mesh/mesh-config.h
index 8d01e760c..5241dde2d 100644
--- a/mesh/mesh-config.h
+++ b/mesh/mesh-config.h
@@ -104,16 +104,17 @@ struct mesh_config_node {
uint8_t dev_key[16];
uint8_t token[8];
};
-
-typedef bool (*mesh_config_node_cb)(struct mesh_config_node *node,
+typedef void (*mesh_config_status_func_t)(void *user_data, bool result);
+typedef bool (*mesh_config_node_func_t)(struct mesh_config_node *node,
const uint8_t uuid[16],
struct mesh_config *cfg,
void *user_data);
bool mesh_config_load_node(const char *cfg_path, const uint8_t uuid[16],
- mesh_config_node_cb cb, void *user_data);
+ mesh_config_node_func_t cb, void *user_data);
void mesh_config_release(struct mesh_config *cfg);
-bool mesh_config_save_config(struct mesh_config *cfg, const char *fname);
+bool mesh_config_save_config(struct mesh_config *cfg, bool no_wait,
+ mesh_config_status_func_t cb, void *user_data);
struct mesh_config *mesh_config_create(const char *cfg_path,
const uint8_t uuid[16],
struct mesh_config_node *node);