New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth: Mesh: Added support for randomly delaying publications #66498
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :) Just a couple of small doc edits
* Between 20 to 50 milliseconds for periodically published messages | ||
|
||
This feature is optional and enabled with the :kconfig:option:`CONFIG_BT_MESH_DELAYABLE_PUBLICATION` | ||
Kconfig option. When enabled, each model can enable or the delayable publication by setting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kconfig option. When enabled, each model can enable or the delayable publication by setting the | |
Kconfig option. When enabled, each model can enable or disable the delayable publication by setting the |
subsys/bluetooth/mesh/Kconfig
Outdated
help | ||
When enabled, the periodic publications are randomly delayed by 20 to 50ms. Publications | ||
triggered at the start of the stack or by the bt_mesh_model_publish() call are delayed by | ||
20 to 500ms. This option reduces probability of collisions when multiple nodes publish at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 to 500ms. This option reduces probability of collisions when multiple nodes publish at | |
20 to 500ms. This option reduces the probability of collisions when multiple nodes publish at |
The delayable publication functionality implements the specification recommendations that delays | ||
a message publication in the following cases: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The delayable publication functionality implements the specification recommendations that delays | |
a message publication in the following cases: | |
The delayable publication functionality implements the specification recommendations for message | |
publication delays in the following cases: |
subsys/bluetooth/mesh/access.c
Outdated
return 0; | ||
} | ||
|
||
uint8_t num = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... whether uint8_t
type wide is sufficient to represent random value above 256? Shouldn't it be uint16_t
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but function still returns uint8_t
value. It is still not possible to get random values in range 256 ... 500
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still needs a bit more work
6980766
to
5b0bced
Compare
The section 3.7.3.1 of the mesh specification recommends to delay a message publication in certain cases: - at power-up or upon state change for a time between 20 to 500 ms - for periodic publications for a time between 20 to 50 ms This change implements this recommendation by adding the `CONFIG_BT_MESH_DELAYABLE_PUBLICATION` Kconfig option which enables the randomization code and by adding the `bt_mesh_model_pub.delayable` bit field which allows each model decide whether the publications should be delayed for this model or not. Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The section 3.7.3.1 of the mesh specification recommends to delay a message publication in certain cases:
This change implements this recommendation by adding the
CONFIG_BT_MESH_DELAYABLE_PUBLICATION
Kconfig option which enables the randomization code and by adding thebt_mesh_model_pub.delayable
bit field which allows each model decide whether the publications should be delayed for this model or not.