Hi, everyone
A LPN ( Node-LP ) had selected one of nodes as its friend ( Node-F0 ), if Node-F0 is taken away, will the Node-LP automatically reselect other node as its friend?
Hi, everyone
A LPN ( Node-LP ) had selected one of nodes as its friend ( Node-F0 ), if Node-F0 is taken away, will the Node-LP automatically reselect other node as its friend?
Hi Jhc,
If the friend node is taken away the friendship will be timed out after a period of time. You will receive NRF_MESH_EVT_FRIENDSHIP_TERMINATED event when that happens.
After that you can choose to re-initialize friendship again (with other nodes) by calling mesh_lpn_friend_request(). Please have a look at initiate_friendship() function in our LPN example.
Note that you may need to wait for a period of time before you call mesh_lpn_friend_request() after you receive NRF_MESH_EVT_FRIENDSHIP_TERMINATED event. If you call it in the same event, you may receive NRF_ERROR_INVALID_STATE error.
Hi Jhc,
If the friend node is taken away the friendship will be timed out after a period of time. You will receive NRF_MESH_EVT_FRIENDSHIP_TERMINATED event when that happens.
After that you can choose to re-initialize friendship again (with other nodes) by calling mesh_lpn_friend_request(). Please have a look at initiate_friendship() function in our LPN example.
Note that you may need to wait for a period of time before you call mesh_lpn_friend_request() after you receive NRF_MESH_EVT_FRIENDSHIP_TERMINATED event. If you call it in the same event, you may receive NRF_ERROR_INVALID_STATE error.
Thank you!