Subversion Repositories HomeAutomation

Rev

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

Rev 2156 Rev 2187
Line 103... Line 103...
103
my @device = ();
103
my @device = ();
104
 
104
 
105
#print "/usr/bin/atomic -s $host -p $port -c \"Node_WaitForInformation\"\n";
105
#print "/usr/bin/atomic -s $host -p $port -c \"Node_WaitForInformation\"\n";
106
#my @lines = qx{/usr/bin/atomic -s $host -p $port -c \"Node_GetInformation 0xB23F54EA\"};
106
#my @lines = qx{/usr/bin/atomic -s $host -p $port -c \"Node_GetInformation 0xB23F54EA\"};
107
#my @lines = qx{/usr/bin/atomic -s $host -p $port -c \"Node_WaitForInformation\"};
107
#my @lines = qx{/usr/bin/atomic -s $host -p $port -c \"Node_WaitForInformation\"};
-
 
108
my @lines;
108
 
109
 
109
$socket = atomd_initialize($host, $port);
110
$socket = atomd_initialize($host, $port);
-
 
111
if ($port == 1203)
-
 
112
{
-
 
113
    atomjs_write($socket, "Node_WaitForInformationNative();\n");
-
 
114
 
-
 
115
    $success = 0;
-
 
116
    for ($count = 0; $count < 50; $count++)
-
 
117
    {
-
 
118
        atomjs_write($socket, "Node_WaitNodePollNative();\n");
-
 
119
        $return = atomjs_read_line($socket);
-
 
120
        if ($return =~ m/false/)
-
 
121
        {
-
 
122
        }
-
 
123
        elsif ($return =~ m/Error/)
-
 
124
        {
-
 
125
            die $return;
-
 
126
        }
-
 
127
        else
-
 
128
        {
-
 
129
            @lines = split(/\t/, $return);
-
 
130
        }
-
 
131
        usleep(200000);
-
 
132
    }
-
 
133
    if ($success == 0)
-
 
134
    {
-
 
135
        die "\033[31mTimed out waiting for node to start.\033[0m\n";
-
 
136
    }
-
 
137
 
-
 
138
}
-
 
139
else
-
 
140
{
110
usleep(100000);
141
    usleep(100000);
111
atomd_kill_promt($socket);
142
    atomd_kill_promt($socket);
112
atomd_send_command($socket, "Node_WaitForInformation");
143
    atomd_send_command($socket, "Node_WaitForInformation");
113
#atomd_send_command($socket, "Node_GetInformation 0x7DD44E0A");
144
    #atomd_send_command($socket, "Node_GetInformation 0x7DD44E0A");
114
$return = atomd_read_command_response($socket);
145
    $return = atomd_read_command_response($socket);
115
 
-
 
116
my @lines = split(/\n/, $return);
146
    @lines = split(/\n/, $return);
-
 
147
}
117
 
148
 
118
my $foundDeviceType = 0;
149
my $foundDeviceType = 0;
119
foreach (@lines)
150
foreach (@lines)
120
{
151
{
121
    my $line = $_;
152
    my $line = $_;