Skip to content

Commit

Permalink
Bluetooth: Mesh: Don't reset PB ADV reliable timer on retransmit
Browse files Browse the repository at this point in the history
The send_reliable function was reused in multiple places as part of the
k_delayed_work changes for Bluetooth Mesh in #33782. This function
contains a line that resets the start timer, causing prov_retransmit to
continously move the goal post for when to give up sending.

Extract this line out of the send_reliable function, and put it along
with the other link.tx initialization in bearer_ctl_send and
prov_send_adv.

Signed-off-by: Trond Einar Snekvik <[email protected]>
  • Loading branch information
trond-snekvik authored and jhedberg committed May 19, 2021
1 parent 10011fd commit 85ad497
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subsys/bluetooth/mesh/pb_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,6 @@ static void send_reliable(void)
{
int i;

link.tx.start = k_uptime_get();

for (i = 0; i < ARRAY_SIZE(link.tx.buf); i++) {
struct net_buf *buf = link.tx.buf[i];

Expand Down Expand Up @@ -642,6 +640,7 @@ static int bearer_ctl_send(uint8_t op, const void *data, uint8_t data_len,
net_buf_add_mem(buf, data, data_len);

if (reliable) {
link.tx.start = k_uptime_get();
link.tx.buf[0] = buf;
send_reliable();
} else {
Expand Down Expand Up @@ -677,6 +676,7 @@ static int prov_send_adv(struct net_buf_simple *msg,
link.tx.buf[0] = start;
link.tx.cb = cb;
link.tx.cb_data = cb_data;
link.tx.start = k_uptime_get();

BT_DBG("xact_id: 0x%x len: %u", link.tx.id, msg->len);

Expand Down

0 comments on commit 85ad497

Please sign in to comment.