Subversion Repositories HomeAutomation

Rev

Rev 1034 | Rev 1060 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1034 Rev 1040
Line 80... Line 80...
80
{
80
{
81
_print(ClientId, "====");
81
_print(ClientId, "====");
82
_print(ClientId, "\r");
82
_print(ClientId, "\r");
83
_print(ClientId, "=AR=");
83
_print(ClientId, "=AR=");
84
 
84
 
-
 
85
}
-
 
86
 
-
 
87
function ethStart()
-
 
88
{
-
 
89
    var canMessage = new CanNMTMessage("nmt", "Time");
-
 
90
    canMessage.send();
85
}
91
}
86
 
92
 
87
function resetNode(hardwareId)
93
function resetNode(hardwareId)
88
{
94
{
89
    ProgrammingClientId = ClientId;
95
    ProgrammingClientId = ClientId;
Line 91... Line 97...
91
    if (hardwareId.length > 2)
97
    if (hardwareId.length > 2)
92
    {
98
    {
93
        if (hardwareId.substr(0,2)=="0x")
99
        if (hardwareId.substr(0,2)=="0x")
94
        {
100
        {
95
            hardwareId = hex2uint(hardwareId.substring(2,hardwareId.length));
101
            hardwareId = hex2uint(hardwareId.substring(2,hardwareId.length));
96
        }
102
        }
97
    }
103
    }
98
   
104
   
99
    var node = CanNodes[hardwareId];
105
    var node = CanNodes[hardwareId];
100
 
106
 
101
    if (!node)
107
    if (!node)
102
    {
108
    {
103
        print("Failed. No node is online that has that hardware id, " + hardwareId + "\n");
109
        printTo(ProgrammingClientId, "Failed. No node is online that has that hardware id, " + hardwareId + "\n");
104
        return;
110
        return;
105
    }
111
    }
-
 
112
   
106
    node.reset();
113
    node.reset( function(status)
-
 
114
            {
-
 
115
                if (status)
-
 
116
                {
-
 
117
                    printTo(ProgrammingClientId, "Success: Node reset and bios started okay.\n");
-
 
118
                }
-
 
119
                else
-
 
120
                {
-
 
121
                    printTo(ProgrammingClientId, "Failed. Node did not respond failed.\n");
-
 
122
                }
-
 
123
            });
107
}
124
}
108
 
125
 
109
var ProgrammingClientId = null;
126
var ProgrammingClientId = null;
110
 
127
 
111
function programNodeCallback(status, event, text, raw)
128
function programNodeCallback(status, event, text, raw)