/*
 * Stairs
 * Copyright 2017 (c) Mark van Renswoude
 *
 * https://git.x2software.net/pub/Stairs
*/
#ifndef __config
#define __config

#include <stdint.h>


// Enables debug information to be output through the standard
// Serial connection, disable in production units to improve performance
//#define SerialDebug

// Enables the crash API methods to cause crashes, you probably never
// want to leave this on unless you're debugging the exception handler
//#define EnableCrashAPI


#ifdef SerialDebug
static const uint32_t SerialDebugBaudrate = 115200;
static const uint32_t SerialDebugStartupDelay = 2000;
#endif


static const char* ConnectionSettingsFile = "/connection.json";
static const char* SystemSettingsFile = "/system.json";
static const char* StepsSettingsFile = "/steps.json";
static const char* TimeTriggerSettingsFile = "/timetriggers.json";
static const char* MotionTriggerSettingsFile = "/motiontriggers.json";


static const char* DefaultAPSSIDPrefix = "Stairs-";

static const char* DefaultNTPServer = "pool.ntp.org";

// Timeout when in AP + station mode (otherwise trying to connect
// to the STA will block the AP)
static const uint32_t StationModeTimeout = 30000;

static const uint16_t APButtonHoldTime = 2000;


// Only used if the timezone has not been succesfully retrieved yet, otherwise
// the configurable NTP interval is used
static const uint32_t TimezoneRetryInterval = 60000;


// SSL takes quite a bit of memory (and I haven't been optimizing much),
// which seems to cause memory-related exceptions when getting the timezone
// information from Google's HTTPS API. Google requires HTTPS. The workaround
// is hosting a small proxy script on HTTP, which is included in the "hosted" folder
// of this project. Note that this completely defeats any security, and may
// cause your Google API key and location data to leak. My advice is simply to not
// specify your location too precisely :-)
//
// If you want to host your own version of the script because you don't trust
// that mine will not log anything, or want to disable the proxy script
// completely, change these definitions below. Also update platformio-buildflags.bat
// to enable SSL support in ESPAsyncTCP.
//
// If you can fix my sloppy code and get a direct SSL connection working,
// I'd be interested in the changes as well!
#define MapsAPIViaProxyScript

#ifdef MapsAPIViaProxyScript
static const char* TimezoneProxyScriptHost = "api.x2software.net";
static const char* TimezoneProxyScriptPath = "/timezone.php";
#endif


static const uint8_t InitialisationBrightness = 40;
static const uint8_t InitialisationFadeTime = 250;
static const uint8_t InitialisationBlinkCount = 2;

#endif