strs = new ArrayList<>();
+ for (String s : av)
+ {
+ strs.add(0, s);
+ }
+ for (String s : strs)
+ {
+ available.add(s);
+ }
+ }
+ catch (UnsatisfiedLinkError e)
+ {
+ e.printStackTrace();
+ throw new NativeResourceException(e.getMessage());
+ }
+
+ return available;
+ }
+
+
+ public boolean isConnected()
+ {
+ return connected;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public J setConnected(boolean connected)
+ {
+ if (this.connected == connected)
+ {
+ return (J)this;
+ }
+ this.connected = connected;
+ return (J)this;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public J setBaud(int baud)
+ {
+
+ this.baud = baud;
+ return (J)this;
+
+ }
+
+
+ public int getBaud()
+ {
+ return baud;
+ }
+
+ /**
+ * Enables RS485 half-duplex bus communication for Linux. The Linux kernel uses the RTS pin as bus enable. If you use a device that is configured via the Linux
+ * device tree, take care to add "uart-has-rtscts" and to configure the RTS GPIO correctly.
+ *
+ * Before enabling RS485, the serial port must be connected/opened.
+ *
+ * See also:
+ *
+ * - https://www.kernel.org/doc/Documentation/serial/serial-rs485.txt
+ *
- https://www.kernel.org/doc/Documentation/devicetree/bindings/serial/serial.txt
+ *
+ *
+ * @param busEnableActiveLow true, if the bus enable signal (RTS) shall be low during transmission
+ * @param delayBusEnableBeforeSendMs delay of bus enable signal (RTS) edge to first data edge in ms (not supported by all serial drivers)
+ * @param delayBusEnableAfterSendMs delay of bus enable signal (RTS) edge after end of transmission in ms (not supported by all serial drivers)
+ * @return the ioctl() return value
+ */
+ public int enableRs485(boolean busEnableActiveLow, int delayBusEnableBeforeSendMs, int delayBusEnableAfterSendMs)
+ {
+ if (serial == null)
+ {
+ return -1;
+ }
+
+ return serial.enableRs485(busEnableActiveLow, delayBusEnableBeforeSendMs, delayBusEnableAfterSendMs);
+ }
+
+ public void notifyOnDataAvailable(boolean b)
+ {
+ serial.notifyOnDataAvailable(b);
+ }
+
+
+ public void addEventListener(SerialPortEventListener lsnr) throws TooManyListenersException
+ {
+ serial.addEventListener(lsnr);
+ }
+
+
+ public void removeEventListener()
+ {
+ serial.removeEventListener();
+ }
+
+ /**
+ * Gets the {@link SerialPort} instance.
+ * This will return null until {@link #connect()} is successfully called.
+ *
+ * @return The {@link SerialPort} instance or null.
+ */
+ @JsonIgnore
+ public RXTXPort getSerialPortInstance()
+ {
+ return serial;
+ }
+
+}
diff --git a/JNI/nrjavaserial/src/main/java/gnu/io/NRSerialPortException.java b/JNI/nrjavaserial/src/main/java/gnu/io/NRSerialPortException.java
new file mode 100644
index 00000000..be815364
--- /dev/null
+++ b/JNI/nrjavaserial/src/main/java/gnu/io/NRSerialPortException.java
@@ -0,0 +1,28 @@
+package gnu.io;
+
+public class NRSerialPortException extends RuntimeException
+{
+ public NRSerialPortException()
+ {
+ }
+
+ public NRSerialPortException(String message)
+ {
+ super(message);
+ }
+
+ public NRSerialPortException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public NRSerialPortException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public NRSerialPortException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
+ {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+}
diff --git a/jfreechart/src/jre8/resources/META-INF/.gitkeep b/JNI/nrjavaserial/src/main/resources/.gitkeep
similarity index 100%
rename from jfreechart/src/jre8/resources/META-INF/.gitkeep
rename to JNI/nrjavaserial/src/main/resources/.gitkeep
diff --git a/jfreechart/src/main/resources/.gitkeep b/JNI/nrjavaserial/src/main/resources/META-INF/.gitkeep
similarity index 100%
rename from jfreechart/src/main/resources/.gitkeep
rename to JNI/nrjavaserial/src/main/resources/META-INF/.gitkeep
diff --git a/jfreechart/src/jre8/resources/META-INF/services/com.guicedee.guicedinjection.interfaces.IGuiceModule b/JNI/nrjavaserial/src/main/resources/META-INF/services/com.guicedee.guicedinjection.interfaces.IGuiceModule
similarity index 100%
rename from jfreechart/src/jre8/resources/META-INF/services/com.guicedee.guicedinjection.interfaces.IGuiceModule
rename to JNI/nrjavaserial/src/main/resources/META-INF/services/com.guicedee.guicedinjection.interfaces.IGuiceModule
diff --git a/JNI/nrjavaserial/src/moditect/module-info.java b/JNI/nrjavaserial/src/moditect/module-info.java
new file mode 100644
index 00000000..cdadb624
--- /dev/null
+++ b/JNI/nrjavaserial/src/moditect/module-info.java
@@ -0,0 +1,11 @@
+module com.neuronrobotics.nrjavaserial {
+ exports gnu.io;
+
+ requires com.fasterxml.jackson.core;
+ requires com.fasterxml.jackson.annotation;
+
+ requires com.sun.jna;
+
+ opens gnu.io to com.google.guice, com.fasterxml.jackson.databind;
+}
+
diff --git a/typescript4j/src/test/java/.gitignore b/JNI/nrjavaserial/src/test/java/.gitignore
similarity index 100%
rename from typescript4j/src/test/java/.gitignore
rename to JNI/nrjavaserial/src/test/java/.gitignore
diff --git a/typescript4j/src/test/resources/.gitignore b/JNI/nrjavaserial/src/test/resources/.gitignore
similarity index 100%
rename from typescript4j/src/test/resources/.gitignore
rename to JNI/nrjavaserial/src/test/resources/.gitignore
diff --git a/typescript4j/src/test/resources/META-INF/.gitignore b/JNI/nrjavaserial/src/test/resources/META-INF/.gitignore
similarity index 100%
rename from typescript4j/src/test/resources/META-INF/.gitignore
rename to JNI/nrjavaserial/src/test/resources/META-INF/.gitignore
diff --git a/jfreechart/src/main/resources/META-INF/services/com.guicedee.guicedinjection.interfaces.IGuiceModule b/JNI/nrjavaserial/src/test/resources/META-INF/services/com.guicedee.guicedinjection.interfaces.IGuiceModule
similarity index 100%
rename from jfreechart/src/main/resources/META-INF/services/com.guicedee.guicedinjection.interfaces.IGuiceModule
rename to JNI/nrjavaserial/src/test/resources/META-INF/services/com.guicedee.guicedinjection.interfaces.IGuiceModule
diff --git a/typescript4j/src/test/resources/META-INF/services/za.co.bayport.jpms.access.client.services.IUserLinkProvider b/JNI/nrjavaserial/src/test/resources/META-INF/services/za.co.bayport.jpms.access.client.services.IUserLinkProvider
similarity index 100%
rename from typescript4j/src/test/resources/META-INF/services/za.co.bayport.jpms.access.client.services.IUserLinkProvider
rename to JNI/nrjavaserial/src/test/resources/META-INF/services/za.co.bayport.jpms.access.client.services.IUserLinkProvider
diff --git a/typescript4j/src/test/resources/META-INF/services/za.co.bayport.jpms.configuration.services.IConfigService b/JNI/nrjavaserial/src/test/resources/META-INF/services/za.co.bayport.jpms.configuration.services.IConfigService
similarity index 100%
rename from typescript4j/src/test/resources/META-INF/services/za.co.bayport.jpms.configuration.services.IConfigService
rename to JNI/nrjavaserial/src/test/resources/META-INF/services/za.co.bayport.jpms.configuration.services.IConfigService
diff --git a/jfreechart/src/main/resources/META-INF/.gitkeep b/JNI/nrjavaserial/src/test/webapp/.gitkeep
similarity index 100%
rename from jfreechart/src/main/resources/META-INF/.gitkeep
rename to JNI/nrjavaserial/src/test/webapp/.gitkeep