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-net4-script.js
- Revision:
- 136:be1d42268b5d
- Parent:
- 110:8ab752842d25
- Child:
- 144:7106252b7abf
--- a/base/net/web-net4-script.js Thu Apr 02 11:55:28 2020 +0000
+++ b/base/net/web-net4-script.js Thu Apr 02 19:10:57 2020 +0000
@@ -20,25 +20,36 @@
function parseArpLine(line)
{
if (line.length == 0) return;
- let minutes = parseInt(line.substr(0, 8), 16) / 1000 / 60;
+ let fields = line.split('\t');
+
+ arp += parseInt(fields[0], 16).toString().padStart(2, ' ');
+
+ let minutes = parseInt(fields[1], 16) / 1000 / 60;
arp += Math.floor(minutes).toString().padStart(4, ' ');
+
arp += ' ';
- arp += Net.makeIp4(line.substr(8, 8)).padEnd(15, ' ');
+ arp += Net.makeIp4(fields[2]).padEnd(15, ' ');
+
arp += ' ';
- arp += Net.makeMac(line.substr(16, 12));
+ arp += Net.makeMac(fields[3]);
+
arp += '\r\n';
}
function parseDnsLine(line)
{
if (line.length == 0) return;
- let minutes = parseInt(line.substr(0, 8), 16) / 1000 / 60;
+ let fields = line.split('\t');
+
+ dns += parseInt(fields[0], 16).toString().padStart(2, ' ');
+
+ let minutes = parseInt(fields[1], 16) / 1000 / 60;
dns += Math.floor(minutes).toString().padStart(4, ' ');
dns += ' ';
- dns += Net.makeIp4(line.substr(8, 8)).padEnd(15, ' ');
+ dns += Net.makeIp4(fields[2]).padEnd(15, ' ');
dns += ' ';
- dns += line.substr(16, 1);
+ dns += fields[3];
dns += ' ';
- dns += line.substr(17);
+ dns += fields[4];
dns += '\r\n';
}
function parseArpLines(text)