- Timestamp:
- 07/22/07 13:18:09 (5 years ago)
- Location:
- mymrc/trunk/Java-client
- Files:
-
- 6 modified
-
dist/myMRC.jad (modified) (1 diff)
-
dist/myMRC.jar (modified) (previous)
-
src/org/myMRC/control/Controller.java (modified) (4 diffs)
-
src/org/myMRC/events/Content.java (modified) (1 diff)
-
src/org/myMRC/myMRC.java (modified) (1 diff)
-
src/org/myMRC/net/BluetoothController.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mymrc/trunk/Java-client/dist/myMRC.jad
r32 r33 1 1 MIDlet-1: myMRC,,org.myMRC.myMRC 2 2 MIDlet-Icon: /images/icon.png 3 MIDlet-Jar-Size: 800553 MIDlet-Jar-Size: 79683 4 4 MIDlet-Jar-URL: myMRC.jar 5 5 MIDlet-Name: myMRC -
mymrc/trunk/Java-client/src/org/myMRC/control/Controller.java
r32 r33 225 225 switch (opcode) { 226 226 case Opcode.IOP_START: 227 if (!communicator.isAlive()) { 228 this.handle(Opcode.IOP_PARSEFORM, Content.CONT_START); 229 } else { 230 this.handle(Opcode.IOP_PARSEFORM, Content.CONT_START_CONNECTED); 231 } 232 227 this.handle(Opcode.IOP_PARSEFORM, Content.CONT_START); 233 228 break; 234 229 … … 237 232 case Settings.CONN_BLUETOOTH: 238 233 this.communicator = BluetoothController.getInstance(); 234 BluetoothController.getInstance().getDevices(); 239 235 break; 240 236 … … 302 298 303 299 case Opcode.IOP_SETTINGS_SAVE: 304 //config.writeSettings(form);305 300 try { 306 301 config.setFromForm(form); … … 322 317 323 318 case Opcode.IOP_INT_EXIT: 324 if (communicator .isAlive()) {319 if (communicator != null && communicator.isAlive()) { 325 320 try { 326 communicator.close(); // FIXME: does it work?321 communicator.close(); 327 322 } catch (IOException ioe) { 328 323 ioe.printStackTrace(); -
mymrc/trunk/Java-client/src/org/myMRC/events/Content.java
r32 r33 42 42 " <command type=\"back\" label=\"Exit\" opcode=\"0" + Opcode.IOP_INT_EXIT_CONF + "\"/>" + 43 43 "</form>"; 44 45 public static final String CONT_START_CONNECTED =46 "<form label=\"myMRC 0.1\">" +47 " <image file=\"mymrc.png\"/>" +48 " <string label=\"OH OH! this is deprecated, it shouldn't be displayed\"/>" +49 " <command label=\"Continue\" opcode=\"0000\"/>" +50 " <command label=\"Disconnect\" opcode=\"0991\"/>" +51 " <command label=\"Settings\" opcode=\"0920\"/>" +52 " <command label=\"About\" opcode=\"0901\"/>" +53 " <command label=\"Exit\" opcode=\"0998\"/>" +54 " <command type=\"back\" label=\"Exit\" opcode=\"0998\"/>" +55 "</form>";56 44 57 45 public static final String CONT_SETTINGS = -
mymrc/trunk/Java-client/src/org/myMRC/myMRC.java
r32 r33 41 41 */ 42 42 public void exitMIDlet() { 43 try {44 if (InetController.getInstance().isAlive()) {45 InetController.getInstance().close();46 }47 if (BluetoothController.getInstance().isAlive()) {48 BluetoothController.getInstance().close();49 }50 } catch (IOException ioe) {51 /*52 * well, not much we can do here, exiting anyway, will just keep53 * the socket open for some more time54 */55 }56 57 //InetController.getInstance().destroy();58 59 43 Display.getDisplay(this).setCurrent(null); 60 44 destroyApp(true); -
mymrc/trunk/Java-client/src/org/myMRC/net/BluetoothController.java
r32 r33 51 51 private BluetoothController() { 52 52 this.controller = Controller.getInstance(); 53 this.getDevices();53 //this.getDevices(); 54 54 } 55 55 … … 105 105 * Scans for available Bluetooth devices. 106 106 */ 107 p rivatevoid getDevices() {107 public void getDevices() { 108 108 try { 109 109 this.local = LocalDevice.getLocalDevice(); … … 415 415 super.receiver = new Receiver(this, conn.openInputStream()); 416 416 super.receiver.start(); 417 //ostream.write("whoohoo\n".getBytes());418 //ostream.flush();419 417 super.isAlive = true; 420 418 super.send(Opcode.OP_HELLO, null); 421 //istream = conn.openInputStream(); 422 //int size = 197; 423 //byte[] b = new byte[size]; 424 //istream.read(b, 0, size); 425 //controller.handle(Opcode.IOP_PARSELIST, new String(b)); 419 426 420 } catch (IOException ioe) { 427 421 alert.setString("Connection failed: " + ioe.getMessage()); … … 433 427 } 434 428 435 //alert.setString("Connected to " + url + " (conn = " + conn + ")");436 //controller.setScreen(alert);437 429 } 438 430
