ESP32_ChinaDieselHeater_Con.../Arduino/SenderTrial2/TxManage.h

33 lines
613 B
C
Raw Normal View History

#include <Arduino.h>
2018-09-23 11:15:49 +02:00
#include "Protocol.h"
class CTxManage
{
2018-09-23 10:59:19 +02:00
const int m_nStartDelay = 20;
const int m_nFrameTime = 14;
const int m_nFrontPorch = 2;
public:
CTxManage(int TxEnbPin, HardwareSerial& serial);
void RequestOn();
void RequestOff();
2018-09-23 11:15:49 +02:00
void Start(const CProtocol& ref, unsigned long timenow, bool self);
2018-09-23 10:59:19 +02:00
bool CheckTx(unsigned long timenow);
void Report();
void begin();
private:
2018-09-23 11:15:49 +02:00
CProtocol m_Frame;
bool m_bOnReq;
bool m_bOffReq;
bool m_bTxPending;
int m_nTxEnbPin;
unsigned long m_nStartTime;
HardwareSerial& m_Serial;
void _send();
};
extern CTxManage TxManage;