This commit is contained in:
Your Name
2026-07-27 15:09:32 +03:00
commit fa89c89fbe
21 changed files with 1043 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#include "command_handler.h"
#include "led.h"
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(command_handler, LOG_LEVEL_INF);
int command_handler(struct command_message_t *msg) {
if (msg == NULL) {
LOG_ERR("Received NULL message pointer");
return -EINVAL;
}
LOG_DBG("Processing command: %d, length: %d", msg->command, msg->length);
switch (msg->command) {
case COMMAND_ERROR: {
LOG_WRN("Received COMMAND_ERROR");
break;
}
case LED: {
// Toggle LED with the LED command
led_toggle();
break;
}
default: {
LOG_WRN("Unknown command received: %d", msg->command);
return -EINVAL;
}
}
return 0;
}