This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Question about <handle-version-data> pairs in open mesh framework

according to the introduction of mesh framework( value storage part), it says all mesh data is saved in a structure. My understanding is : Handle means a trickle instance reference, value is the data of mesh packet, and version is somehow like a sequence number of mesh packet of this value, is this right? if my understanding is right, does that mean mesh framework create a trickle instance for the mesh pakcet if only the data in mesh packet is different from others?

  • Hi,

    The first statement is correct. For every new value you push to a specific handle, the version number is incremented by one. This way, the other devices know to replace their current data entry for that handle with the new data.

    When pushing new data, you always have to specify the handle you want to push it to. The framework will increase the version number of that handle, but it won't create a new trickle instance. Instead, it'll use that handle's running trickle instance (if any), replace the data, and reset the interval.

    If two devices write to the same handle at the same time (ie with the same version number), you will have a conflict. This is normally detected by the other devices, but it will lead to strange behavior, and it is recommended to avoid this scenario at all costs, as it is very likely to desync your state across devices.

  • Hi, Thanks for your quick reply.I'm new to nordic's product and new to study open mesh framework. But I have another question that what access address mean? Is it a parameter of mesh network ?does different access address means different mesh network ? and how can i send a mesh packet to a specific node(how can i specifi a node, by mac address?) and how can get the source address of the sender?

  • The access address is a 4 byte filter that comes before the packet contents on air. The radio hardware has a module that reads the access address as the packet arrives, and compares it to its own configuration. The access address has to match the configured one, otherwise, the packet is ignored. We use this filter to separate mesh networks from one another.

  • There is no built-in way to address a single device, or get a device address - you have to create a scheme for this yourself if you need it. The most common way to solve this is to let each device control a single handle, and add a 2 byte field to the beginning of the payload, where devices can put the handle of the device they're talking to. This way, the handles become sender addresses, and the first 2 bytes of the payload becomes the destination address. All devices on the mesh will receive all messages, but the application will filter out messages that don't start with their local handle. This way, you can send messages to specific devices, and the the destination device of the message will know who sent it.

Related