Skip to content
Snippets Groups Projects
Commit d37a625c authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Trk: Make run.pl work with BlueTooth

parent 02734ecc
No related branches found
No related tags found
No related merge requests found
...@@ -15,21 +15,23 @@ my $isUnix = $OSNAME eq 'linux' ? 1 : 0; ...@@ -15,21 +15,23 @@ my $isUnix = $OSNAME eq 'linux' ? 1 : 0;
my $MAKE= $isUnix ? 'make' : 'nmake'; my $MAKE= $isUnix ? 'make' : 'nmake';
my $trkservername; my $trkservername;
my $runTrkServer = 1; my $runTrkServer = 1;
my $waitAdapter = 0;
my $usage=<<EOF; my $usage=<<EOF;
Usage: run.pl -av -aq -au -tv -tq -l [COM] Usage: run.pl -w -av -aq -au -tv -tq -l [COM]
Options: Options:
-av Adapter verbose -av Adapter verbose
-aq Adapter quiet -aq Adapter quiet
-au Adapter turn off buffered memory read -au Adapter turn off buffered memory read
-af Adapter turn off serial frame -af Adapter turn off serial frame
-w Wait for termination of Adapter (Bluetooth)
-tv TrkServer verbose -tv TrkServer verbose
-tq TrkServer quiet -tq TrkServer quiet
trkserver simulator will be run unless COM is specified trkserver simulator will be run unless COM is specified
Bluetooth: Bluetooth:
rfcomm listen /dev/rfcomm0 1 \$PWD/run.pl -av -af {} rfcomm listen /dev/rfcomm0 1 \$PWD/run.pl -av -af -w {}
EOF EOF
...@@ -46,6 +48,8 @@ for (my $i = 0; $i < $argCount; $i++) { ...@@ -46,6 +48,8 @@ for (my $i = 0; $i < $argCount; $i++) {
push(@ADAPTER_OPTIONS, '-f'); push(@ADAPTER_OPTIONS, '-f');
} elsif ($a eq '-au') { } elsif ($a eq '-au') {
push(@ADAPTER_OPTIONS, '-u'); push(@ADAPTER_OPTIONS, '-u');
} elsif ($a eq '-w') {
$waitAdapter = 1;
} elsif ($a eq '-tv') { } elsif ($a eq '-tv') {
push(@TRKSERVEROPTIONS, '-v'); push(@TRKSERVEROPTIONS, '-v');
} elsif ($a eq '-tq') { } elsif ($a eq '-tq') {
...@@ -125,7 +129,8 @@ if ($adapterpid == 0) { ...@@ -125,7 +129,8 @@ if ($adapterpid == 0) {
exec(@ADAPTER_ARGS); exec(@ADAPTER_ARGS);
exit(0); exit(0);
} }
die ('Unable to launch adapter') if $adapterpid == -1;
waitpid($adapterpid, 0) if ($waitAdapter > 0);
# ------- Write out .gdbinit # ------- Write out .gdbinit
my $gdbInit = <<EOF; my $gdbInit = <<EOF;
# This is generated. Changes will be lost. # This is generated. Changes will be lost.
...@@ -138,7 +143,7 @@ target extended-remote $gdbserverip:$gdbserverport ...@@ -138,7 +143,7 @@ target extended-remote $gdbserverip:$gdbserverport
#file filebrowseapp.sym #file filebrowseapp.sym
add-symbol-file filebrowseapp.sym 0x786A4000 add-symbol-file filebrowseapp.sym 0x786A4000
symbol-file filebrowseapp.sym symbol-file filebrowseapp.sym
print E32Main print E32Main
break E32Main break E32Main
#continue #continue
#info files #info files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment