diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-06-01 19:00:21 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-06-01 19:00:21 +0800 |
| commit | 45e512acd39b28129af00d7619caec7dedac393e (patch) | |
| tree | 29a4d85f0e3e74feef2be722d268666431fc2cdf | |
| parent | 0cd2520c972d1f9f7f5bcfdd011e20ef2b830d46 (diff) | |
| download | smart-home-45e512acd39b28129af00d7619caec7dedac393e.tar.gz | |
Client: try twice to sync.
| -rw-r--r-- | lock/client.c | 8 |
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; |
