Javascript stop working after ethernet interruption

38 views
Skip to first unread message

Christian SP

unread,
Aug 26, 2014, 11:38:41 AM8/26/14
to
Hi all,

I am not sure if this is a question for the Software or Hardware forum.  

We have seen that after a break of the ethernet connection javascrip functions stop working in iViewer, including: 

onNetworkStatusChange function (networkstatus) {
     if (networkStatus.hasNetwork) {
         CF.setJoin ("s12" networkStatus.ipv4address); 
         //At this point it still works.
     Else {} 
         CF.setJoin ("s12", "No network");
         //We can not change the string as javascrip stops working. 
     } 

While other direct commands still work after the interruption.

Is there anything that we could check?

Regards.

Christian SP.

Terence

unread,
Aug 26, 2014, 12:24:33 PM8/26/14
to comman...@googlegroups.com
Maybe it could be just some typo error, or else your function has some error - the function and if else loop is not formatted correctly and the first CF.setJoin for the s12 needs a comma. The fully corrected function should be

function onNetworkStatusChange(networkStatus) {
    if (networkStatus.hasNetwork) {
        CF.setJoin("s12", networkStatus.ipv4address); //At this point it still works.
    } else {
        CF.setJoin("s12", "No network"); //We can not change the string as javascript stops working.
    }
}

Christian SP

unread,
Aug 26, 2014, 12:55:02 PM8/26/14
to comman...@googlegroups.com
Thank you Terence, you are right, there are some typing errors by mistake when I did a copy and paste (sorry about it).  Unfortunately the javascript file is well done and the problem persists with all the functions.




--
You received this message because you are subscribed to a topic in the Google Groups "CommandFusion Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commandfusion/LCa54JarV68/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Stan

unread,
Aug 26, 2014, 1:59:49 PM8/26/14
to comman...@googlegroups.com
Hi Christian,

I am not a js expert by any means but I have essentially the same script in my projects and it works ok on disconnect.

I have the else statement written as } else {  instead of else {}.  See if this helps.



On Tuesday, August 26, 2014 11:38:41 AM UTC-4, Christian SP wrote:
Hi all,

I am not sure if this is a question for the Software or Hardware forum.  

We have seen that after a break of the ethernet connection javascrip functions stop working in iViewer, including: 

onNetworkStatusChange function (networkstatus) {
     if (networkStatus.hasNetwork) {
         CF.setJoin ("s12" networkStatus.ipv4address); 
         //At this point it still works.
     Else {} 
         CF.setJoin ("s12", "No network");
         //We can not change the string as javascrip stops working. 
     } 

While other direct commands still work after the interruption.

Christian SP

unread,
Aug 27, 2014, 12:28:58 PM8/27/14
to comman...@googlegroups.com
Thank you Stan for your answer, 

I did a couple of type mistakes when I wrote the question (I'm sorry about it).  What I really have done is:

CF.userMain = function() {
    
CF.watch(CF.NetworkStatusChangeEvent, onNetworkStatusChange, true);
}


function onNetworkStatusChange(networkStatus) {
    if (networkStatus.hasNetwork) {
        CF.setJoin("s12", networkStatus.ipv4address);
    } else {
        CF.setJoin("s12", "No network");
    }
}


Thank you Stan and Terence because you made me see that we are in the right way, so after several tries with the ASUS TF101, I tried the same issue with my Moto G and it works fine, so it seems like it is a problem with this tablet (not sure if with ASUS TF101 in general or just with our tablet).

At least, it is something to report if somebody else has this tablet with the same problem.

Regards.

Christian SP.




--
Reply all
Reply to author
Forward
0 new messages