Re: How & what to save provisioning configuration set by meshctl utility into flash memory of NRF52840-PDK ??


Johan Hedberg
 

Hi Vikrant,

On Mon, Nov 20, 2017, Vikrant More wrote:
Now I able able to access, first byte send by *"onoff"* command after
editing get_onoff_set( ) function as follow;

static void gen_onoff_set(struct bt_mesh_model *model,
struct bt_mesh_msg_ctx *ctx,
struct net_buf_simple *buf)
{

unsigned char tmp = net_buf_simple_pull_u8(buf);

NRF_P0->OUTSET |= 0x0001E000;

switch (tmp)
{
case 0: NRF_P0->OUT &= ~(1<<13); break;
case 1: NRF_P0->OUT &= ~(1<<14); break;
}
}
Good to see that you're making progress with this. Note that you'll also
need to send an OnOff Status response when receiving this message, as
section 3.3.1.2.2 in the Mesh Model Specification states:

"If the received message is a Generic OnOff Set message, the Generic
OnOff Server shall respond with a Generic OnOff Status message"

Now I want to save configuration set by meshctl utilitty into flash
memory of nRF52840-PDK board.

Plus I don't know what to save from that configuration.

Does anyone have knowledge about it ?
This is next on my to-do list for the mesh implementation. For now it's
left up to the application to store and restore the information it
wants. Most of the network state you'll be able to grab from the mesh
structs that the app defines but it's possible that for some you need to
hack the stack code itself.

Note that since we're now starting to have a Configuration Client Model
implementation as well, it opens another possibility for loading back
the values to the stack. I'm not sure if it's worth it, considering that
it involves encrypting & decrypting messages just to set some local
variables, however the benefit is reduced code duplication.

Johan

Join users@lists.zephyrproject.org to automatically receive all group messages.