I have a hard time understanding precisely what an Element is and how it differentiates from a Model when talking Bluetooth Mesh.
The only definition can seem to find of an Element is; "Something addressable in a device." But this does not make very much sens to me, since I would think every struct, key and model could be addressable. Also, when should more than one element be used?
I would have imagined there to be some kind of add_element(element_t)
function.
Are there anything equivalent to this or do I have completely misunderstood how this works?
For better understanding elements i would like to know how the Light Switch example is divided into elements. Then i will be able to extrapolate how to design my own project. I have drawn two drawings (A and B) of would I would imagine to be possible examples. And if non of these drawing represent how the example is structured, then how is structured?
A: All models in one element.
B: Each model in each own element-
EDIT
In the example project values like element_index
, model_index
and model_handle
is used very often, but where does values come from?
Are they generated by the software?
Do i choose them arbitrarily?
And which of these values are shared between the provisioner and server on the network?