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:
parent
48b7f236fa
commit
1bbfdf1d1a
3 changed files with 15 additions and 3 deletions
|
@ -85,9 +85,7 @@ root element's unicast address as it is the only one that has a
|
||||||
configuration server model.
|
configuration server model.
|
||||||
|
|
||||||
If meshctl is gracefully exited, it can be restarted and reconnected to
|
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,
|
network 0x0.
|
||||||
power cycled, or reprogrammed, it will have to be provisioned and configured
|
|
||||||
again.
|
|
||||||
|
|
||||||
The meshctl utility also supports a onoff model client that can be used to
|
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.
|
change the state of any LED that is bound to application key 0x1.
|
||||||
|
|
|
@ -2,6 +2,15 @@
|
||||||
CONFIG_MAIN_STACK_SIZE=512
|
CONFIG_MAIN_STACK_SIZE=512
|
||||||
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
|
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_BOOT_BANNER=y
|
||||||
CONFIG_BUILD_TIMESTAMP=y
|
CONFIG_BUILD_TIMESTAMP=y
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <misc/printk.h>
|
#include <misc/printk.h>
|
||||||
|
#include <settings/settings.h>
|
||||||
#include <misc/byteorder.h>
|
#include <misc/byteorder.h>
|
||||||
#include <nrf.h>
|
#include <nrf.h>
|
||||||
#include <device.h>
|
#include <device.h>
|
||||||
|
@ -590,6 +591,10 @@ static void bt_ready(int err)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_ENABLED(CONFIG_SETTINGS)) {
|
||||||
|
settings_load();
|
||||||
|
}
|
||||||
|
|
||||||
bt_mesh_prov_enable(BT_MESH_PROV_GATT | BT_MESH_PROV_ADV);
|
bt_mesh_prov_enable(BT_MESH_PROV_GATT | BT_MESH_PROV_ADV);
|
||||||
|
|
||||||
SYS_LOG_INF("Mesh initialized");
|
SYS_LOG_INF("Mesh initialized");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue