2018-11-26 12:58:15 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the "bluetoothheater" distribution
|
|
|
|
* (https://gitlab.com/mrjones.id.au/bluetoothheater)
|
|
|
|
*
|
2019-09-08 02:14:36 +02:00
|
|
|
* Copyright (C) 2019 Ray Jones <ray@mrjones.id.au>
|
2018-11-26 12:58:15 +01:00
|
|
|
* Copyright (C) 2018 James Clark
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-05-20 14:09:59 +02:00
|
|
|
#ifndef __BTC_HELPERS_H__
|
|
|
|
#define __BTC_HELPERS_H__
|
|
|
|
|
2019-06-16 01:09:29 +02:00
|
|
|
#include "UtilClasses.h"
|
2018-12-08 13:25:53 +01:00
|
|
|
|
2019-10-18 03:55:16 +02:00
|
|
|
class CTempSense;
|
2019-06-04 22:15:12 +02:00
|
|
|
struct sGPIO;
|
|
|
|
|
2019-06-29 10:08:37 +02:00
|
|
|
extern void forceBootInit();
|
2018-12-01 01:36:25 +01:00
|
|
|
|
2019-11-21 09:25:14 +01:00
|
|
|
extern int requestOn(bool checkTemp=true);
|
2018-12-15 10:34:58 +01:00
|
|
|
extern void requestOff();
|
2019-07-19 22:53:12 +02:00
|
|
|
extern bool reqDemandDelta(int delta);
|
|
|
|
extern bool reqDemand(uint8_t newTemp, bool save=true);
|
2018-12-20 05:19:59 +01:00
|
|
|
extern bool reqThermoToggle();
|
2019-07-06 15:46:20 +02:00
|
|
|
extern bool setThermostatMode(uint8_t);
|
2019-03-14 11:52:59 +01:00
|
|
|
extern bool getThermostatModeActive(); // OEM: actual mode from blue wire, BTC: or our NV
|
2019-08-07 10:59:30 +02:00
|
|
|
extern bool getExternalThermostatModeActive();
|
|
|
|
extern bool getExternalThermostatOn();
|
2019-08-26 22:13:01 +02:00
|
|
|
extern const char* getExternalThermostatHoldTime();
|
2018-12-15 10:34:58 +01:00
|
|
|
extern void reqPumpPrime(bool on);
|
2019-06-29 10:08:37 +02:00
|
|
|
extern float getTemperatureDesired(); // OEM: the advertised value, BTC our setpoint
|
|
|
|
extern uint8_t getDemandDegC();
|
2019-07-03 15:01:36 +02:00
|
|
|
extern void setDemandDegC(uint8_t val);
|
2019-06-29 10:08:37 +02:00
|
|
|
extern uint8_t getDemandPump();
|
|
|
|
|
2019-10-18 03:55:16 +02:00
|
|
|
extern float getTemperatureSensor(int source = 0);
|
2018-11-28 12:15:23 +01:00
|
|
|
extern void setPumpMin(float);
|
|
|
|
extern void setPumpMax(float);
|
2019-07-06 15:46:20 +02:00
|
|
|
extern void setFanMin(uint16_t);
|
|
|
|
extern void setFanMax(uint16_t);
|
|
|
|
extern void setFanSensor(uint8_t cVal);
|
2018-12-15 10:34:58 +01:00
|
|
|
extern void setDateTime(const char* newTime);
|
|
|
|
extern void setDate(const char* newTime);
|
|
|
|
extern void setTime(const char* newTime);
|
2019-07-06 15:46:20 +02:00
|
|
|
extern void setGlowDrive(uint8_t val);
|
2018-11-29 12:11:50 +01:00
|
|
|
extern void saveNV();
|
2019-01-11 06:40:25 +01:00
|
|
|
extern void setSystemVoltage(float val);
|
2019-04-19 13:38:39 +02:00
|
|
|
extern void interpretJsonCommand(char* pLine);
|
|
|
|
extern void resetWebModerator();
|
2019-09-04 12:59:01 +02:00
|
|
|
extern void resetFuelGauge();
|
2018-12-20 23:22:29 +01:00
|
|
|
extern const char* getBlueWireStatStr();
|
2019-04-19 13:38:39 +02:00
|
|
|
extern bool hasOEMcontroller();
|
|
|
|
extern bool hasOEMLCDcontroller();
|
|
|
|
extern int getBlueWireStat();
|
|
|
|
extern int getSmartError();
|
|
|
|
extern bool isCyclicActive();
|
|
|
|
extern float getVersion();
|
2020-01-04 08:13:40 +01:00
|
|
|
const char* getVersionStr(bool beta=false);
|
2019-04-19 13:38:39 +02:00
|
|
|
extern const char* getVersionDate();
|
|
|
|
extern int getBoardRevision();
|
|
|
|
extern void setupGPIO();
|
2019-08-01 14:57:18 +02:00
|
|
|
extern bool setGPIOout(int channel, bool state);
|
2019-06-02 14:47:35 +02:00
|
|
|
extern bool getGPIOout(int channel);
|
|
|
|
extern bool toggleGPIOout(int channel);
|
2019-05-18 10:49:22 +02:00
|
|
|
extern void feedWatchdog();
|
2019-08-03 04:42:49 +02:00
|
|
|
extern int isUpdateAvailable(bool test=true);
|
2019-05-20 14:09:59 +02:00
|
|
|
extern void checkFOTA();
|
2019-06-02 14:47:35 +02:00
|
|
|
extern void setUploadSize(long val);
|
2019-06-04 22:15:12 +02:00
|
|
|
extern void getGPIOinfo(sGPIO& info);
|
|
|
|
extern void simulateGPIOin(uint8_t newKey);
|
2019-06-06 03:32:43 +02:00
|
|
|
extern void setDegFMode(bool state);
|
2019-07-21 13:17:54 +02:00
|
|
|
extern float getBatteryVoltage(bool fast);
|
2019-07-06 15:46:20 +02:00
|
|
|
extern float getGlowVolts();
|
|
|
|
extern float getGlowCurrent();
|
2019-09-21 01:58:51 +02:00
|
|
|
extern int getFanSpeed();
|
2019-07-15 11:56:36 +02:00
|
|
|
extern int sysUptime();
|
2019-09-01 09:35:12 +02:00
|
|
|
extern void doJSONwatchdog(int topup);
|
2019-09-17 00:30:49 +02:00
|
|
|
extern void reloadScreens();
|
2019-10-18 03:55:16 +02:00
|
|
|
extern CTempSense& getTempSensor() ;
|
2020-03-23 06:54:15 +01:00
|
|
|
extern void reqHeaterCalUpdate();
|
2019-09-17 00:30:49 +02:00
|
|
|
|
2019-05-20 14:09:59 +02:00
|
|
|
|
2019-08-10 13:45:28 +02:00
|
|
|
void setSSID(const char* name);
|
|
|
|
void setAPpassword(const char* name);
|
2019-04-04 12:48:05 +02:00
|
|
|
|
2019-06-02 22:34:45 +02:00
|
|
|
extern void ShowOTAScreen(int percent=0, eOTAmodes updateType=eOTAnormal);
|
|
|
|
|
2019-09-20 15:00:27 +02:00
|
|
|
extern void updateMQTT();
|
|
|
|
extern void refreshMQTT();
|
2020-03-23 06:54:15 +01:00
|
|
|
extern void requestMQTTrestart();
|
2019-06-02 22:34:45 +02:00
|
|
|
|
2019-05-20 14:09:59 +02:00
|
|
|
#endif
|