samples: mesh/onoff-app: Enable persistent storage support

Enable persistent storage support in
samples/boards/nrf52/mesh/onoff-app.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
This commit is contained in:
Vikrant More 2018-06-15 17:19:42 +05:30 committed by Johan Hedberg
commit 1bbfdf1d1a
3 changed files with 15 additions and 3 deletions

View file

@ -85,9 +85,7 @@ root element's unicast address as it is the only one that has a
configuration server model.
If meshctl is gracefully exited, it can be restarted and reconnected to
network 0x0. The board configuration is volatile and if the board is reset,
power cycled, or reprogrammed, it will have to be provisioned and configured
again.
network 0x0.
The meshctl utility also supports a onoff model client that can be used to
change the state of any LED that is bound to application key 0x1.

View file

@ -2,6 +2,15 @@
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_FCB=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600
CONFIG_BOOT_BANNER=y
CONFIG_BUILD_TIMESTAMP=y

View file

@ -37,6 +37,7 @@
*/
#include <misc/printk.h>
#include <settings/settings.h>
#include <misc/byteorder.h>
#include <nrf.h>
#include <device.h>
@ -590,6 +591,10 @@ static void bt_ready(int err)
return;
}
if (IS_ENABLED(CONFIG_SETTINGS)) {
settings_load();
}
bt_mesh_prov_enable(BT_MESH_PROV_GATT | BT_MESH_PROV_ADV);
SYS_LOG_INF("Mesh initialized");