[tuxdroid-svn] r5903 - software_suite_v3/software/tool/tool-tux-controller/trunk/src/GUI/control
Status: Beta
Brought to you by:
ks156
|
From: ks156 <c2m...@c2...> - 2009-11-18 10:31:09
|
Author: ks156
Date: 2009-11-18 11:29:27 +0100 (Wed, 18 Nov 2009)
New Revision: 5903
Modified:
software_suite_v3/software/tool/tool-tux-controller/trunk/src/GUI/control/controlTux.java
Log:
* Merged the user_mode branch from rev 5372.
This branch is now done and discontinued.
Modified: software_suite_v3/software/tool/tool-tux-controller/trunk/src/GUI/control/controlTux.java
===================================================================
--- software_suite_v3/software/tool/tool-tux-controller/trunk/src/GUI/control/controlTux.java 2009-11-18 10:27:56 UTC (rev 5902)
+++ software_suite_v3/software/tool/tool-tux-controller/trunk/src/GUI/control/controlTux.java 2009-11-18 10:29:27 UTC (rev 5903)
@@ -34,9 +34,27 @@
public controlTux(mainWindow winInstance) {
win = winInstance;
+
+ /* Try to connect with the port 270 */
tux = new TuxAPI("127.0.0.1", 270);
tux.server.autoConnect(TuxAPIConst.CLIENT_LEVEL_RESTRICTED,
"TuxController", "98765");
+
+ /* Wait 1 second, and check if the API is connected */
+ try {
+ Thread.sleep(1000);
+ }
+ catch(Exception except) {
+ except.printStackTrace();
+ }
+
+ /* If the API is not connected, try with the port 54321 */
+ if (tux.server.getConnected() != true)
+ {
+ tux = new TuxAPI("127.0.0.1", 54321);
+ tux.server.autoConnect(TuxAPIConst.CLIENT_LEVEL_RESTRICTED,
+ "TuxController", "98765");
+ }
tux.server.waitConnected(0.5);
registerEvents();
if (tux.radio.waitConnected(0.5))
|