dns_sd/fader.cpp : Check for the protocol state before sending heart beat in fader::tick()
This commit is contained in:
parent
e0c69bfd25
commit
20f1008665
@ -53,6 +53,8 @@ fader::rc_t fader::receive( const void* buf, unsigned bufByteN )
|
|||||||
const uint8_t* b = (const uint8_t*)buf; // current msg ptr
|
const uint8_t* b = (const uint8_t*)buf; // current msg ptr
|
||||||
const uint8_t* bend = b + bufByteN; // end of buffer ptr
|
const uint8_t* bend = b + bufByteN; // end of buffer ptr
|
||||||
|
|
||||||
|
printf("RECV:%i\n",bufByteN);
|
||||||
|
|
||||||
while(b<bend)
|
while(b<bend)
|
||||||
{
|
{
|
||||||
// if this is the start of a new msg
|
// if this is the start of a new msg
|
||||||
@ -146,7 +148,8 @@ fader::rc_t fader::tick()
|
|||||||
if( _tickN == _ticksPerHeartBeat )
|
if( _tickN == _ticksPerHeartBeat )
|
||||||
{
|
{
|
||||||
_tickN = 0;
|
_tickN = 0;
|
||||||
_send_heartbeat();
|
if( _protoState == kWaitForHeartBeat_Id )
|
||||||
|
_send_heartbeat();
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user