/**
 * @file sanitycheck.h
 *
 * @brief Header file for sanity checks and configuration validation in the ChainLube application.
 *
 * This file contains checks and validations to ensure that the configuration and features of the
 * ChainLube application are compatible with the selected PCB revision and defined parameters.
 *
 * @author Marcel Peterkau
 * @date   09.01.2024
 */

#ifndef _SANITYCHECK_H_
#define _SANITYCHECK_H_

#ifndef PCB_REV
    #error "You must define PCB_REV"
#else
    #if PCB_REV < 1 || PCB_REV > 4
        #error "Unsupported PCB-Revision"
    #endif

    #if PCB_REV < 3 && defined(FEATURE_ENABLE_CAN)
        #error "CAN-Feature unsupported with this PCB-Rev"
    #endif
    #if PCB_REV < 4 && defined(DFEATURE_ENABLE_GPS)
        #error "GPS-Feature unsupported with this PCB-Rev"
    #endif
#endif

#ifndef ADMIN_PASSWORD
    #error "You need to define ADMIN_PASSWORD for OTA-Update"
#endif

#ifdef FEATURE_ENABLE_WIFI_CLIENT
    #ifndef WIFI_PASSWORD_CLIENT
        #error "You must define an WIFI_PASSWORD for Client-Mode"
    #endif

    #ifndef WIFI_SSID_CLIENT
        #error "You must define an WIFI_SSID for Client-Mode"
    #endif
#endif

#ifndef WIFI_AP_PASSWORD
#error "You must define an WIFI_AP_PASSWORD for Standalone AP-Mode"
#endif

#endif // _SANITYCHECK_H_
