Bluetooth: Mesh: Fix accuracy of Publish Period

After the Publish Retransmit state was introduced the Publish Period
measurement would begin once the previous Publish message has finished
transmitting. This will however cause inaccurate periods, which is
particularly an issue with the PTS that expects accuracy of less than
0.5 seconds (apparently).

Since the publication timer is also used for the retransmissions we
can't simultaneously use if for the period as well. Therefore, we
introduce a new variable called period_start which makes a note of
when the period was supposed to start, and then once all
retransmissoins are done initializes the timer with the send duration
taken into account.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-11-20 20:17:31 +02:00 committed by Johan Hedberg
commit 15fe221f13
2 changed files with 32 additions and 4 deletions

View file

@ -271,6 +271,8 @@ struct bt_mesh_model_pub {
cred:1, /**< Friendship Credentials Flag. */
count:3; /**< Retransmissions left. */
u32_t period_start; /**< Start of the current period. */
/** @brief Buffer containing the publication message.
*
* The application is expected to initialize this with