OTGW-firmware/OTGW-firmware.h

54 lines
1.7 KiB
C
Raw Normal View History

2020-10-25 20:48:57 +01:00
/*
***************************************************************************
** Program : OTGW-firmware.h
2021-01-24 12:50:44 +01:00
** Version : v0.7.1
2020-10-25 20:48:57 +01:00
**
** Copyright (c) 2021 Robert van den Breemen
2020-10-25 20:48:57 +01:00
**
** TERMS OF USE: MIT License. See bottom of file.
***************************************************************************
*/
#include <ezTime.h> // https://github.com/ropg/ezTime
#include <TelnetStream.h> // https://github.com/jandrassy/TelnetStream/commit/1294a9ee5cc9b1f7e51005091e351d60c8cddecf
#include <ArduinoJson.h> // https://arduinojson.org/
#include "Wire.h"
#include "Debug.h"
#include "safeTimers.h"
#include "networkStuff.h"
#include "OTGW-Core.h"
//Defaults and macro definitions
2020-12-29 14:13:29 +01:00
#define _HOSTNAME "OTGW"
#define SETTINGS_FILE "/settings.ini"
2020-12-29 14:13:29 +01:00
#define CMSG_SIZE 512
#define JSON_BUFF_MAX 1024
2020-12-29 14:13:29 +01:00
#define CSTR(x) x.c_str()
2021-01-03 23:12:19 +01:00
#define CBOOLEAN(x) (x?"True":"False")
#define CONOFF(x) (x?"On":"Off")
//Global variables
2020-10-25 22:56:18 +01:00
WiFiClient wifiClient;
2020-10-25 23:25:49 +01:00
bool Verbose = false;
char cMsg[CMSG_SIZE];
char fChar[10];
String lastReset = "";
uint32_t upTimeSeconds=0;
2020-11-16 23:20:30 +01:00
uint32_t rebootCount=0;
Timezone CET;
2020-12-29 14:13:29 +01:00
const char *weekDayName[] { "Unknown", "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Unknown" };
const char *flashMode[] { "QIO", "QOUT", "DIO", "DOUT", "Unknown" };
2020-12-29 14:13:29 +01:00
//All things that are settings
String settingHostname = _HOSTNAME;
2020-10-25 22:56:18 +01:00
//MQTT settings
2020-10-25 23:25:49 +01:00
String settingMQTTbroker= "192.168.88.254";
int16_t settingMQTTbrokerPort = 1883;
2020-10-25 22:56:18 +01:00
String settingMQTTuser = "";
String settingMQTTpasswd = "";
String settingMQTTtopTopic = "OTGW";
// That's all folks...