dns_sd/fader.cpp : Check for the protocol state before sending heart beat in fader::tick()

This commit is contained in:
kpl 2020-03-04 14:08:41 -05:00
parent e0c69bfd25
commit 20f1008665

View File

@ -52,6 +52,8 @@ fader::rc_t fader::receive( const void* buf, unsigned bufByteN )
rc_t rc = kOkRC;
const uint8_t* b = (const uint8_t*)buf; // current msg ptr
const uint8_t* bend = b + bufByteN; // end of buffer ptr
printf("RECV:%i\n",bufByteN);
while(b<bend)
{
@ -146,7 +148,8 @@ fader::rc_t fader::tick()
if( _tickN == _ticksPerHeartBeat )
{
_tickN = 0;
_send_heartbeat();
if( _protoState == kWaitForHeartBeat_Id )
_send_heartbeat();
}
return rc;