Skip to content
Permalink
Browse files

samples: mesh: sync the init procedure to initialise the mesh

Synchronising the init procedure to initialise the mesh
state only after the settings have been loaded.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
  • Loading branch information...
vikrant8051 authored and jhedberg committed May 9, 2019
1 parent 35f14bc commit f78599fbcaebde1dccc34ef0b672fdd894eb9d57
@@ -197,11 +197,14 @@ void main(void)
ps_settings_init();

/* Initialize the Bluetooth Subsystem */
err = bt_enable(bt_ready);
err = bt_enable(NULL);
if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
}

bt_ready();

light_default_status_init();

update_light_state();
@@ -51,15 +51,11 @@ static const struct bt_mesh_prov prov = {
.reset = prov_reset,
};

void bt_ready(int err)
void bt_ready(void)
{
int err;
struct bt_le_oob oob;

if (err) {
printk("Bluetooth init failed (err %d)\n", err);
return;
}

printk("Bluetooth initialized\n");

err = bt_mesh_init(&prov, &comp);
@@ -50,7 +50,7 @@
#define BT_MESH_MODEL_LIGHT_CTL_TEMP_STATUS BT_MESH_MODEL_OP_2(0x82, 0x66)
#define BT_MESH_MODEL_LIGHT_CTL_DEFAULT_STATUS BT_MESH_MODEL_OP_2(0x82, 0x68)

void bt_ready(int err);
void bt_ready(void);

#endif

0 comments on commit f78599f

Please sign in to comment.
You can’t perform that action at this time.