Skip to content

Commit

Permalink
esp32 : remove \r\n in log_d() log_i()
Browse files Browse the repository at this point in the history
  • Loading branch information
dam74 committed Dec 30, 2023
1 parent 4b30585 commit f62dc56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESPping
version=1.0.3
version=1.0.4
author=dvarrel, Daniele Colanardi, Marian Craciunescu
maintainer=dvarrel
sentence=Let the ESP32/ESP8266 ping a remote machine.
Expand Down
10 changes: 5 additions & 5 deletions src/ping32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void ping_recv(int s) {
}

// Print ...
log_d("%d bytes from %s: icmp_seq=%d time=%.3f ms\r\n", len, ipa,
log_d("%d bytes from %s: icmp_seq=%d time=%.3f ms", len, ipa,
ntohs(iecho->seqno), elapsed
);

Expand All @@ -230,7 +230,7 @@ static void ping_recv(int s) {
}

if (len < 0) {
log_d("Request timeout for icmp_seq %d\r\n", ping_seq_num);
log_d("Request timeout for icmp_seq %d", ping_seq_num);
}
}
/*
Expand Down Expand Up @@ -321,7 +321,7 @@ bool ping_start(IPAddress adr, int count=0, int interval=0, int size=0, int time
char ipa[16];

strcpy(ipa, inet_ntoa(ping_target));
log_i("PING %s: %d data bytes\r\n", ipa, size);
log_i("PING %s: %d data bytes", ipa, size);

ping_seq_num = 0;

Expand All @@ -337,7 +337,7 @@ bool ping_start(IPAddress adr, int count=0, int interval=0, int size=0, int time

closesocket(s);

log_i("%d packets transmitted, %d packets received, %.1f%% packet loss\r\n",
log_i("%d packets transmitted, %d packets received, %.1f%% packet loss",
transmitted,
received,
((((float)transmitted - (float)received) / (float)transmitted) * 100.0)
Expand All @@ -346,7 +346,7 @@ bool ping_start(IPAddress adr, int count=0, int interval=0, int size=0, int time

if (ping_o) {
ping_resp pingresp;
log_i("round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f ms\r\n", min_time, mean_time, max_time, sqrt(var_time / received));
log_i("round-trip min/avg/max/stddev = %.3f/%.3f/%.3f/%.3f ms", min_time, mean_time, max_time, sqrt(var_time / received));
pingresp.total_count = count; //Number of pings
pingresp.resp_time = mean_time; //Average time for the pings
pingresp.seqno = 0; //not relevant
Expand Down

0 comments on commit f62dc56

Please sign in to comment.