summaryrefslogtreecommitdiffstats
path: root/lock/client.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-06-01 19:00:21 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-06-01 19:00:21 +0800
commit45e512acd39b28129af00d7619caec7dedac393e (patch)
tree29a4d85f0e3e74feef2be722d268666431fc2cdf /lock/client.c
parent0cd2520c972d1f9f7f5bcfdd011e20ef2b830d46 (diff)
downloadsmart-home-45e512acd39b28129af00d7619caec7dedac393e.tar.gz
Client: try twice to sync.
Diffstat (limited to 'lock/client.c')
-rw-r--r--lock/client.c8
1 files 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;