Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Mirf/examples/ping_server/ping_server.pde
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,20 @@ void loop(){

Mirf.send(data);

/*
* This code prevents the server from an infinit
* send loop if client moves out of reach.
*/
boolean flush_rx = true;
for(int count=0; count<100; count++){
if(!Mirf.isSending()){
flush_rx = false;
break;
}
delay(5);
}
if(flush_rx) Mirf.flushRx();

/*
* Wait untill sending has finished
*
Expand Down