#ifndef _DEBUGGER_H_
#define _DEBUGGER_H_

#include <Arduino.h>
#include "webui.h"

const char PROGMEM helpCmd[] = "sysinfo     - System Info\n"
                               "netinfo     - WiFi Info\n"
                               "formatPDS   - Format Persistence EEPROM Data\n"
                               "formatCFG   - Format Configuration EEPROM Data\n"
                               "checkEE     - Check EEPROM with checksum\n"
                               "dumpEE1k    - dump the first 1kb of EEPROM to Serial\n"
                               "dumpEE      - dump the whole EPPROM to Serial\n"
                               "resetPageEE - Reset the PersistenceData Page\n"
                               "dumpCFG     - print Config struct\n"
                               "dumpPDS     - print PersistanceStruct\n"
                               "saveEE      - save EE-Data\n"
                               "showdtc     - Show all DTCs\n"
                               "dumpGlobals - print globals\n";

typedef enum DebugStatus_e
{
    disabled,
    enabled
} DebugStatus_t;

typedef enum DebugPorts_e
{
    dbg_Serial,
    dbg_Webui,
    dbg_cntElements
} DebugPorts_t;

const char sDebugPorts[dbg_cntElements][7] = {
    "Serial",
    "WebUI"};

extern DebugStatus_t DebuggerStatus[dbg_cntElements];

void initDebugger();
void pushCANDebug(uint32_t id, uint8_t dlc, uint8_t *data);
void Debug_pushMessage(const char *format, ...);
void SetDebugportStatus(DebugPorts_t port, DebugStatus_t status);
void Debug_Process();

#endif