summaryrefslogtreecommitdiffstats
path: root/door_lock/cmd.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2024-11-06 17:57:09 +0800
committerSadeep Madurange <sadeep@asciimx.com>2024-11-06 17:57:09 +0800
commite6c41b84b88596d130de98919480afdb0dce3fcf (patch)
treee65ec4dd6918057854ab833edfd6f51504bb2af6 /door_lock/cmd.c
parent617474e23500edf91db1c35fc89d49f52a42afe7 (diff)
downloadsmart-home-e6c41b84b88596d130de98919480afdb0dce3fcf.tar.gz
Code clean up.
Diffstat (limited to 'door_lock/cmd.c')
-rw-r--r--door_lock/cmd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/door_lock/cmd.c b/door_lock/cmd.c
index b757e33..fb9ae9c 100644
--- a/door_lock/cmd.c
+++ b/door_lock/cmd.c
@@ -1,4 +1,3 @@
-#include <stdint.h>
#include <string.h>
#include "cmd.h"
@@ -11,7 +10,7 @@
static char cmd[XORLEN];
-static inline void xor(const char *s, char *d, uint8_t n)
+static inline void xor(const char *s, char *d, int n)
{
int i;
@@ -19,7 +18,7 @@ static inline void xor(const char *s, char *d, uint8_t n)
d[i] = s[i] ^ KEY[i];
}
-int is_valid_cmd(const char *s, enum command c)
+int cmd_cmp(const char *s, enum command c)
{
int rc;
char buf[XORLEN + 1];
@@ -42,7 +41,7 @@ int is_valid_cmd(const char *s, enum command c)
return rc;
}
-char * get_cmd_hash(enum command c)
+char * cmd_hash(enum command c)
{
switch (c) {
case DOOR_LOCK: