#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <lasertag_utils.h>

LOG_MODULE_REGISTER(MMS, LOG_LEVEL_INF);

int main(void)
{
    LOG_INF("Starting Utils test application...");
    lasertag_utils_init();

    uint8_t data[] = {0xde, 0xad, 0xbe, 0xef, 0xca, 0xfe, 0xba, 0xbe};
    uint8_t crc = lastertag_crc8(data, sizeof(data));
    LOG_INF("CRC8: 0x%02X", crc);
    if (crc != 0xbe) {
        LOG_ERR("CRC8 check failed!!");
    } else {
        LOG_INF("CRC8 check passed.");
    }
    LOG_INF(FORMAT_BLUE_BOLD("This should be in blue and bold if ANSI color codes are supported in the terminal."));
    LOG_INF("Here, only a part should be " FORMAT_RED("red") " and the rest normal.");
    LOG_INF(FORMAT_RED_BOLD("this ") FORMAT_GREEN_BOLD("is ") FORMAT_BLUE_BOLD("colorful") FORMAT_YELLOW_BOLD(" as") FORMAT_BRIGHT_BOLD(" fuck") "!");
    return 0;
}
