BLEBeaconScan / my_constants.h /
352ff3a 5 years ago
1 contributor
77 lines | 2.298kb
#ifndef _MY_CONSTANTS_H
#define _MY_CONSTANTS_H

#define APPVER  "1.0.5"
#define APPNAME "BLE Beacon SCAN"

#ifdef ARDUINO_ESP8266_WEMOS_D1MINI
#define BOARD "LOLIN(WEMOS) D1 R2 & Min"
#elif ARDUINO_ESP8266_WEMOS_D1R1
#define BOARD "Wemos D1 R1"
#elif ARDUINO_ESP32_DEV
#define BOARD "ESP32 Wrover Module"
#else
#define BOARD "Unknown"
#endif //ARDUINO_ESP8266_WEMOS_D1MINI & ARDUINO_ESP8266_WEMOS_ & ARDUINO_ESP32_DEV

const char compile_date[] = APPNAME " " BOARD" v" APPVER " " __DATE__ " " __TIME__; 
const char compile_time[] = __DATE__ " " __TIME__; 

//Global Switches
#define HAS_DHT
#define USE_MQTT
#define USE_OTA

#define LED_BUILTIN 2

//#include "my_draw.h"
//#include "my_wifi.h"
//#include "my_sd.h"
//#include "my_ntp.h"
//#include "my_serial.h"
//#include "my_ota.h"
//#include "my_mqtt.h"
//#include "my_http.h"
//#include "my_ble.h"

/*
#define MAX_RUNNING_TIME 50000 //50s
#define MAX_RUNNING_TIME 100000 //100s
#define MAX_RUNNING_TIME 3600000 //1hour
#define MAX_RUNNING_TIME 7200000 //2hours
#define MAX_RUNNING_TIME 10800000 //3hours
#define MAX_RUNNING_TIME 14400000 //4 hours
#define MAX_RUNNING_TIME 18000000 //5 hours
#define MAX_RUNNING_TIME 21600000 //6 hours
#define MAX_RUNNING_TIME 25200000 //7 hours
#define MAX_RUNNING_TIME 28800000 //8 hours
#define MAX_RUNNING_TIME 32400000 //9 hours
#define MAX_RUNNING_TIME 36000000 //10 hours
#define MAX_RUNNING_TIME 39600000 //11 hours
#define MAX_RUNNING_TIME 43200000 //12 hours
*/
#define MAX_RUNNING_TIME 14400000 //4 hours
#define BLINK_FLASH // Define if you want flash blinking during Wifi connection attempts
//#define UPDATE_PERIOD 30000 // Will cause MQTT reconnect as it is too long
#define UPDATE_PERIOD 20000
long timeSinceLastModeSwitch = 0;
uint32_t countMeasures=0;


//#define LOOP_DELAY 10 //Initial Value
#define LOOP_DELAY 100 //Test Value

//BLE scan constants
#define SCAN_TIME  5 // seconds
#define SCAN_TIME_MIN  2 // seconds
#define WINDOW_TIME_MIN  200 // seconds
#define INTERVAL_TIME_MIN  200 // seconds

uint8_t upgradeInProgress=0;
uint8_t gScanTime = SCAN_TIME;
uint8_t gNoFilter = true;
uint16_t gWindow = WINDOW_TIME_MIN;
uint16_t gInterval = INTERVAL_TIME_MIN;
char gFilter[18] = "";

#endif //_MY_CONSTANTS_H