forked from c4ev3/ev3duder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflash.pl
executable file
·26 lines (17 loc) · 828 Bytes
/
flash.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl
# stderr output can be filtered out on windows by appending 2> NUL to the line calling perl
use strict;
$|++;
eval "use autodie 'system';" if eval "use IPC::System::Simple;1;";
my $name = $ARGV[0];
my $localBinary = "test/$name";
my $remoteBinary = "../prjs/SD_Card/$name";
my $localLauncher = "test/myapps/${name}Starter.rbf";
my $remoteLauncher = "../prjs/SD_Card/myapps/${name}Starter.rbf";
system("./ev3duder" , 'up', $localBinary, $remoteBinary);
printf("\n2- Attempting getting starter <%s> to <%s>\n", $localLauncher, $remoteLauncher);
system("./ev3duder", 'up', $localLauncher, $remoteLauncher);
printf("\n3- Attempting start of starter <%s>\n", $remoteLauncher);
system("./ev3duder", 'run', $remoteLauncher);
printf("\n4- All is well!\n");
END {printf("\nLast error code: %s\n", $?>> 8);}