1
1

Initial dump from Zyxel

This commit is contained in:
2026-04-17 17:00:52 +02:00
commit 81fec250f4
23116 changed files with 5231237 additions and 0 deletions
@@ -0,0 +1,292 @@
// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
var version;
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
// installed player is some revision of 6.0
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
// so we have to be careful.
// default to the first public version
version = "WIN 6,0,21,0";
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
axo.AllowScriptAccess = "always";
// safe to call for 6.0r47 or greater
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 4.X or 5.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 3.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 2.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
} else if (versionRevision[0] == "b") {
versionRevision = versionRevision.substring(1);
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = GetSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
// Given "WIN 2,0,0,11"
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
tempString = tempArray[1]; // "2,0,0,11"
versionArray = tempString.split(","); // ['2', '0', '0', '11']
} else {
versionArray = versionStr.split(".");
}
var versionMajor = versionArray[0];
var versionMinor = versionArray[1];
var versionRevision = versionArray[2];
// is the major.revision >= requested major.revision AND the minor version >= requested minor
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
}
function AC_AddExtension(src, ext)
{
var qIndex = src.indexOf('?');
if ( qIndex != -1)
{
// Add the extention (if needed) before the query params
var path = src.substring(0, qIndex);
if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
return src;
else
return src.replace(/\?/, ext+'?');
}
else
{
// Add the extension (if needed) to the end of the URL
if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
return src; // Already have extension
else
return src + ext;
}
}
function AC_Generateobj(objAttrs, params, embedAttrs)
{
var str = '';
if (isIE && isWin && !isOpera)
{
str += '<object ';
for (var i in objAttrs)
str += i + '="' + objAttrs[i] + '" ';
str += '>';
for (var i in params)
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
str += '</object>';
} else {
str += '<embed ';
for (var i in embedAttrs)
str += i + '="' + embedAttrs[i] + '" ';
str += '> </embed>';
}
document.write(str);
}
function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblClick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
ret.objAttrs[args[i]] = args[i+1];
break;
case "id":
case "width":
case "height":
case "align":
case "vspace":
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
}
@@ -0,0 +1,126 @@
<!--
Copyright (C) 2019, Broadcom. All Rights Reserved.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
$ID$-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Broadcom Home Gateway Reference Design: AirIQ</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="style.css" media="screen">
<script language="JavaScript" type="text/javascript" src="overlib.js"></script>
</head>
<body>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<input type=hidden name="wl_mode_changed" value=0>
<input type=hidden name="wl_ure_changed" value=0>
<div name="DSLCPE_hidding" style="display:none">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#cc0000">
<% asp_list(); %>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="2" class="edge"><img border="0" src="blur_new.jpg" alt=""></td>
</tr>
<tr>
<td><img border="0" src="logo_new.gif" alt=""></td>
<td width="100%" valign="top">
<br>
<span class="title">AirIQ</span><br>
<span class="subtitle">This page allows you to launch AirIQ displays.</span>
</td>
</tr>
</table>
</div>
<div name="DSLCPE_TITLE">
<span class="title">AirIQ</span><br>
<span class="subtitle">This page allows you to launch AirIQ displays.</span>
</div>
<form method="post" action="airiq.asp">
<input type="hidden" name="page" value="airiq.asp">
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="310"
onMouseOver="return overlib('AirIQ Displays.', LEFT);"
onMouseOut="return nd();">
AirIQ Displays&nbsp;&nbsp;
</th>
<td>&nbsp;&nbsp;</td>
<td></td>
</tr>
<tr>
<th width="310"
onMouseOver="return overlib('Channel Quality Display.', LEFT);"
onMouseOut="return nd();">
Channel Quality:&nbsp;&nbsp;
</th>
<td>&nbsp;&nbsp;</td>
<td>
<input type="button" value="Launch" onclick="window.open('localapp.asp', '_blank', 'dependent=yes,resizable=yes,toolbar=no,status=no,menubar=no,height=800,width=1000,scrollbars=yes'); return false">
</td>
<td></td>
</tr>
<tr>
<th width="310"
onMouseOver="return overlib('Spectrogram Display.', LEFT);"
onMouseOut="return nd();">
Spectrogram:&nbsp;&nbsp;
</th>
<td>&nbsp;&nbsp;</td>
<td>
<input type="button" value="Launch" onclick="window.open('spectrogram.asp', '_blank', 'dependent=yes,resizable=yes,toolbar=no,status=no,menubar=no,height=800,width=1000,scrollbars=yes'); return false">
</td>
<td></td>
</tr>
<tr>
<th width="310"
onMouseOver="return overlib('Persistence Display.', LEFT);"
onMouseOut="return nd();">
Persistence:&nbsp;&nbsp;
</th>
<td>&nbsp;&nbsp;</td>
<td>
<input type="button" value="Launch" onclick="window.open('persistence.asp', '_blank', 'dependent=yes,resizable=yes,toolbar=no,status=no,menubar=no,height=800,width=1000,scrollbars=yes'); return false">
</td>
<td></td>
</tr>
<tr>
<th width="310"
onMouseOver="return overlib('Equalizer Display.', LEFT);"
onMouseOut="return nd();">
Equalizer:&nbsp;&nbsp;
</th>
<td>&nbsp;&nbsp;</td>
<td>
<input type="button" value="Launch" onclick="window.open('equalizer.asp', '_blank', 'dependent=yes,resizable=yes,toolbar=no,status=no,menubar=no,height=800,width=1000,scrollbars=yes'); return false">
</td>
<td></td>
</tr>
</table>
</form>
<p class="label">&#169;2001-2016 Broadcom Limited. All rights reserved. 54g and XPress are trademarks of Broadcom Limited.</p>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

@@ -0,0 +1,123 @@
<!--
Copyright (C) 2019, Broadcom. All Rights Reserved.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
$ID$-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Broadcom Home Gateway Reference Design: AirIQ Equalizer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="style.css" media="screen">
<script language="JavaScript" type="text/javascript" src="overlib.js"></script>
<script src="AC_OETags.js" language="javascript"></script>
<!-- BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 10;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// -->
</script>
</head>
<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "equalizer",
"quality", "high",
"bgcolor", "#869ca7",
"name", "equalizer",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "equalizer",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "equalizer",
"quality", "high",
"bgcolor", "#869ca7",
"name", "equalizer",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="equalizer" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="equalizer.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="equalizer.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="equalizer" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</body>
</html>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@@ -0,0 +1,123 @@
<!--
Copyright (C) 2019, Broadcom. All Rights Reserved.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
$ID$-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Broadcom Home Gateway Reference Design:AirIQ Channel Quality</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="style.css" media="screen">
<script language="JavaScript" type="text/javascript" src="overlib.js"></script>
<script src="AC_OETags.js" language="javascript"></script>
<!-- BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 10;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// -->
</script>
</head>
<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "LocalApChart",
"quality", "high",
"bgcolor", "#869ca7",
"name", "LocalApChart",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "LocalApChart",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "LocalApChart",
"quality", "high",
"bgcolor", "#869ca7",
"name", "LocalApChart",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="LocalApChart" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="LocalApChart.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="LocalApChart.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="LocalApChart" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</body>
</html>
@@ -0,0 +1,123 @@
<!--
Copyright (C) 2019, Broadcom. All Rights Reserved.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
$ID$-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Broadcom Home Gateway Reference Design: AirIQ Persistence</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="style.css" media="screen">
<script language="JavaScript" type="text/javascript" src="overlib.js"></script>
<script src="AC_OETags.js" language="javascript"></script>
<!-- BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 10;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// -->
</script>
</head>
<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "persistence",
"quality", "high",
"bgcolor", "#869ca7",
"name", "persistence",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "persistence",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "persistence",
"quality", "high",
"bgcolor", "#869ca7",
"name", "persistence",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="persistence" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="persistence.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="persistence.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="persistence" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</body>
</html>
@@ -0,0 +1,123 @@
<!--
Copyright (C) 2019, Broadcom. All Rights Reserved.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
$ID$-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Broadcom Home Gateway Reference Design: AirIQ Spectromgram</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="style.css" media="screen">
<script language="JavaScript" type="text/javascript" src="overlib.js"></script>
<script src="AC_OETags.js" language="javascript"></script>
<!-- BEGIN Browser History required section -->
<script src="history/history.js" language="javascript"></script>
<!-- END Browser History required section -->
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 10;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// -->
</script>
</head>
<body scroll="no">
<script language="JavaScript" type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
// DO NOT MODIFY THE FOLLOWING FOUR LINES
// Location visited after installation is complete if installation is required
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "spectrogram",
"quality", "high",
"bgcolor", "#869ca7",
"name", "spectrogram",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"src", "SpectrogramApp",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "spectrogram",
"quality", "high",
"bgcolor", "#869ca7",
"name", "spectrogram",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
// -->
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="spectrogram" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="spectrogram.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="spectrogram.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="spectrogram" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
</body>
</html>
@@ -0,0 +1,105 @@
<!DOCTYPE html>
<!--
HTML part for WiFi Blanket Demo Tab
Copyright (C) 2019, Broadcom. All Rights Reserved.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
<<Broadcom-WL-IPTag/Open:>>
$Id: wbd_demo.asp 761224 2018-05-07 07:14:30Z $
-->
<html>
<head>
<meta charset="ISO-8859-1">
<!-- #ifdef DSLCPE -->
<script language="JavaScript" type="text/javascript" src="overlib.js"></script>
<script language="javascript">
var sessionKey = '<%ejGetOther(sessionKey)%>';
function wl_recalc() {
show_hide_header("<% nvram_get("hide_hnd_header");%>");
}
</script>
<!-- #endif DSLCPE -->
<link rel="stylesheet" href="wbd_demo.css"/>
<script src="jquery-2.0.3.min.js"></script>
<script src="wbd_demo.js"></script>
<title>Broadcom SmartMesh</title>
</head>
<body onload="wl_recalc();">
<div id="main_div">
<div id="page_header">
<table class="logotable">
<tr>
<td colspan="2" class="edge"><img border="0" src="blur_new.jpg" alt=""/></td>
</tr>
<tr>
<td><img border="0" src="logo_new.gif" alt=""/></td>
<td width="100%" valign="top">
<br/>
<span id="TextHeading"> <h1>Broadcom SmartMesh</h1> </span><br/>
</td>
</tr>
</table>
</div>
<!-- #ifdef DSLCPE -->
<div id="page_title" style="display:none">
<br/>
<span style="font-family: arial, sans-serif; font-size: 10pt; font-weight: bold">Wifi Blanket</span><br/>
<span style="font-family: arial, sans-serif; font-size: 9pt">In this page we will demonstrate
Wifi Blanket</span>
<br/> <br/>
</div>
<!-- #endif DSLCPE -->
<div id="contentarea" class="btmbrdr">
<div id="wbdcontent" class="maindiv">
<div id="5gdiv" class="outerdivcommon">
<h2 id="heading"> 5G Low </h2>
</div>
<div id="5gdivH" class="outerdivcommon">
<h2 id="heading"> 5G High </h2>
</div>
<div id="2gdiv" class="outerdivcommon">
<h2> 2.4G </h2>
</div>
<div id="logsdiv" class="outerdivcommon">
<h2> Logs </h2>
<div id="logsdivcontainer" class="commonbdr innerdivcommonforlogs">
<div id="stamsgs" class="stamsgstyle txtstyle">
</div>
</div>
<button id="clearlogs" type="button" class="logsbtn">Clear Logs</button>
</div>
<br style="clear:left"/>
</div>
</div>
</div>
<div id="templatesAdv" style="display:none">
<table id="tableTemplate" class="tablestylecommon">
<thead>
<tr>
<th style="width:9.5em">Client (MAC)</th>
<th style="width:9.5em">RSSI</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</body>
</html>
@@ -0,0 +1,125 @@
/*
* CSS implementation for wbd demo page
*
* $ Copyright Open Broadcom Corporation $
*
*
* <<Broadcom-WL-IPTag/Open:>>
*
* $Id: wbd_demo.css 670363 2016-11-15 13:59:21Z pankajj $
*/
*{
margin:0em;
padding:0em;
font-family:arial, sans-serif;
}
.edge {
background-image:url(repeat_edge_new.gif);
line-height:0px;
}
.logotable{
border:0px;
border-collapse:collapse;
border-spacing:0px;
padding:0;
margin:0;
width:100%;
}
.logotable td{
padding:0px;
}
#main_div{
width:99.9%;
margin-bottom:1em;
text-align:left;
}
.commonbdr {
border: 0.2em solid #006699;
}
.outerdivcommon {
margin-left:1em;
padding-top:1em;
float:left;
}
.maindiv {
width:98%;
}
.innerdivcommonforlogs {
height:35em;
padding-top:1em;
margin-top:1em;
min-width:35em;
overflow:auto;
}
.innerdivcommon {
min-height:10em;
padding-top:1em;
margin-top:1em;
}
.tablestylecommon {
table-layout:fixed;
color:black;
text-align:left;
margin-top:0.5em;
}
.tablestylecommon th {
color:white;
background-color:#006699;
}
.tablestylecommon tr:nth-child(odd) {
background-color:#f2f2f2;
}
.tablestylecommon tr:nth-child(even) {
background-color:#e2e2e2;
}
.tablestylecommon td:nth-child(3):not(:empty) {
color:red;
}
.txtstyle {
text-align:left;
white-space:pre;
}
.stamsgstyle {
margin-left:1em;
}
.logstyle {
margin-left:2em;
}
.weakstacolor {
color:red;
}
#steerlogs {
margin-top:1em;
}
.nodisplay {
display:none;
}
.logsbtn {
margin-top:1em;
float:right;
color:white;
background-color:#006699;
font-weight: bold;
padding:0.5em;
}
@@ -0,0 +1,719 @@
/*
* Java-Script implementation for wbd demo page
*
* $ Copyright Open Broadcom Corporation $
*
*
* <<Broadcom-WL-IPTag/Open:>>
*
* $Id: wbd_demo.js 761035 2018-05-04 14:59:23Z pj888946 $
*/
var g_isHTTPDWebserver = 1
var g_urlGetWbdMasterinfo;
var g_urlGetConfig;
var g_urlGetWbdMasterlogs;
var g_wbdarray;
var g_prevwbdarray;
var g_wbddiffjson;
var g_wbdMasterInfoTimeout = []; /* To Hold the settimeout timer */
var g_wbdTimeOutVal = 1000; /* Timeout value for calling wbd info */
var g_isLayoutRequired = true;
var g_weakclientlist = new weakclientlist();
var g_wbdDefRSSI2G = -65 /* Default rssi value */
var g_wbdDefRSSI5G = -65; /* Default rssi value */
var TWO_G = 2; /* 2g band define */
var FIVE_G = 5; /* 5g band define */
var g_wbdMasterLogsTimeout = []; /* To hold timeout for master logs. */
var TIMER_MASTERINFO = 1 << 0; /* Master info timer flag. */
var TIMER_MASTERLOGS = 1 << 1; /* Master logs timer flag. */
/* Return default RSSI based on band */
function getDefaultRSSI(band)
{
var rssi = (band == 2 ) ? g_wbdDefRSSI2G : g_wbdDefRSSI5G;
return rssi
}
/* Returns formated rssi value. */
function getFormatedRSSI(band, rssi, sta_status) {
var rssi_data = "> " + getDefaultRSSI(band) + "dBm (Strong)";
if (rssi != 0) {
rssi_data = rssi + "dBm";
if (sta_status.length > 0) {
rssi_data += " (" + sta_status + ")";
}
}
return rssi_data;
}
/* To initialize some variables on page load */
function initWbdPage()
{
if (g_isHTTPDWebserver == 1) {
g_urlGetWbdMasterinfo = window.location.protocol + '//' + window.location.host +'/wbd.cgi';
g_urlGetConfig = window.location.protocol + '//' + window.location.host +'/wbd.cgi';
g_urlGetWbdMasterlogs = window.location.protocol + '//' + window.location.host +'/wbd.cgi';
} else {
g_urlGetWbdMasterinfo = 'http://localhost/wbd.php';
}
}
/* Generates ids from bssid */
function getIdFromBssid(bssid)
{
var temp = bssid.replace(/:/g,'');
return temp;
}
/* Clear all the timers */
function clearAllWbdTimers(flag)
{
if (flag & TIMER_MASTERINFO) {
for (i = 0; i < g_wbdMasterInfoTimeout.length; i++) {
clearTimeout(g_wbdMasterInfoTimeout[i]);
}
g_wbdMasterInfoTimeout = [];
}
if (flag & TIMER_MASTERLOGS) {
for (i = 0; i < g_wbdMasterLogsTimeout.length; i++) {
clearTimeout(g_wbdMasterLogsTimeout[i]);
}
g_wbdMasterLogsTimeout = [];
}
}
/* Gets the config */
function getConfigInfo()
{
var array = [];
$.ajax({
type:'GET',
url:g_urlGetConfig,
data:{"Cmd" : "config"},
async:true,
success:function(result) {
if (g_isHTTPDWebserver == 1)
array = result;
else
array = JSON.parse(result);
if (array.RefreshInterval != undefined)
g_wbdTimeOutVal = array.RefreshInterval * 1000;
if (array.RSSI5G != undefined)
g_wbdDefRSSI5G = array.RSSI5G;
if (array.RSSI2G != undefined)
g_wbdDefRSSI2G = array. RSSI2G
}
});
array = [];
}
/* Common function to request from the server */
function getMasterInfoFromServer(request)
{
var array = [];
$.ajax({
type:'GET',
url:g_urlGetWbdMasterinfo,
data:request,
async:false,
success:function(result) {
if (g_isHTTPDWebserver == 1)
array = result;
else
array = JSON.parse(result);
g_wbdarray = array;
$(document).trigger("data-available", [g_wbdarray]);
}
});
array = [];
}
/* Function for requesting master info. */
function getMasterInfo()
{
var request = {"Cmd" : "info"};
clearAllWbdTimers(TIMER_MASTERINFO);
getMasterInfoFromServer(request);
g_wbdMasterInfoTimeout.push(setTimeout(function(){ getMasterInfo(); }, g_wbdTimeOutVal));
}
/* Function to request master logs from server. */
function getMasterLogsFromServer(request)
{
var array = [];
$.ajax({
type:'GET',
url:g_urlGetWbdMasterlogs,
data:request,
async:false,
success:function(result) {
if (g_isHTTPDWebserver == 1) {
array = result;
} else {
array = JSON.parse(result);
}
displayLogMessages(array.Data.MasterLogs);
}
});
array = [];
}
/* Function for requesting master logs. */
function getMasterLogs()
{
var request = {"Cmd" : "logs"};
clearAllWbdTimers(TIMER_MASTERLOGS);
getMasterLogsFromServer(request);
g_wbdMasterLogsTimeout.push(setTimeout(function(){ getMasterLogs(); }, g_wbdTimeOutVal));
}
/* Function to display logs messages. */
function displayLogMessages(message)
{
var msg = message.replace(/\\n/g, "<br/>");
var $elem = "<p>" + msg + "</p>";
$("#stamsgs").empty();
$("#stamsgs").append($elem);
}
/* Function to clear the master logs. */
function clearMasterLogs()
{
var request = {"cmd" : "clearlogs"};
$.ajax({
type:'GET',
url:g_urlGetWbdMasterlogs,
data:request,
async:true,
error:function(result) {
console.log("Failed to clear the logs");
}
});
}
/* Function for creating data rows. */
function createDataRows(band, bssid, aparr)
{
var id = getIdFromBssid(bssid);
for(var idx = 0; idx < aparr.MACList.length; idx++) {
var $row = $("<tr>");
var rssi = getFormatedRSSI(band, aparr.MACList[idx].RSSI, aparr.MACList[idx].Status);
$("<td>").text(aparr.MACList[idx].MAC).appendTo($row);
$("<td>").text(rssi).appendTo($row);
$("#" + id + " > tbody").append($row);
if(aparr.MACList[idx].Status === "Weak") {
console.log("weak-sta-entry point 2");
$row.addClass("weakstacolor");
var obj = {"MAC":{"data":aparr.MACList[idx].MAC}, "RSSI":{"data":aparr.MACList[idx].RSSI},"Status":{"data":aparr.MACList[idx].Status}};
$(document).trigger("weak-sta", [ {'BSSID':bssid, 'client':obj} ]);
}
}
}
/* Function for generating table elements. */
function tableelem(divId, heading, id)
{
var $elem = $("<div>", {id:divId, class:"innerdivcommon commonbdr"})
$("<h3>", {text:heading}).appendTo($elem);
$("#tableTemplate").clone().attr("id", id).appendTo($elem);
return $elem;
}
/* Function for creating inner layout */
function createPageInnerLayout(aparr)
{
var id = getIdFromBssid(aparr.BSSID);
var heading = aparr.SlaveType + ': ' + aparr.BSSID + ' ' + aparr.MapFlags + ' ' + aparr.Channel;
var divId = id +"div";
return tableelem(divId, heading, id);
}
/* Function for creating outer layout */
function createPageOuterLayout(g_wbdarray)
{
/* 2G blanket layout */
if (g_wbdarray.Data.TwoG !== undefined && g_wbdarray.Data.TwoG.length != 0) {
for(var idx = 0; idx < g_wbdarray.Data.TwoG.length; idx++) {
$("#2gdiv").append(createPageInnerLayout(g_wbdarray.Data.TwoG[idx]));
createDataRows(TWO_G, g_wbdarray.Data.TwoG[idx].BSSID, g_wbdarray.Data.TwoG[idx]);
}
} else {
$("#2gdiv").remove();
}
/* 5G Low blanket layout */
if (g_wbdarray.Data.FiveGLow !== undefined && g_wbdarray.Data.FiveGLow.length != 0) {
for(var idx = 0; idx < g_wbdarray.Data.FiveGLow.length; idx++) {
$("#5gdiv").append(createPageInnerLayout(g_wbdarray.Data.FiveGLow[idx]));
createDataRows(FIVE_G, g_wbdarray.Data.FiveGLow[idx].BSSID, g_wbdarray.Data.FiveGLow[idx]);
}
} else {
$("#5gdiv").remove();
}
/* 5G High blanket layout */
if (g_wbdarray.Data.FiveGHigh !== undefined && g_wbdarray.Data.FiveGHigh.length != 0) {
for(var idx = 0; idx < g_wbdarray.Data.FiveGHigh.length; idx++) {
$("#5gdivH").append(createPageInnerLayout(g_wbdarray.Data.FiveGHigh[idx]));
createDataRows(FIVE_G, g_wbdarray.Data.FiveGHigh[idx].BSSID, g_wbdarray.Data.FiveGHigh[idx]);
}
} else {
$("#5gdivH").remove();
}
}
function updateChannelInfo(g_wbdarray)
{
var id, txt, arr;
/* 2G blanket layout */
if (g_wbdarray.Data.TwoG !== undefined && g_wbdarray.Data.TwoG.length != 0) {
for(var idx = 0; idx < g_wbdarray.Data.TwoG.length; idx++) {
arr = g_wbdarray.Data.TwoG[idx];
id = getIdFromBssid(arr.BSSID);
id = id + 'div';
txt = arr.SlaveType + ': ' + arr.BSSID + ' ' + arr.MapFlags + ' ' + arr.Channel;
$("#2gdiv > div").map(function(){
if (this.id === id) {
var str = $.trim($(this).children("h3").text());
if (str != txt) {
$(this).children("h3").text(txt);
}
}
});
}
}
/* 5G Low blanket layout */
if (g_wbdarray.Data.FiveGLow !== undefined && g_wbdarray.Data.FiveGLow.length != 0) {
for(var idx = 0; idx < g_wbdarray.Data.FiveGLow.length; idx++) {
arr = g_wbdarray.Data.FiveGLow[idx];
id = getIdFromBssid(arr.BSSID);
id = id + 'div';
txt = arr.SlaveType + ': ' + arr.BSSID + ' ' + arr.MapFlags + ' ' + arr.Channel;
$("#5gdiv > div").map(function(){
if (this.id === id) {
var str = $.trim($(this).children("h3").text());
if (str != txt) {
$(this).children("h3").text(txt);
}
}
});
}
}
/* 5G High blanket layout */
if (g_wbdarray.Data.FiveGHigh !== undefined && g_wbdarray.Data.FiveGHigh.length != 0) {
for(var idx = 0; idx < g_wbdarray.Data.FiveGHigh.length; idx++) {
arr = g_wbdarray.Data.FiveGHigh[idx];
id = getIdFromBssid(arr.BSSID);
id = id + 'div';
txt = arr.SlaveType + ': ' + arr.BSSID + ' ' + arr.MapFlags + ' ' + arr.Channel;
$("#5gdivH > div").map(function(){
if (this.id === id) {
var str = $.trim($(this).children("h3").text());
if (str != txt) {
$(this).children("h3").text(txt);
}
}
});
}
}
}
/* Function for returnig the diff of json objects */
var jsonObjDiff = function() {
return {
VALUE_CREATED: 'created',
VALUE_UPDATED: 'updated',
VALUE_DELETED: 'deleted',
VALUE_UNCHANGED: 'unchanged',
map: function(obj1, obj2) {
if (this.isValue(obj1) || this.isValue(obj2)) {
return {type: this.compareValues(obj1, obj2), data: obj2 || obj1};
}
var diff = {};
for (var key in obj1) {
var value2 = undefined;
if ('undefined' != typeof(obj2[key])) {
value2 = obj2[key];
}
diff[key] = this.map(obj1[key], value2);
}
for (var key in obj2) {
if ('undefined' != typeof(diff[key])) {
continue;
}
diff[key] = this.map(undefined, obj2[key]);
}
return diff;
},
compareValues: function(value1, value2) {
if (value1 === value2) {
return this.VALUE_UNCHANGED;
}
if ('undefined' == typeof(value1)) {
return this.VALUE_CREATED;
}
if ('undefined' == typeof(value2)) {
return this.VALUE_DELETED;
}
return this.VALUE_UPDATED;
},
isArray: function(obj) {
return {}.toString.apply(obj) === '[object Array]';
},
isObject: function(obj) {
return {}.toString.apply(obj) === '[object Object]';
},
isValue: function(obj) {
return !this.isObject(obj) && !this.isArray(obj);
}
}
}();
/* Function for copying nested objects. */
function deepcopy(obj)
{
var copy = obj, item;
if (obj && typeof obj === 'object') {
copy = Object.prototype.toString.call(obj) === '[object Array]' ? [] : {};
for(item in obj) {
copy[item] = deepcopy(obj[item]);
}
}
return copy;
}
/* Function for creating data rows. */
function createStaDataRows(band, bssid, aparr)
{
var id = getIdFromBssid(bssid);
for(var idx = 0; idx < aparr.length; idx++) {
var $row = $("<tr>");
var rssi = getFormatedRSSI(band, aparr[idx].RSSI, aparr[idx].Status);
$("<td>").text(aparr[idx].MAC).appendTo($row);
$("<td>").text(rssi).appendTo($row);
$("#" + id + " > tbody").append($row);
if(aparr[idx].Status === "Weak") {
console.log("weak-sta-entry point 3");
$row.addClass("weakstacolor");
var obj = {"MAC":{"data":aparr[idx].MAC}, "RSSI":{"data":aparr[idx].RSSI},"Status":{"data":aparr[idx].Status}};
$(document).trigger("weak-sta", [ {'BSSID':bssid, 'client':obj} ]);
}
}
}
/* Identification of weak sta */
function parseInnerObjects(arr, len)
{
var id = getIdFromBssid(arr.BSSID.data);
var band = arr.Band.data;
for(var i = 0; i < 10; i++) {
if (arr.MACList[i] !== undefined) {
/* New sta added */
if (arr.MACList[i].type == "created") {
console.log("Mac is created");
console.log(JSON.stringify(arr));
var staarr = [];
staarr.push(arr.MACList[i].data);
createStaDataRows(band, arr.BSSID.data, staarr);
$(document).trigger("sta-steered", [ {'BSSID':arr.BSSID.data, 'client':arr.MACList[i].data} ]);
} else if (arr.MACList[i].type == "deleted") { /* Sta is deleted */
console.log("Mac is deleted");
$("#" + id + " tbody tr").each(function() {
if( $(this).find("td").eq(0).text() === arr.MACList[i].data.MAC) {
$(this).remove();
}
});
} else if( arr.MACList[i].MAC.type === 'updated') { /* MAC is updated */
console.log("Mac is updated");
var rssi = getFormatedRSSI(band, arr.MACList[i].RSSI.data, arr.MACList[i].status.data);
$("#" + id + " tbody tr").eq(i).find("td").eq(0).html(arr.MACList[i].MAC.data);
$("#" + id + " tbody tr").eq(i).find("td").eq(1).html(rssi);
} else {
/* only rssi or status is updated. */
if ( (arr.MACList[i].MAC.type !== 'updated') ||
(arr.MACList[i].RSSI.type === 'updated') ||
(arr.MACList[i].Status.type === 'updated') ) {
$("#" + id + " tbody tr").each(function() {
if( $(this).find("td").eq(0).text() === arr.MACList[i].MAC.data) {
var rssi = getFormatedRSSI(band, arr.MACList[i].RSSI.data, arr.MACList[i].Status.data);
$(this).find("td").eq(1).html(rssi);
if(arr.MACList[i].Status.data === "Weak") {
$(this).css("color", "red");
if (arr.MACList[i].Status.type === "updated") {
console.log("weak-sta-entry point");
$(document).trigger("weak-sta", [ {'BSSID':arr.BSSID.data, 'client':arr.MACList[i]} ]);
}
} else {
$(this).css("color", "black");
}
}
});
}
}
}
}
}
/* Weak sta list */
function weakclientlist()
{
this.list = [];
this.addobj = function (obj) {
this.list.push(obj);
$(document).trigger("weak-sta-msg", [ obj ]);
}
this.removeobj = function (obj) {
for (var i = this.list.length - 1; i >= 0; i--) {
if (this.list[i].MAC === obj.MAC) {
this.list.splice(i, 1);
break;
}
}
}
this.updatelist = function (obj) {
var ispresent = false;
for (var i = this.list.length - 1; i >= 0; i--) {
if (obj.Status === "Weak") {
if (this.list[i].MAC === obj.MAC) {
ispresent = true;
break;
}
} else {
if (this.list[i].MAC == obj.MAC) {
$(document).trigger("weak-sta-steer-msg", [ {"from":this.list[i], "to":obj} ]);
this.list.splice(i, 1);
}
}
}
if ((ispresent === false) && (obj.Status === "Weak")) {
this.addobj(obj);
}
}
}
/* Weak sta details */
function weakclient(bssid, mac, rssi, status, spanid, timerobj)
{
this.BSSID = bssid;
this.MAC = mac;
this.RSSI = rssi;
this.Status = status;
this.spanid = spanid;
this.timer = timerobj;
}
/* Weak sta steer handler */
$(document).on("sta-steered", function(event, eventdata) {
console.log("sta steered detected");
console.log(JSON.stringify(eventdata));
var num = Math.floor((Math.random()*10000) + 1);
var spanid = getIdFromBssid(eventdata.BSSID) + num + 'span';
var weaksta = new weakclient(eventdata.BSSID, eventdata.client.MAC, eventdata.client.RSSI, eventdata.client.Status, spanid, new timerobj().instance());
g_weakclientlist.updatelist(weaksta);
});
/* Weak sta handler */
$(document).on("weak-sta", function(event, eventdata) {
console.log("weak sta detected");
console.log(JSON.stringify(eventdata));
var num = Math.floor((Math.random()*10000) + 1);
var spanid = getIdFromBssid(eventdata.BSSID) + num + 'span';
var weaksta = new weakclient(eventdata.BSSID, eventdata.client.MAC.data, eventdata.client.RSSI.data, eventdata.client.Status.data, spanid, new timerobj().instance());
g_weakclientlist.updatelist(weaksta);
});
/* Count down timer handling. */
var timerobj = function() {
this.interval;
}
timerobj.prototype.instance = function() {
return this;
};
timerobj.prototype.start = function(element, seconds) {
var timer = seconds;
this.interval = setInterval(function() {
element.text(timer);
if(--timer < 0)
timer = seconds; }, 1000);
return this;
};
timerobj.prototype.stop = function() {
clearInterval(this.interval);
return this;
};
/* Parse the json diff and update the ui */
function parseJsonDiffAndUpdate(arr, len, tag)
{
for(var i = 0; i < len; i++) {
if(arr[i].type === 'created') {
$(document).trigger("created", [{"tag":tag, "obj":arr[i]}]);
} else if(arr[i].type === 'deleted') {
$(document).trigger("deleted", [{"tag":tag, "obj":arr[i]}]);
} else {
parseInnerObjects(arr[i], len);
}
}
}
function arrangeArr(arr1, arr2)
{
/* 2G data */
if (arr1.Data.TwoG !== undefined && arr1.Data.TwoG.length != 0 &&
arr2.Data.TwoG !== undefined && arr2.Data.TwoG.length != 0) {
for(var idx = 0; idx < arr1.Data.TwoG.length; idx++) {
for(var jdx = 0; jdx < arr2.Data.TwoG.length; jdx++) {
if (arr1.Data.TwoG[idx].BSSID == arr2.Data.TwoG[jdx].BSSID) {
var tmp = arr2.Data.TwoG[idx];
arr2.Data.TwoG[idx] = arr2.Data.TwoG[jdx];
arr2.Data.TwoG[jdx] = tmp;
}
}
}
}
/* 5GL data */
if (arr1.Data.FiveGLow !== undefined && arr1.Data.FiveGLow.length != 0 &&
arr2.Data.FiveGLow !== undefined && arr2.Data.FiveGLow.length != 0) {
for(var idx = 0; idx < arr1.Data.FiveGLow.length; idx++) {
for(var jdx = 0; jdx < arr2.Data.FiveGLow.length; jdx++) {
if (arr1.Data.FiveGLow[idx].BSSID == arr2.Data.FiveGLow[jdx].BSSID) {
var tmp = arr2.Data.FiveGLow[idx];
arr2.Data.FiveGLow[idx] = arr2.Data.FiveGLow[jdx];
arr2.Data.FiveGLow[jdx] = tmp;
}
}
}
}
/* 5GH data */
if (arr1.Data.FiveGHigh !== undefined && arr1.Data.FiveGHigh.length != 0 &&
arr2.Data.FiveGHigh !== undefined && arr2.Data.FiveGHigh.length != 0) {
for(var idx = 0; idx < arr1.Data.FiveGHigh.length; idx++) {
for(var jdx = 0; jdx < arr2.Data.FiveGHigh.length; jdx++) {
if (arr1.Data.FiveGHigh[idx].BSSID == arr2.Data.FiveGHigh[jdx].BSSID) {
var tmp = arr2.Data.FiveGHigh[idx];
arr2.Data.FiveGHigh[idx] = arr2.Data.FiveGHigh[jdx];
arr2.Data.FiveGHigh[jdx] = tmp;
}
}
}
}
}
/* Event handler for creating the page layout */
$(document).on("data-available", function(event, eventdata) {
if (g_isLayoutRequired == true) {
createPageOuterLayout(g_wbdarray);
g_isLayoutRequired = false;
g_prevwbdarray = deepcopy(g_wbdarray);
} else {
var fiveGLlen = g_prevwbdarray.Data["FiveGLow"].length > g_wbdarray.Data["FiveGLow"].length ?
g_prevwbdarray.Data["FiveGLow"].length : g_wbdarray.Data["FiveGLow"].length;
var fiveGHlen = g_prevwbdarray.Data["FiveGHigh"].length > g_wbdarray.Data["FiveGHigh"].length ?
g_prevwbdarray.Data["FiveGHigh"].length : g_wbdarray.Data["FiveGHigh"].length;
var twoGlen = g_prevwbdarray.Data["TwoG"].length > g_wbdarray.Data["TwoG"].length ?
g_prevwbdarray.Data["TwoG"].length : g_wbdarray.Data["TwoG"].length;
updateChannelInfo(g_wbdarray);
g_wbddiffjson = '';
arrangeArr(g_prevwbdarray, g_wbdarray);
g_wbddiffjson = jsonObjDiff.map(g_prevwbdarray, g_wbdarray);
console.log(JSON.stringify(g_wbddiffjson));
parseJsonDiffAndUpdate(g_wbddiffjson.Data["FiveGLow"], fiveGLlen, "5GL");
parseJsonDiffAndUpdate(g_wbddiffjson.Data["FiveGHigh"], fiveGHlen, "5GH");
parseJsonDiffAndUpdate(g_wbddiffjson.Data["TwoG"], twoGlen, "2G");
g_prevwbdarray = deepcopy(g_wbdarray);
}
});
/* Event handler for creating the node in the layout */
$(document).on("created", function(event, eventdata) {
console.log("created node");
console.log(JSON.stringify(eventdata));
var id = getIdFromBssid(eventdata.obj.data.BSSID);
var heading = eventdata.obj.data.SlaveType + ': ' + eventdata.obj.data.BSSID + ' ' +
eventdata.obj.data.MapFlags + ' ' + eventdata.obj.data.Channel;
var divid = id+"div";
if (eventdata.tag === "5GL") {
$("#5gdiv").append(tableelem(divid, heading, id));
createDataRows(FIVE_G, eventdata.obj.data.BSSID, eventdata.obj.data);
} else if(eventdata.tag === "5GH") {
$("#5gdivH").append(tableelem(divid, heading, id));
createDataRows(FIVE_G, eventdata.obj.data.BSSID, eventdata.obj.data);
} else if(eventdata.tag === "2G") {
$("#2gdiv").append(tableelem(divid, heading, id));
createDataRows(TWO_G, eventdata.obj.data.BSSID, eventdata.obj.data);
}
});
/* Event handler for deleting the node in the layout */
$(document).on("deleted", function(event, eventdata) {
var id = getIdFromBssid(eventdata.obj.data.BSSID);
$("#" + id + 'div').remove();
});
/* Function which will get called when DOM for the page gets loaded. */
$(document).ready(function() {
clearAllWbdTimers(TIMER_MASTERINFO | TIMER_MASTERLOGS);
initWbdPage();
getConfigInfo();
getMasterInfo();
getMasterLogs();
/* button click event handler */
$("#clearlogs").click(function(){
$("#stamsgs").empty();
clearMasterLogs();
});
});