Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Diff: base/net/web-net-script.js
- Revision:
- 133:98c6bf14bc37
- Parent:
- 132:5b2df69a4f17
- Child:
- 143:cc2e148cb96a
--- a/base/net/web-net-script.js Wed Mar 11 08:28:53 2020 +0000
+++ b/base/net/web-net-script.js Wed Mar 11 16:00:21 2020 +0000
@@ -8,29 +8,41 @@
{
if (line.length == 0) return;
let fields = line.split('\t');
- let minutes = parseInt(fields[0], 16) / 1000 / 60;
- let ipType = parseInt(fields[1], 16);
- let arIndex = parseInt(fields[2], 16);
- let locPort = parseInt(fields[3], 16);
+ let state = parseInt(fields[0], 16);
+ let idleMs = parseInt(fields[1], 16);
+ let ipType = parseInt(fields[2], 16);
+ let arIndex = parseInt(fields[3], 16);
+ let locPort = parseInt(fields[4], 16);
+ let remPort = parseInt(fields[5], 16);
+ let bytesRcvd = parseInt(fields[6], 16);
+ let bytesSent = parseInt(fields[7], 16);
+ switch (state)
+ {
+ case 1: tcp += " Syn"; break;
+ case 2: tcp += " Est"; break;
+ case 3: tcp += " Wait"; break;
+ default: tcp += state.toString().padStart(5, ' '); break;
+ }
- tcp += Math.floor(minutes).toString().padStart(4, ' ');
- tcp += ' ';
+ let idleMinutes = Math.floor(idleMs / 1000 / 60);
+ tcp += idleMinutes.toString().padStart(4, ' ');
+ tcp += " ";
- if (ipType == 0x0800) tcp += "IPv4";
+ if (ipType == 0x0800) tcp += "IPv4";
else if (ipType == 0x86DD) tcp += "IPv6";
else tcp += fields[1];
- tcp += ' ';
- tcp += arIndex.toString();
- tcp += ' ';
-
- tcp += locPort.toString();
+ tcp += arIndex.toString().padStart(4, ' ');
+ tcp += locPort.toString().padStart(9, ' ');
+ tcp += remPort.toString().padStart(9, ' ');
+ tcp += bytesRcvd.toString().padStart(6, ' ');
+ tcp += bytesSent.toString().padStart(6, ' ');
tcp += '\r\n';
}
function parseTcpLines(text)
{
- tcp = '';
+ tcp = "State Idle Protocol ARI Port-Loc Port-Rem Rcvd Sent\n";
text.split('\n').forEach(parseTcpLine);
}
function parseGenLines(text)