mesh: Fixes LPN poll timeout gradually grow

`POLL_TIMEOUT_MAX` should use `CONFIG_BT_MESH_LPN_POLL_TIMEOUT`
instead of `CONFIG_BT_MESH_LPN_INIT_POLL_TIMEOUT`. The described
algorithm to grow the poll timeout implemented in function
poll_timeout does not work with this implementation.

It's a regression in 3b4d58a
Bluetooth: Mesh: optimize performance for lpn node

This is port of aea9adfc8968e9210a4f58ac493fdc074478527b
This commit is contained in:
Krzysztof Kopyściński
2021-01-12 14:05:19 +01:00
committed by Łukasz Rymanowski
parent efbebd1549
commit 68e7bb8065
2 changed files with 14 additions and 2 deletions
+4 -2
View File
@@ -48,11 +48,13 @@
#define POLL_TIMEOUT_INIT (MYNEWT_VAL(BLE_MESH_LPN_INIT_POLL_TIMEOUT) * 100)
#define POLL_TIMEOUT (MYNEWT_VAL(BLE_MESH_LPN_RECV_DELAY) * 100)
#define REQ_ATTEMPTS_MAX 6
#define REQ_ATTEMPTS(lpn) MIN(REQ_ATTEMPTS_MAX, \
POLL_TIMEOUT_INIT / REQ_RETRY_DURATION(lpn))
POLL_TIMEOUT / REQ_RETRY_DURATION(lpn))
#define POLL_TIMEOUT_MAX(lpn) (POLL_TIMEOUT_INIT - \
#define POLL_TIMEOUT_MAX(lpn) (POLL_TIMEOUT - \
(REQ_ATTEMPTS(lpn) * REQ_RETRY_DURATION(lpn)))
#define CLEAR_ATTEMPTS 3
+10
View File
@@ -436,6 +436,16 @@ syscfg.defs:
a value of 300 means 30 seconds.
value: 300
BLE_MESH_LPN_POLL_TIMEOUT:
description: >
PollTimeout timer is used to measure time between two
consecutive requests sent by the Low Power node. If no
requests are received by the Friend node before the
PollTimeout timer expires, then the friendship is considered
terminated. The value is in units of 100 milliseconds, so e.g.
a value of 300 means 30 seconds.
value: 300
BLE_MESH_LPN_INIT_POLL_TIMEOUT:
description: >
The initial value of the PollTimeout timer when Friendship