tab size, m_errorCount

This commit is contained in:
Wolfgang Hottgenroth 2017-01-04 17:07:08 +01:00
parent a18234f696
commit 8b34b562f8
2 changed files with 8 additions and 5 deletions

View File

@ -140,7 +140,7 @@ MeterBusMaster::MeterBusMaster() : m_sendOctets(this), m_measureCurrent(this),
m_calibrationSupport(this), m_calibrationSupport(this),
m_cmdReadyToSend(false), m_cmdReadyFromRecv(false), m_expectResponse(false), m_cmdReadyToSend(false), m_cmdReadyFromRecv(false), m_expectResponse(false),
m_sendBufLen(0), m_recvBufLen(0), m_retransmitCount(0), m_token(0), m_sendBufLen(0), m_recvBufLen(0), m_retransmitCount(0), m_token(0),
m_responseCallback(0), m_sampling(true), m_calibration(false) { m_responseCallback(0), m_sampling(true), m_calibration(false), m_errorCount(0) {
pinMode(RX_EN_PIN, OUTPUT); pinMode(RX_EN_PIN, OUTPUT);
digitalWrite(RX_EN_PIN, RX_DISABLE); digitalWrite(RX_EN_PIN, RX_DISABLE);
Serial3.begin(2400); Serial3.begin(2400);
@ -176,6 +176,8 @@ void MeterBusMaster::prepareResponse(bool err, uint8_t in) {
//Serial << "r0" << endl; //Serial << "r0" << endl;
if (err) { if (err) {
m_errorCount++;
//Serial << "r1" << endl; //Serial << "r1" << endl;
if (m_responseCallback != 0) { if (m_responseCallback != 0) {
m_responseCallback->sendError(1, m_token, m_name); m_responseCallback->sendError(1, m_token, m_name);

View File

@ -81,6 +81,7 @@ private:
uint8_t m_recvBuffer[RECEIVE_BUFFER_SIZE]; uint8_t m_recvBuffer[RECEIVE_BUFFER_SIZE];
bool m_sampling; bool m_sampling;
bool m_calibration; bool m_calibration;
uint16_t m_errorCount;
void prepareResponse(bool err, uint8_t in); void prepareResponse(bool err, uint8_t in);
void sample(); void sample();
void hold(); void hold();