Hi,
Hi to all,
I am trying to implement Generic_Delta_Server_Unack (Level Server) as follow ...
void gen_delta_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf)
{
int tmp32 = state_ptr->current + net_buf_simple_pull_le16(buf);
int tid = net_buf_simple_pull_u8(buf);
if(tmp32 < -32768)
{
tmp32 = -32768;
}
else if(tmp32 > 32767)
{
tmp32 = 32767;
}
state_ptr->current = (int16_t)tmp32;
state_ptr->previous = state_ptr->current;
}
but it get executed 5 times if level client is configured as
--> pub-set 0100 c000 1 0 5 1003
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
If we use something like
if(last_tid == tid)
{
return;
}
at start, then it could escape valid message too.
For eg. if Server & Client rebooted simultaneously in that case,
Server side variable last_tid & Client side variable tid both get set to Zero.
So first message from client get ignore.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
How to solve this problem ?