From ba4f204c254adb2098f9e54d5f59e264a49b8643 Mon Sep 17 00:00:00 2001 From: gohai Date: Tue, 1 Oct 2013 21:27:27 -0700 Subject: [PATCH 1/5] Remove commented out lines --- java/libraries/serial/src/processing/serial/Serial.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/java/libraries/serial/src/processing/serial/Serial.java b/java/libraries/serial/src/processing/serial/Serial.java index 8265dffdd..130fc3129 100644 --- a/java/libraries/serial/src/processing/serial/Serial.java +++ b/java/libraries/serial/src/processing/serial/Serial.java @@ -186,8 +186,6 @@ public class Serial implements SerialPortEventListener { public static Map getProperties(String portName) { - //SerialPortList list = new SerialPortList(); - //return list.getPortProperties(portName); return SerialPortList.getPortProperties(portName); } @@ -214,8 +212,6 @@ public class Serial implements SerialPortEventListener { public static String[] list() { // returns list sorted alphabetically, thus cu.* comes before tty.* // this was different with RXTX - //SerialPortList list = new SerialPortList(); - //return list.getPortNames(); return SerialPortList.getPortNames(); } @@ -457,4 +453,4 @@ public class Serial implements SerialPortEventListener { throw new RuntimeException("Error writing to serial port " + e.getPortName() + ": " + e.getExceptionType()); } } -} \ No newline at end of file +} From 7c2f50ef8af519ab79db8cfb685d3204b2b5eb73 Mon Sep 17 00:00:00 2001 From: gohai Date: Tue, 1 Oct 2013 21:27:48 -0700 Subject: [PATCH 2/5] Remove obsolete .cvsignore file --- java/libraries/serial/library/.cvsignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 java/libraries/serial/library/.cvsignore diff --git a/java/libraries/serial/library/.cvsignore b/java/libraries/serial/library/.cvsignore deleted file mode 100644 index 718e029bc..000000000 --- a/java/libraries/serial/library/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -serial.jar From 3b8ed3db5550ea2ac0474bcb9d1fd41b4eb4fc9a Mon Sep 17 00:00:00 2001 From: gohai Date: Tue, 1 Oct 2013 21:29:15 -0700 Subject: [PATCH 3/5] Document how to compile the native JSSC library --- java/libraries/serial/library/jssc.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/libraries/serial/library/jssc.txt b/java/libraries/serial/library/jssc.txt index cf2f974ac..7174ece29 100644 --- a/java/libraries/serial/library/jssc.txt +++ b/java/libraries/serial/library/jssc.txt @@ -1 +1,4 @@ This is using a modified version of Java Simple Serial Connector by Alexey Sokolov. See https://github.com/gohai/java-simple-serial-connector for details on the modifications. + +To compile the C++ portion of the library on OS X: +g++ -shared [or: -dynamiclib?] -arch i386 -arch x86_64 -I/System/Library/Frameworks/IOKit.framework/Versions/A/Headers -I$JAVA_HOME/include -I$JAVA_HOME/include/darwin -framework IOKit -framework CoreFoundation -o libjSSC-2.6.jnilib jssc.cpp From 22e55751b0444e44afe3fe21f3363f1447ea00ae Mon Sep 17 00:00:00 2001 From: gohai Date: Tue, 1 Oct 2013 21:30:09 -0700 Subject: [PATCH 4/5] Add JSSC to Javadoc build --- build/build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.xml b/build/build.xml index 572fdc06a..54a738a77 100755 --- a/build/build.xml +++ b/build/build.xml @@ -1066,7 +1066,7 @@ - + From ee891808e7b49c3d35db128ad783f55dc6d60992 Mon Sep 17 00:00:00 2001 From: gohai Date: Tue, 1 Oct 2013 22:22:05 -0700 Subject: [PATCH 5/5] Remove obsolete SerialFixer The SerialFixer removed stale lock files on OS X, which are no longer used by the new serial library (JSSC). --- app/src/processing/app/Editor.java | 3 - app/src/processing/app/tools/SerialFixer.java | 89 ------------------- 2 files changed, 92 deletions(-) delete mode 100644 app/src/processing/app/tools/SerialFixer.java diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index f0dfe17b2..a117489c9 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1009,9 +1009,6 @@ public abstract class Editor extends JFrame implements RunnerListener { addToolMenuItem(menu, "processing.app.tools.Archiver"); if (Base.isMacOS()) { - if (SerialFixer.isNeeded()) { - addToolMenuItem(menu, "processing.app.tools.SerialFixer"); - } addToolMenuItem(menu, "processing.app.tools.InstallCommander"); } diff --git a/app/src/processing/app/tools/SerialFixer.java b/app/src/processing/app/tools/SerialFixer.java deleted file mode 100644 index 7065b53bc..000000000 --- a/app/src/processing/app/tools/SerialFixer.java +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012 The Processing Foundation - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, version 2. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -package processing.app.tools; - -import java.io.File; - -import javax.swing.JOptionPane; - -import processing.app.Base; -import processing.app.Editor; -import processing.core.PApplet; - - -public class SerialFixer implements Tool { - Editor editor; - - - public String getMenuTitle() { - return "Fix the Serial Library"; - } - - - public void init(Editor editor) { - this.editor = editor; - } - - - public void run() { - final String primary = - "Attempt to fix common serial port problems?"; - final String secondary = - "Click “OK” to perform additional installation steps to enable " + - "the Serial library. An administrator password will be required."; - - int result = - JOptionPane.showConfirmDialog(editor, - " " + - " " + - "" + primary + "" + - "

" + secondary + "

", - "Commander", - JOptionPane.OK_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE); - - if (result == JOptionPane.OK_OPTION) { - String shellScript = "mkdir -p /var/lock && chmod 777 /var/lock"; - String appleScript = - "do shell script \"" + shellScript + "\" with administrator privileges"; - PApplet.exec(new String[] { "osascript", "-e", appleScript }); - } - editor.statusNotice("Finished."); - } - - - static public boolean isNeeded() { - if (Base.isMacOS()) { - File lockFolder = new File("/var/lock"); - if (!lockFolder.exists() || - !lockFolder.canRead() || - !lockFolder.canWrite() || - !lockFolder.canExecute()) { - return true; - } - } - return false; - } -} \ No newline at end of file