summaryrefslogtreecommitdiffstats
path: root/lock/fend.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-04-27 12:07:12 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-04-27 12:07:12 +0800
commiteb3fc69e8461b61597a6837618bed27d4385f2e6 (patch)
treea882fb7880d4c315244a05f0bf76904156e60e52 /lock/fend.c
parent5e4eb6bef2a611ef4f39dbf577c550317b965e7f (diff)
downloadsmart-home-eb3fc69e8461b61597a6837618bed27d4385f2e6.tar.gz
Controlling servo with xor encryption (wo session key).
Diffstat (limited to 'lock/fend.c')
-rw-r--r--lock/fend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lock/fend.c b/lock/fend.c
index 927c310..e44155b 100644
--- a/lock/fend.c
+++ b/lock/fend.c
@@ -62,8 +62,9 @@ int main(void)
for (;;) {
if (islock) {
+ xor(KEY, LOCK, buf, WDLEN);
do {
- sync = radio_sendto(txaddr, LOCK, WDLEN);
+ sync = radio_sendto(txaddr, buf, WDLEN);
_delay_ms(50);
} while (!sync);
sync = 0;
@@ -72,8 +73,9 @@ int main(void)
}
if (isunlock) {
+ xor(KEY, UNLOCK, buf, WDLEN);
do {
- sync = radio_sendto(txaddr, UNLOCK, WDLEN);
+ sync = radio_sendto(txaddr, buf, WDLEN);
_delay_ms(50);
} while (!sync);
sync = 0;