Home Forums EasyTransfer Library Support Forum How to check connection Reply To: How to check connection

#2997
Bill
Member

Michelterres,

 

The easiest way to to implement a ‘watchdog timer’ like Michael suggests. It’s simple, here in sudo-code:

//check and see if a data packet has come in.
//This function only returns true when a new message has come in
  if(ET.receiveData()){
last_message=mills()
….}
else if((millis() – last_message) >= 1000) {
//this is true when no message has been received for 1 second.
failsafe code here
It is more intensive to implement a query system like you are thinking.