Bluetooth: Mesh: Fix (re)transmit interval handling

The adv_send() function was incorrectly decoding the 5-bit value (it
was using it directly as milliseconds), which effectively lead to the
code always picking the controller's minimum supported interval.

Fix this issue, but do it by simplifying the (re)transmission state
tracking so that the state is always stored in the original "packed"
8-bit value, where 5 bits are reserved for the interval, and 3 for the
count.

Fixes #7972

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2018-06-04 14:06:48 +02:00 committed by Carles Cufí
commit ed5fb3ff37
8 changed files with 34 additions and 49 deletions

View file

@ -197,8 +197,8 @@ struct bt_mesh_model_op {
* @brief Encode transmission count & interval steps.
*
* @param count Number of retransmissions (first transmission is excluded).
* @param int_ms Interval steps in milliseconds. Must be greater than 0
* and a multiple of 10.
* @param int_ms Interval steps in milliseconds. Must be greater than 0,
* less than or equal to 320, and a multiple of 10.
*
* @return Mesh transmit value that can be used e.g. for the default
* values of the configuration model data.