From 72ba8a8d6836027eaa12bb23bddf8f72900853ab Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Mon, 9 Oct 2023 15:17:04 -0700 Subject: [PATCH] client: Exponential backoff resend intervals --- client/config.c | 1 - client/config.h | 1 - client/tattlekey.c | 4 +++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/config.c b/client/config.c index 9bd216d..8a31cf5 100644 --- a/client/config.c +++ b/client/config.c @@ -24,4 +24,3 @@ u32_t config_minimum_seconds_between_button_presses = 1; /* Send each report multiple times. */ uint config_resend_count = 5; -u32_t config_resend_interval_ms = 1000; diff --git a/client/config.h b/client/config.h index 91345f9..744e586 100644 --- a/client/config.h +++ b/client/config.h @@ -27,6 +27,5 @@ extern u32_t config_minimum_seconds_between_button_presses; /* Send each report multiple times. */ extern uint config_resend_count; -extern u32_t config_resend_interval_ms; #endif diff --git a/client/tattlekey.c b/client/tattlekey.c index 9af9b5a..c38de12 100644 --- a/client/tattlekey.c +++ b/client/tattlekey.c @@ -14,7 +14,9 @@ typedef struct { u8_t send_count; } send_t; -uint32_t next_send(send_t *s) { return s->timestamp + s->send_count; } +uint32_t next_send(send_t *s) { + return s->timestamp + (1 << s->send_count) - 1; +} bool next_send_less_than(void *user_data, pheap_node_id_t a, pheap_node_id_t b) { -- 2.44.1