#pragma once

#include <Arduino.h>

#ifndef BOARD_ID
#define BOARD_ID "BOB"
#endif

#ifndef GNSS_CHIP_NAME
#define GNSS_CHIP_NAME "L76K"
#endif

#ifndef OLED_SDA
#define OLED_SDA 17
#endif

#ifndef OLED_SCL
#define OLED_SCL 18
#endif

#ifndef OLED_ADDR
#define OLED_ADDR 0x3C
#endif

#ifndef RTC_I2C_ADDR
#define RTC_I2C_ADDR 0x51
#endif

#ifndef GPS_BAUD
#define GPS_BAUD 9600
#endif

#ifndef GPS_RX_PIN
#define GPS_RX_PIN 9
#endif

#ifndef GPS_TX_PIN
#define GPS_TX_PIN 8
#endif

#ifndef BUTTON_PIN
#define BUTTON_PIN 0
#endif

#ifndef FW_BUILD_UTC
#define FW_BUILD_UTC unknown
#endif

#ifndef LOG_AP_IP_OCTET
#define LOG_AP_IP_OCTET 23
#endif

#ifndef GNSS_DIAG
#define GNSS_DIAG 0
#endif

#define FIELD_QA_STR_INNER(x) #x
#define FIELD_QA_STR(x) FIELD_QA_STR_INNER(x)

namespace field_qa {

static constexpr const char* kExerciseName = "18_GPS_Field_QA";
static constexpr const char* kFirmwareVersion = FIELD_QA_STR(FW_BUILD_UTC);
static constexpr const char* kBoardId = BOARD_ID;
static constexpr const char* kGnssChip = GNSS_CHIP_NAME;
static constexpr const char* kStorageName = "SD";
static constexpr const char* kLogDir = "/logs";
static constexpr const char* kLogApPrefix = "GPSQA-";
static constexpr const char* kLogApPassword = "";
static constexpr uint8_t kLogApIpOctet = LOG_AP_IP_OCTET;
static constexpr uint32_t kSerialDelayMs = 4000;
static constexpr uint32_t kSamplePeriodMs = 1000;
static constexpr uint32_t kLogFlushPeriodMs = 10000;
static constexpr uint32_t kDisplayPeriodMs = 1000;
static constexpr uint32_t kStatusPeriodMs = 1000;
static constexpr uint32_t kProbeWindowL76kMs = 20000;
static constexpr uint32_t kProbeWindowUbloxMs = 45000;
static constexpr uint32_t kFixFreshMs = 5000;
static constexpr uint8_t kPoorMinSatsUsed = 4;
static constexpr uint8_t kGoodMinSatsUsed = 10;
static constexpr uint8_t kExcellentMinSatsUsed = 16;
static constexpr float kMarginalHdop = 3.0f;
static constexpr float kExcellentHdop = 1.5f;
static constexpr size_t kBufferedSamples = 10;
static constexpr size_t kMaxSatellites = 64;
static constexpr size_t kStorageBufferBytes = 4096;
static constexpr uint8_t kStorageWriteRetryCount = 3;
static constexpr uint32_t kStorageWriteRetryDelayMs = 25;
static constexpr uint32_t kClockDisciplineRetryMs = 5000;
static constexpr uint32_t kClockPpsWaitTimeoutMs = 1500;
static constexpr uint32_t kClockFreshSampleMs = 2000;
static constexpr uint32_t kMaxLogFilesBeforePause = 1000;

}  // namespace field_qa
