Comments (4)
This works, but you'll have to be on guard for new nodes in the mesh. Consider a mesh that has been running for some time, and made it to version 64000 (right below overflow). Then, a new node joins the mesh, making enquieries about the variable by broadcasting its version 0-variable. The rest of the mesh would then assume that this new node knows more than they do, and change their values to the new, useless version, erasing any previous state in the mesh.
Treating the 0-version specially would solve this pretty fast, but I think a Lollipop sequencing scheme might be a better fit, where we treat the first N versions as beginner-versions, that will never be able to overwrite any larger ones. Then we can cycle at N+1 and up (the yummy, round part of the lollipop). That would cover cases where a new node has been assigned a value by some setup-system or something, bumping its version number before it's introduced to the mesh.
uint16_t separation = (new_ver >= old_ver)?
(new_ver - old_ver) :
(-(old_ver - N) + (new_ver - N) - N);
if ((old_ver < N && new_ver >= old_ver) ||
(old_ver >= N && separation < (UINT16_MAX - N)/2) ||
uninitialized)
{
Any thoughts?
from nrf51-ble-bcast-mesh.
This seems to be a better solution,
I will use your variant
from nrf51-ble-bcast-mesh.
sounds good!
+1!
from nrf51-ble-bcast-mesh.
The solution I proposed is now part of the master branch (as of release v0.6.2), and version should now cycle like I described above. Thank you @victorpasse for reporting :)
from nrf51-ble-bcast-mesh.
Related Issues (20)
- Mesh encryption of data HOT 1
- Multiple frequencies and modulation types for RX and TX HOT 3
- OTA for mesh nodes HOT 2
- into module? HOT 2
- Notification not enabled for sdk13 and nRF52832 HOT 2
- hack HOT 1
- What does "radio_order" and "RADIO_EVENT_TYPE_RX_PREEMPTABLE" etc. do? HOT 1
- consider storing i_relative as log2(i_relative) to save 3 bytes per trickle
- it seems a bug! HOT 1
- Packet loss in mesh network HOT 1
- 3 Questions regarding migrating to Nrf52 platforms HOT 1
- GATT Service HOT 1
- DFU questions
- Mesh monitoring on a device HOT 1
- What is the hop delays and relevant solutions? HOT 1
- battery usage / fruity mesh HOT 2
- rbc_mesh_stop sometimes crashes my program HOT 3
- Timeslot SD crash fix only applicable for NRF52?
- P
- b16e1105f3da788022c24e75b8603f9f4426a636
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nrf51-ble-bcast-mesh.