Files
eink-dairy/command_processor.cpp
T
2025-12-28 21:59:59 -05:00

19 lines
593 B
C++

#include "command_processor.h"
#include <string.h>
#include <stdio.h>
CommandAction parse_command(const char* input) {
if (input[0] != '/') {
return CMD_NONE;
}
if (strcmp(input, "/refresh") == 0) return CMD_REFRESH;
if (strcmp(input, "/clear") == 0) return CMD_CLEAR;
if (strcmp(input, "/scan") == 0) return CMD_SCAN;
if (strncmp(input, "/connect ", 9) == 0 || strcmp(input, "/connect") == 0) return CMD_CONNECT;
if (strcmp(input, "/status") == 0) return CMD_STATUS;
if (strcmp(input, "/image") == 0) return CMD_IMAGE;
return CMD_UNKNOWN;
}