Skip to content

Switch to Java Simple Serial Connector, a replacement for RXTX #1633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Dec 3, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7bd9708
removing RXTX, switching to JSSC
Oct 4, 2013
79f43bb
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 9, 2013
6244899
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 12, 2013
9d34d48
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 14, 2013
5c1f385
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 14, 2013
8bd30db
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 17, 2013
2182e7c
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 21, 2013
71f5b76
jssc: updated config files (eclipse, ant build.xml, windows launcher,…
Oct 21, 2013
bafc7cc
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 22, 2013
96a6215
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 22, 2013
6402e81
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 22, 2013
3a545d0
Fixed upload on Arduino Leonardo (and derivatives) with JSSC on Mac.
cmaglie Oct 23, 2013
557fd6d
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Oct 28, 2013
80666a3
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 5, 2013
c2e5221
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 8, 2013
678fd8f
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 11, 2013
ac5e1e2
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 11, 2013
5dc9e53
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 11, 2013
7a3fb0c
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 11, 2013
0bc781e
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 14, 2013
e55874f
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 16, 2013
6d9278e
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 16, 2013
88ad27f
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 17, 2013
fd9384b
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 18, 2013
9c618ff
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 18, 2013
ea8a4ec
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 25, 2013
9586960
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 28, 2013
62d96ba
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 28, 2013
368726f
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 28, 2013
2689f95
Merge branch 'ide-1.5.x' into ide-1.5.x-jssc
Nov 28, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<classpathentry kind="lib" path="app/lib/apple.jar"/>
<classpathentry kind="lib" path="app/lib/ecj.jar"/>
<classpathentry kind="lib" path="app/lib/jna.jar"/>
<classpathentry kind="lib" path="app/lib/RXTXcomm.jar"/>
<classpathentry kind="lib" path="app/lib/jssc-2.6.0.jar"/>
<classpathentry kind="lib" path="app/test-lib/junit-4.11.jar"/>
<classpathentry kind="lib" path="app/test-lib/fest-assert-1.2.jar"/>
<classpathentry kind="lib" path="app/test-lib/fest-reflect-1.2.jar"/>
Expand Down
2 changes: 1 addition & 1 deletion app/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<classpathentry kind="lib" path="lib/ecj.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
<classpathentry kind="lib" path="lib/apple.jar"/>
<classpathentry kind="lib" path="lib/RXTXcomm.jar"/>
<classpathentry kind="lib" path="lib/jssc-2.6.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Empty file.
Binary file removed app/lib/RXTXcomm.jar
Binary file not shown.
Binary file added app/lib/jssc-2.6.0.jar
Binary file not shown.
674 changes: 674 additions & 0 deletions app/lib/jssc.LICENSE.GPL.txt

Large diffs are not rendered by default.

165 changes: 165 additions & 0 deletions app/lib/jssc.LICENSE.LGPL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.


This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.

1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.

e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
2 changes: 1 addition & 1 deletion app/run-linux.launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-6-openjdk-amd64&quot; javaProject=&quot;processing&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/ecj.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/jna.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/RXTXcomm.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/jssc-2.6.0.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;processing-core&quot; type=&quot;1&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;processing&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
</listAttribute>
Expand Down
42 changes: 17 additions & 25 deletions app/src/cc/arduino/packages/discoverers/SerialDiscovery.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@

package cc.arduino.packages.discoverers;

import gnu.io.CommPortIdentifier;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

import cc.arduino.packages.BoardPort;
import cc.arduino.packages.Discovery;
import jssc.SerialPortList;
import processing.app.Base;
import processing.app.Platform;
import processing.app.helpers.PreferencesMap;
import cc.arduino.packages.BoardPort;
import cc.arduino.packages.Discovery;

import java.util.ArrayList;
import java.util.List;

public class SerialDiscovery implements Discovery {

Expand All @@ -49,27 +47,21 @@ public List<BoardPort> discovery() {
String devicesListOutput = os.preListAllCandidateDevices();

List<BoardPort> res = new ArrayList<BoardPort>();
@SuppressWarnings("unchecked")
Enumeration<CommPortIdentifier> ports = CommPortIdentifier
.getPortIdentifiers();
while (ports.hasMoreElements()) {
CommPortIdentifier commPort = ports.nextElement();
if (commPort.getPortType() != CommPortIdentifier.PORT_SERIAL)
continue;

String address = commPort.getName();
String boardName = os.resolveDeviceAttachedTo(address, Base.packages,
devicesListOutput);
String label = address;
String[] ports = SerialPortList.getPortNames();

for (String port : ports) {
String boardName = os.resolveDeviceAttachedTo(port, Base.packages, devicesListOutput);
String label = port;
if (boardName != null)
label += " (" + boardName + ")";

BoardPort port = new BoardPort();
port.setAddress(address);
port.setProtocol("serial");
port.setBoardName(boardName);
port.setLabel(label);
res.add(port);
BoardPort boardPort = new BoardPort();
boardPort.setAddress(port);
boardPort.setProtocol("serial");
boardPort.setBoardName(boardName);
boardPort.setLabel(label);
res.add(boardPort);
}
return res;
}
Expand Down
6 changes: 2 additions & 4 deletions app/src/cc/arduino/packages/uploaders/SerialUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,13 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
// otherwise assert DTR, which would cancel the WDT reset if
// it happened within 250 ms. So we wait until the reset should
// have already occured before we start scanning.
if (!Base.isMacOS())
Thread.sleep(300);

Thread.sleep(300);
uploadPort = waitForUploadPort(uploadPort, before);
} else {
Thread.sleep(400);
}
} catch (SerialException e) {
throw new RunnerException(e.getMessage());
throw new RunnerException(e);
} catch (InterruptedException e) {
throw new RunnerException(e.getMessage());
}
Expand Down
Loading