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: net/web-net-class.js
- Revision:
- 110:8ab752842d25
- Parent:
- 109:3e82f62c7e1f
- Child:
- 111:aaa858678e34
--- a/net/web-net-class.js Mon Apr 29 14:45:30 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-//Net class
-'use strict';
-
-class Net
-{
- static makeIp4(text)
- {
- let result = '';
- result += parseInt(text.substr(6, 2), 16).toString();
- result += '.';
- result += parseInt(text.substr(4, 2), 16).toString();
- result += '.';
- result += parseInt(text.substr(2, 2), 16).toString();
- result += '.';
- result += parseInt(text.substr(0, 2), 16).toString();
- return result;
- }
- static makeMac(text)
- {
- text = text.toLowerCase();
- let result = '';
- result += text.substr( 0, 2);
- result += ':';
- result += text.substr( 2, 2);
- result += ':';
- result += text.substr( 4, 2);
- result += ':';
- result += text.substr( 6, 2);
- result += ':';
- result += text.substr( 8, 2);
- result += ':';
- result += text.substr(10, 2);
- return result;
- }
-
- static hexToBit(text, iBit)
- {
- let value = parseInt(text, 16);
- value >>= iBit;
- return value & 1;
- }
- static makeIp6(text)
- {
- function makeWord(text)
- {
- let word = parseInt(text, 16);
- if (word === 0) return '';
- return word.toString(16);
- }
- text = text.toLowerCase();
- let result = '';
- result += makeWord(text.substr( 0, 4));
- result += ':';
- result += makeWord(text.substr( 4, 4));
- result += ':';
- result += makeWord(text.substr( 8, 4));
- result += ':';
- result += makeWord(text.substr(12, 4));
- result += ':';
- result += makeWord(text.substr(16, 4));
- result += ':';
- result += makeWord(text.substr(20, 4));
- result += ':';
- result += makeWord(text.substr(24, 4));
- result += ':';
- result += makeWord(text.substr(28, 4));
- return result;
- }
-}
\ No newline at end of file