From 45e512acd39b28129af00d7619caec7dedac393e Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Sun, 1 Jun 2025 19:00:21 +0800 Subject: Client: try twice to sync. --- lock/client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lock/client.c b/lock/client.c index e983225..b092ddf 100644 --- a/lock/client.c +++ b/lock/client.c @@ -76,7 +76,7 @@ static inline void fpm_nok(void) int main(void) { - int i; + int i, retries; uint8_t rxaddr[ADDRLEN] = { 194, 178, 82 }; uint8_t txaddr[ADDRLEN] = { 194, 178, 83 }; @@ -110,7 +110,11 @@ int main(void) } xor(KEY, SYN, buf, WDLEN); - sync = radio_sendto(txaddr, buf, WDLEN); + retries = 0; + do { + sync = radio_sendto(txaddr, buf, WDLEN); + retries++; + } while (!sync && retries < 2); if (!sync) { islock = 0; -- cgit v1.2.3