ESP32_ChinaDieselHeater_Con.../Arduino/BTCDieselHeater/TxManage.h
rljonesau 668870580e Added code to allow injection of test commands into unknown protocol values to see if some sort of
reaction could be found - none so far.
Added Blue LED flash on ESP32 when Rx'ing serial blue wire data.
Created a UtilClasses.h file for utility classes.
2018-11-06 20:43:54 +11:00

35 lines
763 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 queueRawCommand(unsigned char val);
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 char _rawCommand;
unsigned long m_nStartTime;
HardwareSerial& m_BlueWireSerial;
};
extern CTxManage TxManage;