Skip to content

Commit

Permalink
increase duplicate packets for /jl to improve reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
rayshobby committed Dec 3, 2014
1 parent e596f46 commit 11303a8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/interval_program/server.ino
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ void server_json_programs_main() {
else
bfill.emit_p(PSTR("\"]"));
if (pid%3==2) { // push out a packet every 4 programs
ether.httpServerReply_with_flags(bfill.position(), TCP_FLAGS_ACK_V);
ether.httpServerReply_with_flags(bfill.position(), TCP_FLAGS_ACK_V, 3);
bfill=ether.tcpOffset();
}
}
Expand Down Expand Up @@ -504,7 +504,6 @@ byte server_home(char *p)
bfill.emit_p(PSTR("var ver=$D,ipas=$D;</script>\n"),
OS_FW_VERSION, os.options[OPTION_IGNORE_PASSWORD].value);
bfill.emit_p(PSTR("<script src=\"$E/home.js\"></script>\n</body>\n</html>"), ADDR_EEPROM_SCRIPTURL);
//ether.httpServerReply_with_flags(bfill.position(), TCP_FLAGS_ACK_V|TCP_FLAGS_FIN_V);
return HTML_OK;
}

Expand Down Expand Up @@ -840,8 +839,11 @@ byte server_change_manual(char *p) {

/**
Get log data
Command: /jl?start=x&end=x&type=x
Command: /jl?start=x&end=x&hist=x&type=x
hist: history (past n days)
when hist is speceified, the start
and end parameters below will be ignored
start: start time (epoch time)
end: end time (epoch time)
type: type of log records (optional)
Expand Down Expand Up @@ -921,7 +923,7 @@ byte server_json_log(char *p) {
else { bfill.emit_p(PSTR(",$S"), tmp_buffer); }
count ++;
if (count % 25 == 0) { // push out a packet every 25 records
ether.httpServerReply_with_flags(bfill.position(), TCP_FLAGS_ACK_V);
ether.httpServerReply_with_flags(bfill.position(), TCP_FLAGS_ACK_V, 3);
bfill=ether.tcpOffset();
count = 0;
}
Expand Down

0 comments on commit 11303a8

Please sign in to comment.