2 Replies Latest reply on Apr 12, 2012 11:34 PM by Darryn Campbell

    ES 400 Wan status api bug report

    Dan McCabe

      Rho 1.0.3.7

      ES400

      Using the WAN status sample from the Network section of the help file (included below)

       

      If you add an alert statement (any alert statement) to fnWANStatus, then the alert does not fire and rho locks up with the spinner forever.

      Alert seems to work in other retrieval events OK.

       

      Dan

       

       

       

      <!--

      The following example shows how to establish and monitor a WAN connection

      -->

       

      <HTML><HEAD>

      <META HTTP-Equiv="Network" Content="WANStatusEvent:url('javascript:fnWANStatus(%json);')">

      <meta http-equiv="Network" content="NetworkEvent:url('Javascript:onNetworkEvent(%json);')">

      <meta http-equiv="Network" content="networkPollInterval:5000;connectionTimeout:1500">

      <meta http-equiv="Network" content="Host:url('http://www.motorola.com')">

        <script type="text/javascript">

        var count = 0;

        function onNetworkEvent(jsonObject)

        {

          count = count + 1;

          var html = "<b>Network Event Returned:</b> ";

          html += jsonObject.connectionInformation + " - " + count;

          networkOutput.innerHTML=html;

        }

        function fnWANStatus(jsonObject)

        {

          var html = "Signal Strength: " + jsonObject.phoneSignalStrength + "%";

          html += "<BR> Operator: " + jsonObject.networkOperator;

          html += "<BR> Cell Connection Available: " + jsonObject.connectionTypeAvailable;

          html += "<BR> Cell Connection Connected?: " + jsonObject.connectionTypeConnected;

          html += "<BR> Connection Manager Message: " + jsonObject.connectionManagerMessage;

          outputDiv.innerHTML = html;

        }

        function fnConnect(destination)

        {

          network.connectWan = "" + destination;

        }

        function fnDisconnect()

        {

          network.disconnectWan();

        }

        function fnStartNetworkCheck()

        {

          network.start();

        }

        function fnStopNetworkCheck()

        {

          network.stop();

          networkOutput.innerHTML = "Not Polling Network";

        }

        </script>

      </HEAD>

      <H1>WAN Tests</H1>

      <P><div id="networkOutput">Network Connection Information goes Here</div><br>

      <b><div id="outputDiv">Network Check Started</div></b><P>

      <input type="button" onclick="fnConnect('Internet')" Value="Connect (Default)" />

      <input type="button" onclick="fnConnect('My Connection')" Value="Connect ('My Connection')" />

      <input type="button" onclick="fnDisconnect()" Value="Disconnect" />

      <input type="button" onclick="fnStartNetworkCheck()" Value="Start Network Checking" />

      <input type="button" onclick="fnStopNetworkCheck()" Value="Stop Network Checking" />

      </BODY></HTML>