summaryrefslogtreecommitdiffstats
path: root/lock/bend.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/bend.c
parent5e4eb6bef2a611ef4f39dbf577c550317b965e7f (diff)
downloadsmart-home-eb3fc69e8461b61597a6837618bed27d4385f2e6.tar.gz
Controlling servo with xor encryption (wo session key).
Diffstat (limited to 'lock/bend.c')
-rw-r--r--lock/bend.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lock/bend.c b/lock/bend.c
index 8436770..b0a0074 100644
--- a/lock/bend.c
+++ b/lock/bend.c
@@ -134,11 +134,12 @@ int main(void)
n = radio_recv(buf, WDLEN);
buf[n] = '\0';
rxd = 0;
+ xor(KEY, buf, msg, WDLEN + 1);
uart_write("recv: ");
- uart_write(buf);
- if (strncmp(buf, LOCK, WDLEN) == 0)
+ uart_write(msg);
+ if (strncmp(msg, LOCK, WDLEN) == 0)
lock();
- else if (strncmp(buf, UNLOCK, WDLEN) == 0)
+ else if (strncmp(msg, UNLOCK, WDLEN) == 0)
unlock();
}
}