Move config to own file

This commit is contained in:
Christoph Hagen
2022-05-02 16:01:01 +02:00
parent eb982b3287
commit 94dd8f5e92
2 changed files with 95 additions and 50 deletions

View File

@ -13,56 +13,7 @@
#include "message.h"
#include "server.h"
#include "servo.h"
// TODO:
// - Handle WiFi disconnect
// - Implement key sharing
// - Configure/diagnose over Bluetooth?
/* Settings */
constexpr uint32_t serialBaudRate = 115200;
constexpr size_t keySize = 32;
constexpr const uint8_t remoteKey[keySize] = { 1, 2, 3};
constexpr const uint8_t localKey[keySize] = { 1, 2, 3};
// The WiFi network to connect to
constexpr const char* wifiSSID = "MyNetwork";
constexpr const char* wifiPassword = "MyPassword";
constexpr uint32_t wifiReconnectInterval = 10000;
// The remote server to connect to
constexpr const char* serverUrl = "mydomain.com";
constexpr const int serverPort = 443;
constexpr const char* serverPath = "/sesame/listen";
constexpr const char* serverAccessKey = "MyAccessToken";
/* Time */
constexpr const char* ntpServerUrl = "pool.ntp.org";
constexpr int32_t timeOffsetToGMT = 3600;
constexpr int32_t timeOffsetDaylightSavings = 3600;
/* Servo */
// Servo is Emax ES08MA II
// The time (in ms) to keep the door button pressed
constexpr uint32_t lockOpeningDuration = 1500;
// The timer to use to control the servo
constexpr int pwmTimer = 0;
// Pin wired up to the servo data line
constexpr int servoPin = 14;
// The Emax is a standard 50 Hz servo
constexpr int servoFrequency = 50;
// The microseconds to set the servo to the pressed and released states
constexpr int servoPressedState = 1720;//1600;
constexpr int servoReleasedState = 1520;
#include "config.h"
/* Global variables */