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-net6-script.js
- Revision:
- 136:be1d42268b5d
- Parent:
- 110:8ab752842d25
- Child:
- 142:b472ba95b018
--- a/base/net/web-net6-script.js Thu Apr 02 11:55:28 2020 +0000
+++ b/base/net/web-net6-script.js Thu Apr 02 19:10:57 2020 +0000
@@ -23,25 +23,34 @@
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.makeIp6(line.substr(8, 32)).padEnd(40, ' ');
+
+ arp += Net.makeIp6(fields[2]).padEnd(40, ' ');
arp += ' ';
- arp += Net.makeMac(line.substr(40, 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.makeIp6(line.substr(8, 32)).padEnd(40, ' ');
+ dns += Net.makeIp6(fields[2]).padEnd(40, ' ');
dns += ' ';
- dns += line.substr(40, 1);
+ dns += fields[3];
dns += ' ';
- dns += line.substr(41);
+ dns += fields[4];
dns += '\r\n';
}
function parseArpLines(text)