1 /*
2  * Copyright (c) 2018 Intel Corporation
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /* Pending storage actions. */
8 enum bt_mesh_settings_flag {
9 	BT_MESH_SETTINGS_RPL_PENDING,
10 	BT_MESH_SETTINGS_NET_KEYS_PENDING,
11 	BT_MESH_SETTINGS_APP_KEYS_PENDING,
12 	BT_MESH_SETTINGS_NET_PENDING,
13 	BT_MESH_SETTINGS_IV_PENDING,
14 	BT_MESH_SETTINGS_SEQ_PENDING,
15 	BT_MESH_SETTINGS_HB_PUB_PENDING,
16 	BT_MESH_SETTINGS_CFG_PENDING,
17 	BT_MESH_SETTINGS_MOD_PENDING,
18 	BT_MESH_SETTINGS_VA_PENDING,
19 	BT_MESH_SETTINGS_CDB_PENDING,
20 
21 	BT_MESH_SETTINGS_FLAG_COUNT,
22 };
23 
24 #ifdef CONFIG_BT_SETTINGS
25 #define BT_MESH_SETTINGS_DEFINE(_hname, _subtree, _set)			     \
26 	SETTINGS_STATIC_HANDLER_DEFINE(bt_mesh_##_hname, "bt/mesh/" _subtree, \
27 				       NULL, _set, NULL, NULL)
28 #else
29 /* Declaring non static settings handler helps avoid unnecessary ifdefs
30  * as well as unused function warning. Since the declared handler structure is
31  * unused, linker will discard it.
32  */
33 #define BT_MESH_SETTINGS_DEFINE(_hname, _subtree, _set)\
34 	const struct settings_handler settings_handler_bt_mesh_ ## _hname = {\
35 		.h_set = _set,						     \
36 	}
37 #endif
38 
39 void bt_mesh_settings_init(void);
40 void bt_mesh_settings_store_schedule(enum bt_mesh_settings_flag flag);
41 void bt_mesh_settings_store_cancel(enum bt_mesh_settings_flag flag);
42 int bt_mesh_settings_set(settings_read_cb read_cb, void *cb_arg,
43 			 void *out, size_t read_len);
44