Android-nRF-Mesh-Library icon indicating copy to clipboard operation
Android-nRF-Mesh-Library copied to clipboard

Having the ability to have our own MeshNetworkCallbacks

Open kevin-sakemaer opened this issue 5 years ago • 5 comments

As of today we only have onMeshNetworkUpdate but we lost a lot of information on why it's updated.

It would be great if we can have our on MeshNetworkCallbacks. By having this we will not lost why the MeshNetwork is updated and allow more granularity when executing functionality.

kevin-sakemaer avatar Nov 02 '20 16:11 kevin-sakemaer

Hi @Kleak, could you elaborate a little bit more on this?

As of now every time the network is changed due to a mesh message that is sent/received you receive a callback onNetworkUpdated() and this is because the network is saved to the database at each operation. However there is also MeshStatusCallbacks that are invoked for each message received/sent meanining you have both these callbacks giving you some information everytime a network may have changed. Do you need more functionality on this?

roshanrajaratnam avatar Nov 03 '20 10:11 roshanrajaratnam

in fact onNetworkUpdated is loosing lot of information. I would like to have the event after updating the provisioner for example but i can't because i'm not sure the onNetworkUpdated is the response of my update provisioner or something else. But lot of other things can't be waited because we don't have the information :/ onNetworkUpdated didn't give us any information apart the mesh network has been updated but not why it has been updated.

example : I select a new provisioner i got onNetworkUpdated but i may getting onNetworkUpdated also for other event so i can't differentiate if it's the result of my provisioner updated.

what i would like is having a way to be sure this event is the response of my select provisioner which MeshNetworkCallbacks provide but is not available to us.

kevin-sakemaer avatar Nov 03 '20 10:11 kevin-sakemaer

Right I see, this is something I can look into but it will have to wait a little bit unfortunately. What I can do is add a callback for each database update i.e. provisioner, app keys and etc. hope this would work for you?

roshanrajaratnam avatar Nov 03 '20 10:11 roshanrajaratnam

Yes that would be ok :+1: Or maybe expose an other MeshNetworkCallbacks and trigger event at the same place the current one is.

kevin-sakemaer avatar Nov 03 '20 10:11 kevin-sakemaer

ok, as of now I have some other priorities but i will look in to as soon as I get some time.

roshanrajaratnam avatar Nov 03 '20 11:11 roshanrajaratnam