1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +02:00

Merge "Bug 463844 - Support serial port connection type."

This commit is contained in:
Greg Watson 2015-04-13 09:54:04 -04:00 committed by Gerrit Code Review @ Eclipse.org
commit 2618625a26
55 changed files with 1696 additions and 21 deletions

1
bundles/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/bin/

View file

@ -162,7 +162,7 @@ public class RemoteServicesManager implements IRemoteServicesManager {
@SafeVarargs
public final List<IRemoteConnectionType> getConnectionTypesSupporting(Class<? extends IRemoteConnection.Service>... services) {
List<IRemoteConnectionType> connTypes = new ArrayList<IRemoteConnectionType>();
for (IRemoteConnectionType connType : getRemoteConnectionTypes()) {
for (IRemoteConnectionType connType : getAllConnectionTypes()) {
for (Class<? extends IRemoteConnection.Service> service : services) {
if (!connType.hasConnectionService(service)) {
connTypes.add(connType);
@ -182,7 +182,7 @@ public class RemoteServicesManager implements IRemoteServicesManager {
@SafeVarargs
public final List<IRemoteConnectionType> getConnectionTypesByService(Class<? extends IRemoteConnectionType.Service>... services) {
List<IRemoteConnectionType> connTypes = new ArrayList<IRemoteConnectionType>();
for (IRemoteConnectionType connType : getRemoteConnectionTypes()) {
for (IRemoteConnectionType connType : getAllConnectionTypes()) {
for (Class<? extends IRemoteConnectionType.Service> service : services) {
if (!connType.hasService(service)) {
connTypes.add(connType);

View file

@ -290,7 +290,7 @@ public class JSchConnectionPage extends WizardPage {
lblConnection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
lblConnection.setText(Messages.JSchConnectionPage_SelectConnection);
fProxyConnectionWidget = new RemoteConnectionWidget(proxyComp, SWT.NONE, null, 0, null);
fProxyConnectionWidget = new RemoteConnectionWidget(proxyComp, SWT.NONE, null, 0);
fProxyConnectionWidget.filterConnections(IRemoteConnectionHostService.class, IRemotePortForwardingService.class);
Label lblCommand = new Label(proxyComp, SWT.WRAP);

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1 @@
/bin/

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.remote.serial.core</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View file

@ -0,0 +1,14 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.remote.serial.core;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.remote.serial.internal.core.Activator
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.remote.core;bundle-version="2.0.0",
org.eclipse.cdt.native.serial
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.remote.serial.core
Bundle-Localization: plugin

View file

@ -0,0 +1,22 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>About</title>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>May 2, 2006</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org.</p>
</body>
</html>

View file

@ -0,0 +1,27 @@
# about.ini
# contains information about a feature
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# "%key" are externalized strings defined in about.properties
# This file does not need to be translated.
# Property "aboutText" contains blurb for "About" dialog (translated)
aboutText=%blurb
# Property "windowImage" contains path to window icon (16x16)
# needed for primary features only
# Property "featureImage" contains path to feature image (32x32)
featureImage=ptp_logo_icon32.png
# Property "aboutImage" contains path to product image (500x330 or 115x164)
# needed for primary features only
# Property "appName" contains name of the application (not translated)
# needed for primary features only
# Property "welcomePage" contains path to welcome page (special XML-based format)
# optional
# Property "welcomePerspective" contains the id of the perspective in which the
# welcome page is to be opened.
# optional

View file

@ -0,0 +1,6 @@
# about.mappings
# contains fill-ins for about.properties
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=@build@

View file

@ -0,0 +1,22 @@
###############################################################################
# Copyright (c) 2015 QNX Software Systems and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# QNX Software Systems - initial API and implementation
###############################################################################
# NLS_MESSAGEFORMAT_NONE
# NLS_ENCODING=UTF-8
blurb=Serial Port Remote Services\n\
\n\
Version: {featureVersion}\n\
Build id: {0}\n\
\n\
Copyright (c) 2015 QNX Software Systems, and others. All rights reserved.\n\
Visit http://www.eclipse.org/ptp\n

View file

@ -0,0 +1,10 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
about.html,\
about.ini,\
about.mappings,\
about.properties,\
ptp_logo_icon32.png

View file

@ -0,0 +1,2 @@
bundleName = Remote Serial Port Services
providerName = Eclipse PTP

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.remote.core.remoteServices">
<connectionType
capabilities="7"
id="org.eclipse.remote.serial.core.connectionType"
name="Serial Port">
</connectionType>
<connectionService
connectionTypeId="org.eclipse.remote.serial.core.connectionType"
factory="org.eclipse.remote.serial.core.SerialPortConnection$Factory"
service="org.eclipse.remote.serial.core.ISerialPortService">
</connectionService>
<connectionService
connectionTypeId="org.eclipse.remote.serial.core.connectionType"
factory="org.eclipse.remote.serial.core.SerialPortConnection$Factory"
service="org.eclipse.remote.core.IRemoteCommandShellService">
</connectionService>
</extension>
</plugin>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.remote</groupId>
<artifactId>remote-parent</artifactId>
<version>1.1.1-SNAPSHOT</version>
<relativePath>../../releng/org.eclipse.remote.build/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.remote.serial.core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -0,0 +1,27 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.core;
import org.eclipse.cdt.serial.SerialPort;
import org.eclipse.remote.core.IRemoteConnection;
public interface ISerialPortService extends IRemoteConnection.Service {
static final String TYPE_ID = "org.eclipse.remote.serial.core.connectionType"; //$NON-NLS-1$
static final String PORT_NAME_ATTR = "serial.portName"; //$NON-NLS-1$
static final String BAUD_RATE_ATTR = "serial.baudRate"; //$NON-NLS-1$
static final String BYTE_SIZE_ATTR = "serial.byteSize"; //$NON-NLS-1$
static final String PARITY_ATTR = "serial.parity"; //$NON-NLS-1$
static final String STOP_BITS_ATTR = "serial.stopBits"; //$NON-NLS-1$
SerialPort getSerialPort();
}

View file

@ -0,0 +1,113 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.core;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.eclipse.cdt.serial.SerialPort;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteProcess;
import org.eclipse.remote.core.IRemoteProcessBuilder;
import org.eclipse.remote.serial.internal.core.Activator;
public class SerialPortCommandShell implements IRemoteProcess {
private final IRemoteConnection remoteConnection;
private final SerialPort serialPort;
public SerialPortCommandShell(IRemoteConnection remoteConnection, SerialPort serialPort) throws IOException {
this.remoteConnection = remoteConnection;
this.serialPort = serialPort;
serialPort.open();
}
@Override
public synchronized void destroy() {
if (serialPort.isOpen()) {
try {
serialPort.close();
} catch (IOException e) {
Activator.log(e);
}
notifyAll();
}
}
@Override
public int exitValue() {
return 0;
}
@Override
public InputStream getErrorStream() {
return new InputStream() {
@Override
public int read() throws IOException {
synchronized (SerialPortCommandShell.this) {
if (serialPort.isOpen()) {
try {
wait();
} catch (InterruptedException e) {
}
}
}
return 0;
}
};
}
@Override
public InputStream getInputStream() {
return serialPort.getInputStream();
}
@Override
public OutputStream getOutputStream() {
return serialPort.getOutputStream();
}
@Override
public synchronized int waitFor() throws InterruptedException {
if (serialPort.isOpen()) {
wait();
}
return 0;
}
@Override
public boolean isCompleted() {
return false;
}
@Override
public IRemoteConnection getRemoteConnection() {
return remoteConnection;
}
@Override
public <T extends Service> T getService(Class<T> service) {
return null;
}
@Override
public <T extends Service> boolean hasService(Class<T> service) {
return false;
}
@Override
public IRemoteProcessBuilder getProcessBuilder() {
return null;
}
}

View file

@ -0,0 +1,82 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.core;
import java.io.IOException;
import org.eclipse.cdt.serial.BaudRate;
import org.eclipse.cdt.serial.ByteSize;
import org.eclipse.cdt.serial.Parity;
import org.eclipse.cdt.serial.SerialPort;
import org.eclipse.cdt.serial.StopBits;
import org.eclipse.remote.core.IRemoteCommandShellService;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnection.Service;
import org.eclipse.remote.core.IRemoteProcess;
import org.eclipse.remote.serial.internal.core.Activator;
import org.eclipse.remote.serial.internal.core.Messages;
public class SerialPortConnection implements ISerialPortService, IRemoteCommandShellService {
private final IRemoteConnection remoteConnection;
private SerialPort serialPort;
private SerialPortConnection(IRemoteConnection remoteConnection) {
this.remoteConnection = remoteConnection;
}
public static class Factory implements IRemoteConnection.Service.Factory {
@SuppressWarnings("unchecked")
@Override
public <T extends Service> T getService(IRemoteConnection remoteConnection, Class<T> service) {
if (ISerialPortService.class.equals(service)) {
return (T) new SerialPortConnection(remoteConnection);
} else if (IRemoteCommandShellService.class.equals(service)) {
return (T) getService(remoteConnection, ISerialPortService.class);
}
return null;
}
}
@Override
public IRemoteConnection getRemoteConnection() {
return remoteConnection;
}
@Override
public SerialPort getSerialPort() {
if (serialPort == null) {
String portName = remoteConnection.getAttribute(PORT_NAME_ATTR);
if (portName != null) {
serialPort = new SerialPort(portName);
try {
serialPort.setBaudRate(BaudRate.fromStringIndex(Integer.parseInt(remoteConnection.getAttribute(BAUD_RATE_ATTR))));
serialPort.setByteSize(ByteSize.fromStringIndex(Integer.parseInt(remoteConnection.getAttribute(BYTE_SIZE_ATTR))));
serialPort.setParity(Parity.fromStringIndex(Integer.parseInt(remoteConnection.getAttribute(PARITY_ATTR))));
serialPort.setStopBits(StopBits.fromStringIndex(Integer.parseInt(remoteConnection.getAttribute(STOP_BITS_ATTR))));
} catch (IOException e) {
Activator.log(e);
}
}
}
return serialPort;
}
@Override
public IRemoteProcess getCommandShell(int flags) throws IOException {
SerialPort serialPort = getSerialPort();
if (serialPort == null) {
throw new IOException(Messages.SerialPortConnection_SerialPortNotAvailable);
}
return new SerialPortCommandShell(remoteConnection, getSerialPort());
}
}

View file

@ -0,0 +1,43 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.internal.core;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;
public class Activator extends Plugin {
private static Plugin plugin;
public void start(BundleContext bundleContext) throws Exception {
plugin = this;
}
public void stop(BundleContext bundleContext) throws Exception {
plugin = null;
}
public static void log(IStatus status) {
plugin.getLog().log(status);
}
public static void log(Exception exception) {
if (exception instanceof CoreException) {
log(((CoreException) exception).getStatus());
} else {
log(new Status(IStatus.ERROR, plugin.getBundle().getSymbolicName(), exception.getLocalizedMessage(), exception));
}
}
}

View file

@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.internal.core;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.remote.serial.internal.core.messages"; //$NON-NLS-1$
public static String SerialPortConnection_SerialPortNotAvailable;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -0,0 +1,11 @@
################################################################################
# Copyright (c) 2015 QNX Software Systems, and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# QNX Software Systems - initial contribution
################################################################################
SerialPortConnection_SerialPortNotAvailable=Serial port not available.

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1 @@
/bin/

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.remote.serial.ui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

View file

@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.remote.serial.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.remote.serial.internal.ui.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.remote.core;bundle-version="2.0.0",
org.eclipse.remote.ui;bundle-version="2.0.0",
org.eclipse.cdt.native.serial;bundle-version="1.0.0",
org.eclipse.remote.serial.core;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -0,0 +1,22 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>About</title>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>May 2, 2006</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org.</p>
</body>
</html>

View file

@ -0,0 +1,27 @@
# about.ini
# contains information about a feature
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# "%key" are externalized strings defined in about.properties
# This file does not need to be translated.
# Property "aboutText" contains blurb for "About" dialog (translated)
aboutText=%blurb
# Property "windowImage" contains path to window icon (16x16)
# needed for primary features only
# Property "featureImage" contains path to feature image (32x32)
featureImage=ptp_logo_icon32.png
# Property "aboutImage" contains path to product image (500x330 or 115x164)
# needed for primary features only
# Property "appName" contains name of the application (not translated)
# needed for primary features only
# Property "welcomePage" contains path to welcome page (special XML-based format)
# optional
# Property "welcomePerspective" contains the id of the perspective in which the
# welcome page is to be opened.
# optional

View file

@ -0,0 +1,6 @@
# about.mappings
# contains fill-ins for about.properties
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file does not need to be translated.
0=@build@

View file

@ -0,0 +1,22 @@
###############################################################################
# Copyright (c) 2015 QNX Software Systems and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# QNX Software Systems - initial API and implementation
###############################################################################
# NLS_MESSAGEFORMAT_NONE
# NLS_ENCODING=UTF-8
blurb=Serial Port Remote Services\n\
\n\
Version: {featureVersion}\n\
Build id: {0}\n\
\n\
Copyright (c) 2015 QNX Software Systems, and others. All rights reserved.\n\
Visit http://www.eclipse.org/ptp\n

View file

@ -0,0 +1,10 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
about.html,\
about.ini,\
about.mappings,\
about.properties,\
ptp_logo_icon32.png

View file

@ -0,0 +1,2 @@
bundleName = Remote Serial Port Services UI
providerName = Eclipse PTP

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.remote.core.remoteServices">
<connectionTypeService
connectionTypeId="org.eclipse.remote.serial.core.connectionType"
factory="org.eclipse.remote.serial.internal.ui.SerialPortConnectionsUI$Factory"
service="org.eclipse.remote.ui.IRemoteUIConnectionService">
</connectionTypeService>
</extension>
</plugin>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.remote</groupId>
<artifactId>remote-parent</artifactId>
<version>1.1.1-SNAPSHOT</version>
<relativePath>../../releng/org.eclipse.remote.build/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.remote.serial.ui</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -0,0 +1,69 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.internal.ui;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.remote.serial.ui"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
public static void log(IStatus status) {
plugin.getLog().log(status);
}
public static void log(Exception e) {
if (e instanceof CoreException) {
log(((CoreException) e).getStatus());
} else {
log(new Status(IStatus.ERROR, PLUGIN_ID, e.getLocalizedMessage(), e));
}
}
public static <T> T getService(Class<T> service) {
BundleContext context = plugin.getBundle().getBundleContext();
ServiceReference<T> ref = context.getServiceReference(service);
return ref != null ? context.getService(ref) : null;
}
}

View file

@ -0,0 +1,33 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.internal.ui;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.remote.serial.internal.ui.messages"; //$NON-NLS-1$
public static String NewSerialPortConnectionWizardPage_BaudRateLabel;
public static String NewSerialPortConnectionWizardPage_ByteSizeLabel;
public static String NewSerialPortConnectionWizardPage_Description;
public static String NewSerialPortConnectionWizardPage_NameLabel;
public static String NewSerialPortConnectionWizardPage_ParityLabel;
public static String NewSerialPortConnectionWizardPage_PortLabel;
public static String NewSerialPortConnectionWizardPage_StopBitsLabel;
public static String NewSerialPortConnectionWizardPage_Title;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -0,0 +1,96 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.internal.ui;
import java.util.Set;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.IRemoteConnectionWorkingCopy;
import org.eclipse.remote.core.exception.RemoteConnectionException;
import org.eclipse.remote.serial.core.ISerialPortService;
import org.eclipse.remote.ui.IRemoteUIConnectionWizard;
import org.eclipse.swt.widgets.Shell;
public class NewSerialPortConnectionWizard extends Wizard implements IRemoteUIConnectionWizard {
private NewSerialPortConnectionWizardPage page;
private IRemoteConnectionWorkingCopy workingCopy;
private Shell shell;
private IRemoteConnectionType connectionType;
public NewSerialPortConnectionWizard(Shell shell, IRemoteConnectionType connectionType) {
this.shell = shell;
this.connectionType = connectionType;
}
@Override
public void addPages() {
page = new NewSerialPortConnectionWizardPage();
addPage(page);
}
@Override
public boolean performFinish() {
if (getConnection() == null) {
return false;
}
workingCopy.setAttribute(ISerialPortService.PORT_NAME_ATTR, page.portName);
workingCopy.setAttribute(ISerialPortService.BAUD_RATE_ATTR, Integer.toString(page.baudRateIndex));
workingCopy.setAttribute(ISerialPortService.BYTE_SIZE_ATTR, Integer.toString(page.byteSizeIndex));
workingCopy.setAttribute(ISerialPortService.PARITY_ATTR, Integer.toString(page.parityIndex));
workingCopy.setAttribute(ISerialPortService.STOP_BITS_ATTR, Integer.toString(page.stopBitsIndex));
return true;
}
@Override
public IRemoteConnectionWorkingCopy open() {
WizardDialog dialog = new WizardDialog(shell, this);
dialog.setBlockOnOpen(true);
if (dialog.open() == WizardDialog.OK) {
return getConnection();
}
return null;
}
@Override
public IRemoteConnectionWorkingCopy getConnection() {
if (workingCopy == null) {
try {
workingCopy = connectionType.newConnection(page.name);
} catch (RemoteConnectionException e) {
Activator.log(e.getStatus());
}
}
return workingCopy;
}
@Override
public void setConnection(IRemoteConnectionWorkingCopy connection) {
workingCopy = connection;
}
@Override
public void setConnectionName(String name) {
// TODO Auto-generated method stub
}
@Override
public void setInvalidConnectionNames(Set<String> names) {
// TODO Auto-generated method stub
}
}

View file

@ -0,0 +1,183 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.internal.ui;
import java.io.IOException;
import org.eclipse.cdt.serial.BaudRate;
import org.eclipse.cdt.serial.ByteSize;
import org.eclipse.cdt.serial.Parity;
import org.eclipse.cdt.serial.SerialPort;
import org.eclipse.cdt.serial.StopBits;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public class NewSerialPortConnectionWizardPage extends WizardPage {
String name;
String portName;
int baudRateIndex;
int byteSizeIndex;
int parityIndex;
int stopBitsIndex;
private String[] portNames;
private Text nameText;
private Combo portCombo;
private Combo baudRateCombo;
private Combo byteSizeCombo;
private Combo parityCombo;
private Combo stopBitsCombo;
protected NewSerialPortConnectionWizardPage() {
super(NewSerialPortConnectionWizardPage.class.getName());
setDescription(Messages.NewSerialPortConnectionWizardPage_Description);
setTitle(Messages.NewSerialPortConnectionWizardPage_Title);
}
@Override
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(2, false));
Label nameLabel = new Label(comp, SWT.NONE);
nameLabel.setText(Messages.NewSerialPortConnectionWizardPage_NameLabel);
nameText = new Text(comp, SWT.BORDER | SWT.SINGLE);
nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
nameText.setText(""); //$NON-NLS-1$
nameText.addKeyListener(new KeyListener() {
@Override
public void keyReleased(KeyEvent e) {
updateStatus();
}
@Override
public void keyPressed(KeyEvent e) {
}
});
Label portLabel = new Label(comp, SWT.NONE);
portLabel.setText(Messages.NewSerialPortConnectionWizardPage_PortLabel);
portCombo = new Combo(comp, SWT.READ_ONLY);
portCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
try {
portNames = SerialPort.list();
} catch (IOException e) {
Activator.log(e);
}
for (String portName : portNames) {
portCombo.add(portName);
}
portCombo.select(0);
portCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateStatus();
}
});
Label baudRateLabel = new Label(comp, SWT.NONE);
baudRateLabel.setText(Messages.NewSerialPortConnectionWizardPage_BaudRateLabel);
baudRateCombo = new Combo(comp, SWT.READ_ONLY);
baudRateCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
for (String baudRateStr : BaudRate.getStrings()) {
baudRateCombo.add(baudRateStr);
}
// TODO remember the last one
baudRateCombo.select(BaudRate.getStringIndex(BaudRate.getDefault()));
baudRateCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateStatus();
}
});
Label byteSizeLabel = new Label(comp, SWT.NONE);
byteSizeLabel.setText(Messages.NewSerialPortConnectionWizardPage_ByteSizeLabel);
byteSizeCombo = new Combo(comp, SWT.READ_ONLY);
byteSizeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
for (String byteSizeStr : ByteSize.getStrings()) {
byteSizeCombo.add(byteSizeStr);
}
byteSizeCombo.select(ByteSize.getStringIndex(ByteSize.getDefault()));
byteSizeCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateStatus();
}
});
Label parityLabel = new Label(comp, SWT.NONE);
parityLabel.setText(Messages.NewSerialPortConnectionWizardPage_ParityLabel);
parityCombo = new Combo(comp, SWT.READ_ONLY);
parityCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
for (String parityStr : Parity.getStrings()) {
parityCombo.add(parityStr);
}
parityCombo.select(Parity.getStringIndex(Parity.getDefault()));
parityCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateStatus();
}
});
Label stopBitsLabel = new Label(comp, SWT.NONE);
stopBitsLabel.setText(Messages.NewSerialPortConnectionWizardPage_StopBitsLabel);
stopBitsCombo = new Combo(comp, SWT.READ_ONLY);
stopBitsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
for (String stopBitsStr : StopBits.getStrings()) {
stopBitsCombo.add(stopBitsStr);
}
stopBitsCombo.select(StopBits.getStringIndex(StopBits.getDefault()));
stopBitsCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
updateStatus();
}
});
setControl(comp);
updateStatus();
}
private void updateStatus() {
name = nameText.getText();
int portIndex = portCombo.getSelectionIndex();
portName = portIndex < 0 ? null : portNames[portIndex];
baudRateIndex = baudRateCombo.getSelectionIndex();
byteSizeIndex = byteSizeCombo.getSelectionIndex();
parityIndex = parityCombo.getSelectionIndex();
stopBitsIndex = stopBitsCombo.getSelectionIndex();
setPageComplete(!name.isEmpty() && portName != null);
}
}

View file

@ -0,0 +1,73 @@
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial contribution
*******************************************************************************/
package org.eclipse.remote.serial.internal.ui;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.IRemoteConnectionType.Service;
import org.eclipse.remote.core.exception.RemoteConnectionException;
import org.eclipse.remote.ui.IRemoteUIConnectionService;
import org.eclipse.remote.ui.IRemoteUIConnectionWizard;
import org.eclipse.swt.widgets.Shell;
public class SerialPortConnectionsUI implements IRemoteUIConnectionService {
private final IRemoteConnectionType connectionType;
private SerialPortConnectionsUI(IRemoteConnectionType connectionType) {
this.connectionType = connectionType;
}
public static class Factory implements IRemoteConnectionType.Service.Factory {
@SuppressWarnings("unchecked")
@Override
public <T extends Service> T getService(IRemoteConnectionType connectionType, Class<T> service) {
if (IRemoteUIConnectionService.class.equals(service)) {
return (T) new SerialPortConnectionsUI(connectionType);
}
return null;
}
}
@Override
public IRemoteConnectionType getConnectionType() {
return connectionType;
}
@Override
public IRemoteUIConnectionWizard getConnectionWizard(Shell shell) {
return new NewSerialPortConnectionWizard(shell, connectionType);
}
@Override
public void openConnectionWithProgress(Shell shell, IRunnableContext context, final IRemoteConnection connection) {
try {
context.run(false, true, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
connection.open(monitor);
} catch (RemoteConnectionException e) {
Activator.log(e.getStatus());
}
}
});
} catch (InvocationTargetException | InterruptedException e) {
Activator.log(e);
}
}
}

View file

@ -0,0 +1,18 @@
################################################################################
# Copyright (c) 2015 QNX Software Systems, and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# QNX Software Systems - initial contribution
################################################################################
NewSerialPortConnectionWizardPage_BaudRateLabel=Baud rate:
NewSerialPortConnectionWizardPage_ByteSizeLabel=Data size:
NewSerialPortConnectionWizardPage_Description=New serial port connection settings
NewSerialPortConnectionWizardPage_NameLabel=Connection name:
NewSerialPortConnectionWizardPage_ParityLabel=Parity:
NewSerialPortConnectionWizardPage_PortLabel=Serial port:
NewSerialPortConnectionWizardPage_StopBitsLabel=Stop bits:
NewSerialPortConnectionWizardPage_Title=New Serial Port Connection

View file

@ -96,8 +96,7 @@ public class RemoteConnectionManager extends Job {
*/
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(TerminalViewPlugin.getUniqueIdentifier());
String terminalShellCommand = prefs.get(IRemoteTerminalConstants.PREF_TERMINAL_SHELL_COMMAND, ""); //$NON-NLS-1$
if (!("".equals(terminalShellCommand)) //$NON-NLS-1$
&& remoteConnection.hasService(IRemoteCommandShellService.class)) {
if (remoteConnection.hasService(IRemoteCommandShellService.class)) {
IRemoteCommandShellService cmdShellSvc = remoteConnection.getService(IRemoteCommandShellService.class);
remoteProcess = cmdShellSvc.getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY);
} else {
@ -153,10 +152,10 @@ public class RemoteConnectionManager extends Job {
byte[] buf = new byte[32 * 1024];
while (getState() == Job.RUNNING) {
int n = in.read(buf, 0, buf.length);
if (n <= 0) {
if (n < 0) {
break;
}
if (parser == null || parser.parse(buf)) {
if (n > 0 && (parser == null || parser.parse(buf))) {
control.getRemoteToTerminalOutputStream().write(buf, 0, n);
}
}

View file

@ -7,6 +7,13 @@
*******************************************************************************/
package org.eclipse.remote.internal.terminal.settings;
import java.util.List;
import org.eclipse.remote.core.IRemoteCommandShellService;
import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.IRemoteProcessService;
import org.eclipse.remote.core.IRemoteServicesManager;
import org.eclipse.remote.internal.ui.RemoteUIPlugin;
import org.eclipse.remote.ui.widgets.RemoteConnectionWidget;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@ -60,7 +67,12 @@ public class RemoteSettingsPage extends AbstractSettingsPage {
composite.setLayout(gridLayout);
composite.setLayoutData(gridData);
fRemoteConnectionWidget = new RemoteConnectionWidget(composite, SWT.NONE, null, 0);
IRemoteServicesManager manager = RemoteUIPlugin.getService(IRemoteServicesManager.class);
// TODO remove the remote process service once we get command shell available with ssh and local
@SuppressWarnings("unchecked")
List<IRemoteConnectionType> connTypes = manager.getConnectionTypesSupporting(IRemoteCommandShellService.class, IRemoteProcessService.class);
fRemoteConnectionWidget = new RemoteConnectionWidget(composite, SWT.NONE, null, 0, connTypes);
loadSettings();
}
}

View file

@ -158,7 +158,7 @@ public class RemoteConnectionWidget extends Composite {
* a combination of flags that modify the behavior of the widget.
*/
public RemoteConnectionWidget(Composite parent, int style, String title, int flags) {
this(parent, style, title, flags, null);
this(parent, style, title, flags, null, null);
}
/**
@ -174,10 +174,58 @@ public class RemoteConnectionWidget extends Composite {
* a combination of flags that modify the behavior of the widget.
* @param context
* runnable context, or null
* @param connnectionTypes
* list of connection types to select from
* @since 2.0
*/
public RemoteConnectionWidget(Composite parent, int style, String title, int flags, IRunnableContext context) {
this(parent, style, title, flags, context, null);
}
/**
* Constructor
*
* @param parent
* parent composite
* @param style
* style or SWT.NONE
* @param title
* if a title is supplied then the widget will be placed in a group. Can be null.
* @param flags
* a combination of flags that modify the behavior of the widget.
* @param connnectionTypes
* list of connection types to select from
* @since 2.0
*/
public RemoteConnectionWidget(Composite parent, int style, String title, int flags, List<IRemoteConnectionType> connectionTypes) {
this(parent, style, title, flags, null, connectionTypes);
}
/**
* Constructor
*
* @param parent
* parent composite
* @param style
* style or SWT.NONE
* @param title
* if a title is supplied then the widget will be placed in a group. Can be null.
* @param flags
* a combination of flags that modify the behavior of the widget.
* @param context
* runnable context, or null
* @param connnectionTypes
* list of connection types to select from
* @since 2.0
*/
public RemoteConnectionWidget(Composite parent, int style, String title, int flags, IRunnableContext context, List<IRemoteConnectionType> connectionTypes) {
super(parent, style);
if (connectionTypes != null) {
// Just present the connections that are provided
flags |= FLAG_FORCE_CONNECTION_TYPE_SELECTION | FLAG_NO_LOCAL_SELECTION;
}
Composite body = this;
GridLayout layout = new GridLayout(1, false);
@ -200,9 +248,16 @@ public class RemoteConnectionWidget extends Composite {
body = group;
}
String id = Preferences.getString(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID);
if (id != null) {
fDefaultConnectionType = fRemoteServicesManager.getConnectionType(id);
fRemoteServicesManager = RemoteUIPlugin.getService(IRemoteServicesManager.class);
if (connectionTypes != null) {
// No default if the list of connection types was supplied
fConnectionTypes = connectionTypes;
} else {
fConnectionTypes = fRemoteServicesManager.getRemoteConnectionTypes();
String id = Preferences.getString(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID);
if (id != null) {
fDefaultConnectionType = fRemoteServicesManager.getConnectionType(id);
}
}
/*
@ -250,9 +305,6 @@ public class RemoteConnectionWidget extends Composite {
fNewConnectionButton.setLayoutData(new GridData());
fNewConnectionButton.addSelectionListener(fWidgetListener);
fRemoteServicesManager = RemoteUIPlugin.getService(IRemoteServicesManager.class);
fConnectionTypes = fRemoteServicesManager.getRemoteConnectionTypes();
if (fConnectionTypeCombo != null) {
initializeConnectionTypeCombo();
}
@ -319,9 +371,11 @@ public class RemoteConnectionWidget extends Composite {
if (fDefaultConnectionType != null) {
return fDefaultConnectionType;
}
int selectionIndex = fConnectionTypeCombo.getSelectionIndex();
if (fConnectionTypes.size() > 0 && selectionIndex > 0) {
return fConnectionTypes.get(selectionIndex - 1);
if (fConnectionTypeCombo != null) {
int selectionIndex = fConnectionTypeCombo.getSelectionIndex();
if (fConnectionTypes.size() > 0 && selectionIndex > 0) {
return fConnectionTypes.get(selectionIndex - 1);
}
}
return null;
}

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.remote.serial-feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,4 @@
bin.includes = feature.xml,\
feature.properties,\
epl-v10.html,\
eclipse_update_120.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -0,0 +1,328 @@
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List
href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
<title>Eclipse Public License - Version 1.0</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Revision>2</o:Revision>
<o:TotalTime>3</o:TotalTime>
<o:Created>2004-03-05T23:03:00Z</o:Created>
<o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
<o:Pages>4</o:Pages>
<o:Words>1626</o:Words>
<o:Characters>9270</o:Characters>
<o:Lines>77</o:Lines>
<o:Paragraphs>18</o:Paragraphs>
<o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
<o:Version>9.4402</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:TrackRevisions/>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:553679495 -2147483648 8 0 66047 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p
{margin-right:0in;
mso-margin-top-alt:auto;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.BalloonText, li.BalloonText, div.BalloonText
{mso-style-name:"Balloon Text";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:8.0pt;
font-family:Tahoma;
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
</p>
<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
OF THIS AGREEMENT.</span> </p>
<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
in the case of the initial Contributor, the initial code and documentation
distributed under this Agreement, and<br clear=left>
b) in the case of each subsequent Contributor:</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
changes to the Program, and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
additions to the Program;</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
such changes and/or additions to the Program originate from and are distributed
by that particular Contributor. A Contribution 'originates' from a Contributor
if it was added to the Program by such Contributor itself or anyone acting on
such Contributor's behalf. Contributions do not include additions to the
Program which: (i) are separate modules of software distributed in conjunction
with the Program under their own license agreement, and (ii) are not derivative
works of the Program. </span></p>
<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
entity that distributes the Program.</span> </p>
<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
claims licensable by a Contributor which are necessarily infringed by the use
or sale of its Contribution alone or when combined with the Program. </span></p>
<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
distributed in accordance with this Agreement.</span> </p>
<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
receives the Program under this Agreement, including all Contributors.</span> </p>
<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
Subject to the terms of this Agreement, each Contributor hereby grants Recipient
a non-exclusive, worldwide, royalty-free copyright license to<span
style='color:red'> </span>reproduce, prepare derivative works of, publicly
display, publicly perform, distribute and sublicense the Contribution of such
Contributor, if any, and such derivative works, in source code and object code
form.</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
patent license under Licensed Patents to make, use, sell, offer to sell, import
and otherwise transfer the Contribution of such Contributor, if any, in source
code and object code form. This patent license shall apply to the combination
of the Contribution and the Program if, at the time the Contribution is added
by the Contributor, such addition of the Contribution causes such combination
to be covered by the Licensed Patents. The patent license shall not apply to
any other combinations which include the Contribution. No hardware per se is
licensed hereunder. </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
Recipient understands that although each Contributor grants the licenses to its
Contributions set forth herein, no assurances are provided by any Contributor
that the Program does not infringe the patent or other intellectual property
rights of any other entity. Each Contributor disclaims any liability to Recipient
for claims brought by any other entity based on infringement of intellectual
property rights or otherwise. As a condition to exercising the rights and
licenses granted hereunder, each Recipient hereby assumes sole responsibility
to secure any other intellectual property rights needed, if any. For example,
if a third party patent license is required to allow Recipient to distribute
the Program, it is Recipient's responsibility to acquire that license before
distributing the Program.</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
Each Contributor represents that to its knowledge it has sufficient copyright
rights in its Contribution, if any, to grant the copyright license set forth in
this Agreement. </span></p>
<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
Program in object code form under its own license agreement, provided that:</span>
</p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
it complies with the terms and conditions of this Agreement; and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
its license agreement:</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
effectively disclaims on behalf of all Contributors all warranties and
conditions, express and implied, including warranties or conditions of title
and non-infringement, and implied warranties or conditions of merchantability
and fitness for a particular purpose; </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
effectively excludes on behalf of all Contributors all liability for damages,
including direct, indirect, special, incidental and consequential damages, such
as lost profits; </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
states that any provisions which differ from this Agreement are offered by that
Contributor alone and not by any other party; and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
states that source code for the Program is available from such Contributor, and
informs licensees how to obtain it in a reasonable manner on or through a
medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
<p><span style='font-size:10.0pt'>When the Program is made available in source
code form:</span> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
it must be made available under this Agreement; and </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
copy of this Agreement must be included with each copy of the Program. </span></p>
<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
copyright notices contained within the Program. </span></p>
<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
originator of its Contribution, if any, in a manner that reasonably allows
subsequent Recipients to identify the originator of the Contribution. </span></p>
<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
<p><span style='font-size:10.0pt'>Commercial distributors of software may
accept certain responsibilities with respect to end users, business partners
and the like. While this license is intended to facilitate the commercial use
of the Program, the Contributor who includes the Program in a commercial
product offering should do so in a manner which does not create potential
liability for other Contributors. Therefore, if a Contributor includes the
Program in a commercial product offering, such Contributor (&quot;Commercial
Contributor&quot;) hereby agrees to defend and indemnify every other
Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
legal actions brought by a third party against the Indemnified Contributor to
the extent caused by the acts or omissions of such Commercial Contributor in
connection with its distribution of the Program in a commercial product
offering. The obligations in this section do not apply to any claims or Losses
relating to any actual or alleged intellectual property infringement. In order
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
Contributor in writing of such claim, and b) allow the Commercial Contributor
to control, and cooperate with the Commercial Contributor in, the defense and
any related settlement negotiations. The Indemnified Contributor may participate
in any such claim at its own expense.</span> </p>
<p><span style='font-size:10.0pt'>For example, a Contributor might include the
Program in a commercial product offering, Product X. That Contributor is then a
Commercial Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance claims and
warranties are such Commercial Contributor's responsibility alone. Under this
section, the Commercial Contributor would have to defend claims against the
other Contributors related to those performance claims and warranties, and if a
court requires any other Contributor to pay any damages as a result, the
Commercial Contributor must pay those damages.</span> </p>
<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
responsible for determining the appropriateness of using and distributing the
Program and assumes all risks associated with its exercise of rights under this
Agreement , including but not limited to the risks and costs of program errors,
compliance with applicable laws, damage to or loss of data, programs or
equipment, and unavailability or interruption of operations. </span></p>
<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
or unenforceable under applicable law, it shall not affect the validity or
enforceability of the remainder of the terms of this Agreement, and without
further action by the parties hereto, such provision shall be reformed to the
minimum extent necessary to make such provision valid and enforceable.</span> </p>
<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
against any entity (including a cross-claim or counterclaim in a lawsuit)
alleging that the Program itself (excluding combinations of the Program with
other software or hardware) infringes such Recipient's patent(s), then such
Recipient's rights granted under Section 2(b) shall terminate as of the date
such litigation is filed. </span></p>
<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
shall terminate if it fails to comply with any of the material terms or
conditions of this Agreement and does not cure such failure in a reasonable
period of time after becoming aware of such noncompliance. If all Recipient's
rights under this Agreement terminate, Recipient agrees to cease use and
distribution of the Program as soon as reasonably practicable. However,
Recipient's obligations under this Agreement and any licenses granted by
Recipient relating to the Program shall continue and survive. </span></p>
<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
copies of this Agreement, but in order to avoid inconsistency the Agreement is
copyrighted and may only be modified in the following manner. The Agreement
Steward reserves the right to publish new versions (including revisions) of
this Agreement from time to time. No one other than the Agreement Steward has
the right to modify this Agreement. The Eclipse Foundation is the initial
Agreement Steward. The Eclipse Foundation may assign the responsibility to
serve as the Agreement Steward to a suitable separate entity. Each new version
of the Agreement will be given a distinguishing version number. The Program
(including Contributions) may always be distributed subject to the version of
the Agreement under which it was received. In addition, after a new version of
the Agreement is published, Contributor may elect to distribute the Program
(including its Contributions) under the new version. Except as expressly stated
in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
the intellectual property of any Contributor under this Agreement, whether
expressly, by implication, estoppel or otherwise. All rights in the Program not
expressly granted under this Agreement are reserved.</span> </p>
<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
State of New York and the intellectual property laws of the United States of
America. No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose. Each party waives
its rights to a jury trial in any resulting litigation.</span> </p>
<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
</div>
</body>
</html>

View file

@ -0,0 +1,24 @@
#################################################################################
# Copyright (c) 2015 QNX Software Systems Corporation.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#################################################################################
# "featureName" property - name of the feature
featureName=Serial Port Remote Services
# "providerName" property - name of the company that provides the feature
providerName=Eclipse PTP
# "description" property - description of the feature
description=Provides serial port services for the remote framework
# copyright
copyright=\
Copyright (c) 2015 QNX Software Corporation.\n\
All rights reserved. This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License v1.0\n\
which accompanies this distribution, and is available at\n\
http://www.eclipse.org/legal/epl-v10.html\n

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.eclipse.remote.serial"
label="%featureName"
version="1.0.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
<description>
%description
</description>
<copyright>
%copyright
</copyright>
<license url="%licenseURL">
%license
</license>
<plugin
id="org.eclipse.remote.serial.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.remote.serial.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.remote</groupId>
<artifactId>remote-parent</artifactId>
<version>1.1.1-SNAPSHOT</version>
<relativePath>../../releng/org.eclipse.remote.build/pom.xml</relativePath>
</parent>
<groupId>org.eclipse.remote.features</groupId>
<artifactId>org.eclipse.remote.serial</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-source-feature-plugin</artifactId>
<executions>
<execution>
<id>source-feature</id>
<phase>package</phase>
<goals>
<goal>source-feature</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>attached-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View file

@ -11,5 +11,10 @@
<unit id="org.hamcrest" version="0.0.0"/>
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150124073747/repository/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.cdt.native.serial" version="0.0.0"/>
<repository location="http://download.eclipse.org/tools/cdt/builds/master/nightly/"/>
</location>
</location>
</locations>
</target>

View file

@ -21,9 +21,10 @@
<tycho-extras-version>${tycho-version}</tycho-extras-version>
<tycho.scmUrl>scm:git:git://git.eclipse.org/gitroot/ptp/org.eclipse.remote.git</tycho.scmUrl>
<platform-version>4.5milestones</platform-version>
<platform-site>http://download.eclipse.org/eclipse/updates/${platform-version}</platform-site>
<license-site>http://download.eclipse.org/cbi/updates/license</license-site>
<tm-site>http://download.eclipse.org/tm/updates/4.0milestones</tm-site>
<platform-site>http://download.eclipse.org/eclipse/updates/${platform-version}/</platform-site>
<license-site>http://download.eclipse.org/cbi/updates/license/</license-site>
<tm-site>http://download.eclipse.org/tm/updates/4.0milestones/</tm-site>
<cdt-site>http://download.eclipse.org/tools/cdt/builds/master/nightly/</cdt-site>
<remote-install-dir>/home/data/httpd/download.eclipse.org/tools/ptp/builds/remote/${remote-release}</remote-install-dir>
</properties>
@ -52,6 +53,10 @@
<!-- Remote Terminal feature -->
<module>../../bundles/org.eclipse.remote.terminal</module>
<module>../../features/org.eclipse.remote.terminal-feature</module>
<!-- Serial Port feature -->
<module>../../bundles/org.eclipse.remote.serial.core</module>
<module>../../bundles/org.eclipse.remote.serial.ui</module>
<module>../../features/org.eclipse.remote.serial-feature</module>
</modules>
<repositories>
@ -70,6 +75,11 @@
<url>${tm-site}</url>
<layout>p2</layout>
</repository>
<repository>
<id>cdt</id>
<url>${cdt-site}</url>
<layout>p2</layout>
</repository>
</repositories>
<pluginRepositories>