18 lines
537 B
C++
18 lines
537 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;
|
|
|
|
return CMD_UNKNOWN;
|
|
}
|