Skip to main content
summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorDoug Schaefer2015-02-16 12:19:18 -0500
committerGerrit Code Review @ Eclipse.org2015-02-16 13:19:54 -0500
commit275feb68745a7eaf27d4010d4875abdd158cbc33 (patch)
tree53a50522fdb491eea480d89650eefcae19f59056 /remote
parent52c80c124ee2f4edccf292c472886d9cde8d6143 (diff)
downloadorg.eclipse.cdt-275feb68745a7eaf27d4010d4875abdd158cbc33.tar.gz
org.eclipse.cdt-275feb68745a7eaf27d4010d4875abdd158cbc33.tar.xz
org.eclipse.cdt-275feb68745a7eaf27d4010d4875abdd158cbc33.zip
Bug 459971 New SerialPort support. First step is Mac library.
Java classes are defined and a pretty simple native library for Mac is there. Tested with Arduino so I know reading works. This implementation should work for Linux as well. Windows is going to be the hard one. Not checking in the binaries yet until I get more testing with them. Also remove ppc native libraries for Mac since that hasn't been supported in a long time. Change-Id: If4ffbc6e73a7656a47c2f45b875be0842c482b05
Diffstat (limited to 'remote')
-rw-r--r--remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/internal/core/Activator.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/internal/core/Activator.java b/remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/internal/core/Activator.java
index 26ed502c91..f3126d139c 100644
--- a/remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/internal/core/Activator.java
+++ b/remote/org.eclipse.cdt.remote.core/src/org/eclipse/cdt/remote/internal/core/Activator.java
@@ -12,6 +12,7 @@ package org.eclipse.cdt.remote.internal.core;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
public class Activator implements BundleActivator {
@@ -41,4 +42,15 @@ public class Activator implements BundleActivator {
Activator.context = null;
}
+ /**
+ * Return the OSGi service with the given service interface.
+ *
+ * @param service service interface
+ * @return the specified service or null if it's not registered
+ */
+ public static <T> T getService(Class<T> service) {
+ ServiceReference<T> ref = context.getServiceReference(service);
+ return ref != null ? context.getService(ref) : null;
+ }
+
}

Back to the top