20
20
21
21
public class OpenOCD extends TargetConnection {
22
22
23
- private static boolean dbg = true ;
23
+ private static boolean dbg = false ;
24
24
private static TargetConnection tc ;
25
25
private String hostname ;
26
26
private int port ;
@@ -33,7 +33,7 @@ private OpenOCD() { }
33
33
public static TargetConnection getInstance () {
34
34
if (tc != null && !tc .isConnected ()) tc = null ;
35
35
if (tc == null ) {
36
- if (dbg ) StdStreams .vrb .println ("[TARGET] OpenOCD: Creating new OpenOCD Telnet " );
36
+ if (dbg ) StdStreams .vrb .println ("[TARGET] OpenOCD: Creating new OpenOCD telnet connection " );
37
37
tc = new OpenOCD ();
38
38
}
39
39
return tc ;
@@ -47,7 +47,7 @@ public void openConnection() throws TargetConnectionException {
47
47
currLoc = currLoc .replace (currLoc .substring (currLoc .length ()-1 ), "" );
48
48
currLoc += "\\ startOpenocd-local.bat" ;
49
49
String name = "F:\\ openocd-0.10.0\\ startOpenocdMicrozed.bat" ;
50
- StdStreams .vrb .println ("run openocd: " + name );
50
+ // StdStreams.vrb.println("run openocd: " + name);
51
51
File dir = new File ("F:\\ openocd-0.10.0" );
52
52
Process p = Runtime .getRuntime ().exec ("cmd /c start \" \" " + name , null , dir );
53
53
if (p != null ) {
@@ -88,7 +88,6 @@ public void closeConnection() {
88
88
// do nothing
89
89
}
90
90
if (dbg ) StdStreams .vrb .println ("[TARGET] Connection closed" );
91
- System .out .println ("closing" );
92
91
}
93
92
94
93
@ Override
@@ -340,7 +339,7 @@ public void downloadImageFile(String filename) throws TargetConnectionException
340
339
ArrayList <Map .Entry <String ,Integer >> files = Configuration .getImgFile ();
341
340
if (files .isEmpty ()) StdStreams .err .println ("no image files available" );
342
341
for (Map .Entry <String ,Integer > file : files ) {
343
- socket .setSoTimeout (3000 );
342
+ socket .setSoTimeout (8000 );
344
343
String name = file .getKey ();
345
344
name = name .replace ('\\' , '/' );
346
345
StdStreams .log .println ("Downloading " + name );
0 commit comments