ESP32_ChinaDieselHeater_Con.../Arduino/SenderTrial2/TxManage.h
rljonesau 1325ae6038 Added NV Storage for ESP32
Changed "USB" to "DebugPort"
Tidy up of blue wire data frames and passing about by reference instead of just the data buffer.
Added AppInventor application
2018-10-20 18:11:23 +11:00

33 lines
691 B
C++

#include <Arduino.h>
#include "Protocol.h"
class CTxManage
{
const int m_nStartDelay = 20;
const int m_nFrameTime = 14;
const int m_nFrontPorch = 2;
public:
CTxManage(int TxGatePin, HardwareSerial& serial);
void queueOnRequest();
void queueOffRequest();
void PrepareFrame(const CProtocol& Frame, bool isBTCmaster);
void Start(unsigned long timenow);
bool CheckTx(unsigned long timenow);
void begin();
const CProtocol& getFrame() const { return m_TxFrame; };
private:
CProtocol m_TxFrame;
bool m_bOnReq;
bool m_bOffReq;
bool m_bTxPending;
int m_nTxGatePin;
unsigned long m_nStartTime;
HardwareSerial& m_BlueWireSerial;
};
extern CTxManage TxManage;