bundleNativeLibs = []
52 | def String bundleNativeCode
53 |
54 | doLast {
55 | libs.each {
56 | if ( it.getName().endsWith('.dll') ) bundleNativeLibs.add('libs/'+it.getName()+';osname=Win32;processor=x86')
57 | if ( it.getName().endsWith('.so') ) bundleNativeLibs.add('libs/'+it.getName()+';osname=Linux;processor=x86-64')
58 | if ( it.getName().endsWith('.jnilib') ) bundleNativeLibs.add('libs/'+it.getName()+';osname=MacOSX;processor=x86-64')
59 | }
60 |
61 | bundleNativeCode = bundleNativeLibs.join(',')
62 | if(bundleNativeCode.length() > 0) {
63 | jar {
64 | manifest {
65 | attributes('Bundle-NativeCode': bundleNativeCode)
66 | }
67 | }
68 | }
69 | }
70 | }
71 |
72 | task(buildWithNative) {
73 | dependsOn(copyNativeLibs)
74 | dependsOn(jar)
75 | tasks.findByName("jar").mustRunAfter "copyNativeLibs"
76 | }
77 |
78 | tasks.withType(Test) {
79 | dependsOn copyNativeLibs
80 | mustRunAfter copyNativeLibs
81 | }
82 |
83 | task copyJavadoc(type: Sync, dependsOn: "javadoc") {
84 | from "${project(':jrxtx').docsDir.getAbsolutePath()}/javadoc/"
85 | into "${project.rootDir}/docs/javadoc/"
86 | }
87 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/DataBits.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | import gnu.io.SerialPort;
4 |
5 | /**
6 | * The data bits.
7 | */
8 | @SuppressWarnings("deprecation")
9 | public enum DataBits {
10 | /**
11 | * 5 data bits will be used for each character.
12 | */
13 | DATABITS_5(SerialPort.DATABITS_5),
14 | /**
15 | * 6 data bits will be used for each character.
16 | */
17 | DATABITS_6(SerialPort.DATABITS_6),
18 | /**
19 | * 8 data bits will be used for each character.
20 | */
21 | DATABITS_7(SerialPort.DATABITS_7),
22 | /**
23 | * 8 data bits will be used for each character.
24 | */
25 | DATABITS_8(SerialPort.DATABITS_8),;
26 | private int odlValue;
27 |
28 | private DataBits(int oldValue) {
29 | this.odlValue = oldValue;
30 | }
31 |
32 | int getOldValue() {
33 | return this.odlValue;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/FlowControl.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | /**
4 | * The flow control.
5 | *
6 | * @see SerialPort#setFlowControl(FlowControl)
7 | * @see SerialPortBuilder#setFlowControl(FlowControl)
8 | */
9 | public enum FlowControl {
10 | /**
11 | * No flow control.
12 | */
13 | NONE,
14 |
15 | /**
16 | * Hardware flow control on input and output (RTS/CTS).
17 | *
18 | *
19 | * Sets RFR (ready for receiving) formally known as RTS and the CTS (clear to send) flag.
20 | *
21 | */
22 | RTS_CTS,
23 |
24 | /**
25 | * Software flow control on input and output.
26 | */
27 | XON_XOFF
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/Parity.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | import gnu.io.SerialPort;
4 |
5 | /**
6 | * The parity.
7 | */
8 | @SuppressWarnings("deprecation")
9 | public enum Parity {
10 | /**
11 | * No parity bit will be sent with each data character at all.
12 | */
13 | NONE(SerialPort.PARITY_NONE),
14 | /**
15 | * An odd parity bit will be sent with each data character. I.e. will be set to 1 if the data character contains an
16 | * even number of bits set to 1.
17 | */
18 | ODD(SerialPort.PARITY_ODD),
19 | /**
20 | * An even parity bit will be sent with each data character. I.e. will be set to 1 if the data character contains an
21 | * odd number of bits set to 1.
22 | */
23 | EVEN(SerialPort.PARITY_EVEN),
24 | /**
25 | * A mark parity bit (i.e. always 1) will be sent with each data character.
26 | */
27 | MARK(SerialPort.PARITY_MARK),
28 | /**
29 | * A space parity bit (i.e. always 0) will be sent with each data character
30 | */
31 | SPACE(4),;
32 | private static final Parity[] VALUES = values();
33 | private int odlValue;
34 |
35 | private Parity(int oldValue) {
36 | this.odlValue = oldValue;
37 | }
38 |
39 | int getOldValue() {
40 | return this.odlValue;
41 | }
42 |
43 | static Parity forValue(int parity) {
44 | for (Parity p : VALUES) {
45 | if (p.odlValue == parity) {
46 | return p;
47 | }
48 | }
49 |
50 | // should not occur
51 | throw new RuntimeException("Error.");
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/PortNotFoundException.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | /**
4 | * Signals that the provided serial port name provided via {@link SerialPortBuilder#newBuilder(String)},
5 | * {@link SerialPortBuilder#setPortName(String)} doesn't exist on the host system.
6 | */
7 | public class PortNotFoundException extends SerialPortException {
8 |
9 | private static final long serialVersionUID = 2766015292714524756L;
10 |
11 | /**
12 | * Constructs a new PortNotFoundException with the specified detail message.
13 | *
14 | * @param message
15 | * the detail message.
16 | */
17 | public PortNotFoundException(String message) {
18 | super(message);
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/SerialPort.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | import java.io.Closeable;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 | import java.io.OutputStream;
7 |
8 | /**
9 | * Serial port for communication using UARTs. Can be used for communication protocols such as RS-232 and RS-485.
10 | *
11 | * A SerialPort is created using {@link SerialPortBuilder}. Once closed it cannot be opened again but has to be
12 | * recreated.
13 | */
14 | public interface SerialPort extends Closeable {
15 |
16 | /**
17 | * Returns the input stream for this serial port.
18 | *
19 | * Closing the returned InputStream will close the associated serial port.
20 | *
21 | * @return the InputStream object that can be used to read from the port.
22 | * @throws IOException
23 | * if an I/O error occurred
24 | */
25 | InputStream getInputStream() throws IOException;
26 |
27 | /**
28 | * Returns the output stream for this serial port.
29 | *
30 | * @return the OutputStream object that can be used to write to the port.
31 | * @throws IOException
32 | * if an I/O error occurred.
33 | */
34 | OutputStream getOutputStream() throws IOException;
35 |
36 | /**
37 | * Closes the serial port.
38 | *
39 | * Also closes the associated input and output streams.
40 | *
41 | * @throws IOException
42 | * if an I/O error occurred.
43 | */
44 | void close() throws IOException;
45 |
46 | /**
47 | * Returns whether the serial port is currently open and available for communication.
48 | *
49 | * @return true if the serial port is closed.
50 | */
51 | boolean isClosed();
52 |
53 | /**
54 | * Get the name of the serial port.
55 | *
56 | * @return the serial port name.
57 | */
58 | String getPortName();
59 |
60 | /**
61 | * Get the current data bits config.
62 | *
63 | * @return the dataBits the data bits.
64 | */
65 | DataBits getDataBits();
66 |
67 | /**
68 | * Set the data bits.
69 | *
70 | * @param dataBits
71 | * the new dataBits.
72 | * @throws IOException
73 | * if an I/O exception occurred when setting the new data bits..
74 | */
75 | void setDataBits(DataBits dataBits) throws IOException;
76 |
77 | /**
78 | * Get the parity.
79 | *
80 | * @return the new parity.
81 | */
82 | Parity getParity();
83 |
84 | /**
85 | * Set the new parity.
86 | *
87 | * @param parity
88 | * the new parity.
89 | * @throws IOException
90 | * if an I/O exception occurred when setting the new parity.
91 | */
92 | void setParity(Parity parity) throws IOException;
93 |
94 | /**
95 | * Get the current stop bits settings.
96 | *
97 | * @return the stopBits the stop bits.
98 | */
99 | StopBits getStopBits();
100 |
101 | /**
102 | * Set the stop bits.
103 | *
104 | * @param stopBits
105 | * the stopBits to set
106 | * @throws IOException
107 | * if an I/O exception occurred when setting the new stop bits.
108 | */
109 | void setStopBits(StopBits stopBits) throws IOException;
110 |
111 | /**
112 | * @return the baudRate setting.
113 | *
114 | * @see #setBaudRate(int)
115 | */
116 | int getBaudRate();
117 |
118 | /**
119 | * Sets the baud rate of the system.
120 | *
121 | * @param baudRate
122 | * the new baud rate.
123 | * @throws IOException
124 | * if an I/O exception occurred when setting the new baud rate.
125 | *
126 | * @see #getBaudRate()
127 | */
128 | void setBaudRate(int baudRate) throws IOException;
129 |
130 | /**
131 | * Returns setting for serial port timeout. 0
returns implies that the option is disabled (i.e.,
132 | * timeout of infinity).
133 | *
134 | * @return the serialPortTimeout.
135 | *
136 | * @see #setSerialPortTimeout(int)
137 | */
138 | int getSerialPortTimeout();
139 |
140 | /**
141 | * Enable/disable serial port timeout with the specified timeout, in milliseconds. With this option set to a
142 | * non-zero timeout, a read() call on the InputStream associated with this serial port will block for only this
143 | * amount of time. If the timeout expires, a org.openmuc.jrxtx.SerialPortTimeoutExcepption is raised, though the
144 | * serial port is still valid. The option must be enabled prior to entering the blocking operation to have effect.
145 | * The timeout must be > 0
. A timeout of zero is interpreted as an infinite timeout.
146 | *
147 | * @param serialPortTimeout
148 | * the specified timeout, in milliseconds.
149 | * @throws IOException
150 | * if there is an error in the underlying protocol.
151 | *
152 | * @see #getSerialPortTimeout()
153 | */
154 | void setSerialPortTimeout(int serialPortTimeout) throws IOException;
155 |
156 | /**
157 | * Set the flow control type.
158 | *
159 | * @param flowControl
160 | * the flow control.
161 | * @throws IOException
162 | * if an I/O exception occurred when setting the new baud rate.
163 | */
164 | void setFlowControl(FlowControl flowControl) throws IOException;
165 |
166 | /**
167 | * Get the current flow control settings.
168 | *
169 | * @return the flow control.
170 | */
171 | FlowControl getFlowControl();
172 | }
173 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/SerialPortBuilder.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | import java.io.IOException;
4 | import java.util.ArrayList;
5 | import java.util.Enumeration;
6 | import java.util.List;
7 |
8 | import gnu.io.CommPortIdentifier;
9 |
10 | /**
11 | * Builder class for SerialPorts. Provides a convenient way to set the various fields of a SerialPort.
12 | *
13 | * Example:
14 | *
15 | *
16 | *
17 | * SerialPort port = newBuilder("/dev/ttyS0")
18 | * .setBaudRate(19200)
19 | * .setParity(Parity.EVEN)
20 | * .build();
21 | * InputStream is = port.getInputStream();
22 | * ..
23 | *
24 | *
25 | */
26 | @SuppressWarnings("deprecation")
27 | public class SerialPortBuilder {
28 |
29 | private String portName;
30 | private int baudRate;
31 | private DataBits dataBits;
32 | private Parity parity;
33 | private StopBits stopBits;
34 | private FlowControl flowControl;
35 |
36 | /**
37 | * Get the serial port names on the host system.
38 | *
39 | * @return the serial ports names.
40 | */
41 | public static String[] getSerialPortNames() {
42 | Enumeration identifiers = CommPortIdentifier.getPortIdentifiers();
43 | List result = new ArrayList(20);
44 |
45 | while (identifiers.hasMoreElements()) {
46 | CommPortIdentifier identifier = identifiers.nextElement();
47 | if (identifier.getPortType() != CommPortIdentifier.PORT_SERIAL) {
48 | continue;
49 | }
50 |
51 | result.add(identifier.getName());
52 | }
53 | String[] res = new String[result.size()];
54 | return result.toArray(res);
55 | }
56 |
57 | private SerialPortBuilder(String portName) {
58 | this.portName = portName;
59 | this.baudRate = 9600;
60 | this.dataBits = DataBits.DATABITS_8;
61 | this.parity = Parity.EVEN;
62 | this.stopBits = StopBits.STOPBITS_1;
63 | this.flowControl = FlowControl.NONE;
64 | }
65 |
66 | /**
67 | * Constructs a new SerialPortBuilder with the default values.
68 | *
69 | * @param portName
70 | * the serial port name. E.g. on Unix systems: "/dev/ttyUSB0"
and on Unix
71 | * @return returns the new builder.
72 | */
73 | public static SerialPortBuilder newBuilder(String portName) {
74 | return new SerialPortBuilder(portName);
75 | }
76 |
77 | /**
78 | * Set the serial port name.
79 | *
80 | * @param portName
81 | * the serial port name e.g. "/dev/ttyUSB0"
82 | * @return the serial port builder.
83 | */
84 | public SerialPortBuilder setPortName(String portName) {
85 | this.portName = portName;
86 | return this;
87 | }
88 |
89 | /**
90 | * Set the baud rate for the serial port. Values such as 9600 or 115200.
91 | *
92 | * @param baudRate
93 | * the baud rate.
94 | * @return the serial port builder.
95 | *
96 | * @see SerialPortBuilder#setBaudRate(int)
97 | */
98 | public SerialPortBuilder setBaudRate(int baudRate) {
99 | this.baudRate = baudRate;
100 | return this;
101 | }
102 |
103 | /**
104 | * Set the number of data bits transfered with the serial port.
105 | *
106 | * @param dataBits
107 | * the number of dataBits.
108 | * @return the serial port builder.
109 | * @see SerialPort#setDataBits(DataBits)
110 | */
111 | public SerialPortBuilder setDataBits(DataBits dataBits) {
112 | this.dataBits = dataBits;
113 | return this;
114 | }
115 |
116 | /**
117 | * Set the parity of the serial port.
118 | *
119 | * @param parity
120 | * the parity.
121 | * @return the serial port builder.
122 | * @see SerialPort#setParity(Parity)
123 | */
124 | public SerialPortBuilder setParity(Parity parity) {
125 | this.parity = parity;
126 | return this;
127 | }
128 |
129 | /**
130 | * Set the number of stop bits after each data bits.
131 | *
132 | * @param stopBits
133 | * the number of stop bits.
134 | * @return the serial port builder.
135 | *
136 | * @see SerialPort#setStopBits(StopBits)
137 | */
138 | public SerialPortBuilder setStopBits(StopBits stopBits) {
139 | this.stopBits = stopBits;
140 | return this;
141 | }
142 |
143 | /**
144 | * Set the flow control type.
145 | *
146 | * @param flowControl
147 | * the flow control.
148 | *
149 | * @return the serial port builder.
150 | *
151 | * @see SerialPort#setFlowControl(FlowControl)
152 | */
153 | public SerialPortBuilder setFlowControl(FlowControl flowControl) {
154 | this.flowControl = flowControl;
155 | return this;
156 | }
157 |
158 | /**
159 | * Combine all of the options that have been set and return a new SerialPort object.
160 | *
161 | * @return a new serial port object.
162 | * @throws IOException
163 | * if an I/O exception occurred while opening the serial port.
164 | */
165 | public SerialPort build() throws IOException {
166 | return JRxTxPort.openSerialPort(portName, baudRate, parity, dataBits, stopBits, flowControl);
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/SerialPortException.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | import java.io.IOException;
4 |
5 | /**
6 | * Signals that a I/O exception with the SerialPort occurred.
7 | *
8 | * @see SerialPort
9 | */
10 | public class SerialPortException extends IOException {
11 |
12 | private static final long serialVersionUID = -4848841747671551647L;
13 |
14 | /**
15 | * Constructs a new SerialPortException with the specified detail message.
16 | *
17 | * @param message
18 | * the detail message.
19 | */
20 | public SerialPortException(String message) {
21 | super(message);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/SerialPortTimeoutException.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | import java.io.InterruptedIOException;
4 |
5 | /**
6 | * Signals that the read function of the SerialPort input stream has timed out.
7 | */
8 | public class SerialPortTimeoutException extends InterruptedIOException {
9 |
10 | private static final long serialVersionUID = -5808479011360793837L;
11 |
12 | public SerialPortTimeoutException() {
13 | super();
14 | }
15 |
16 | /**
17 | * Constructs a new SerialPortTimeoutException with the specified detail message.
18 | *
19 | * @param message
20 | * the detail message.
21 | */
22 | public SerialPortTimeoutException(String message) {
23 | super(message);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/StopBits.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | import gnu.io.SerialPort;
4 |
5 | /**
6 | * The stop bits.
7 | */
8 | @SuppressWarnings("deprecation")
9 | public enum StopBits {
10 | /**
11 | * 1 stop bit will be sent at the end of every character.
12 | */
13 | STOPBITS_1(SerialPort.STOPBITS_1),
14 | /**
15 | * 1.5 stop bits will be sent at the end of every character
16 | */
17 | STOPBITS_1_5(SerialPort.STOPBITS_1_5),
18 | /**
19 | * 2 stop bits will be sent at the end of every character
20 | */
21 | STOPBITS_2(SerialPort.STOPBITS_2);
22 |
23 | private int odlValue;
24 |
25 | private StopBits(int oldValue) {
26 | this.odlValue = oldValue;
27 | }
28 |
29 | int getOldValue() {
30 | return this.odlValue;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/jrxtx/src/main/java/org/openmuc/jrxtx/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Packaged coating functionality for RxTx communication via java.
3 | */
4 | package org.openmuc.jrxtx;
5 |
--------------------------------------------------------------------------------
/jrxtx/src/test/README.txt:
--------------------------------------------------------------------------------
1 | These integration tests use virtual serial ports under Linux. In order
2 | to run these integration tests the null modem emulator tty0tty has to
3 | be used to create two serial ports that are connected (one for the
4 | server and one for the client).
5 |
6 | Steps:
7 |
8 | - first change the group ownership of the /dev folder so that you as a
9 | regular user can create the serial ports.
10 |
11 | - run tty0tty to create the two connected virtual serial ports:
12 | tty0tty /dev/ttyS99 /dev/ttyS100 .
13 |
14 | - run the itest using "gradle itest"
15 |
--------------------------------------------------------------------------------
/jrxtx/src/test/java/org/openmuc/jrxtx/TestMain.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx;
2 |
3 | import java.io.IOException;
4 |
5 | public class TestMain {
6 |
7 | public static void main(String[] args) throws IOException {
8 | String[] portNames = SerialPortBuilder.getSerialPortNames();
9 |
10 | for (String portName : portNames) {
11 | System.out.println(portName);
12 | }
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/jrxtx/src/test/java/org/openmuc/jrxtx/itest/IntegrationTest.java:
--------------------------------------------------------------------------------
1 | package org.openmuc.jrxtx.itest;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 | import java.io.OutputStream;
6 | import java.util.concurrent.Callable;
7 | import java.util.concurrent.ExecutorService;
8 | import java.util.concurrent.Executors;
9 | import java.util.concurrent.Future;
10 |
11 | import org.junit.After;
12 | import org.junit.Assert;
13 | import org.junit.Before;
14 | import org.junit.Test;
15 | import org.openmuc.jrxtx.SerialPort;
16 | import org.openmuc.jrxtx.SerialPortBuilder;
17 | import org.openmuc.jrxtx.SerialPortException;
18 | import org.openmuc.jrxtx.SerialPortTimeoutException;
19 |
20 | public class IntegrationTest {
21 |
22 | private final static String PORT_1_NAME = "/dev/ttyS99";
23 | private final static String PORT_2_NAME = "/dev/ttyS100";
24 |
25 | private ExecutorService executor = Executors.newFixedThreadPool(1);
26 |
27 | SerialPort serialPort1 = null;
28 | SerialPort serialPort2 = null;
29 |
30 | InputStream is1, is2;
31 | OutputStream os1, os2;
32 |
33 | @Before
34 | public void setUp() throws IOException {
35 | serialPort1 = SerialPortBuilder.newBuilder(PORT_1_NAME).setBaudRate(2400).build();
36 | serialPort2 = SerialPortBuilder.newBuilder(PORT_2_NAME).setBaudRate(2400).build();
37 |
38 | is1 = serialPort1.getInputStream();
39 | is2 = serialPort2.getInputStream();
40 |
41 | os1 = serialPort1.getOutputStream();
42 | os2 = serialPort2.getOutputStream();
43 | }
44 |
45 | @After
46 | public void tearDown() {
47 | if (serialPort1 != null) {
48 | try {
49 | serialPort1.close();
50 | } catch (IOException e) {
51 | }
52 | }
53 | if (serialPort2 != null) {
54 | try {
55 | serialPort2.close();
56 | } catch (IOException e) {
57 | }
58 | }
59 | }
60 |
61 | @Test
62 | public void serialPortCloseTest() throws Exception {
63 | Future future = executor.submit(new Callable() {
64 | public Boolean call() throws IOException {
65 | try {
66 | is2.read();
67 | } catch (SerialPortException e) {
68 | return true;
69 | }
70 | return false;
71 | }
72 | });
73 | serialPort2.close();
74 | Assert.assertEquals(true, future.get());
75 | }
76 |
77 | @Test
78 | public void simpleWriteReadTest() throws Exception {
79 |
80 | os1.write(99);
81 | int port2received = is2.read();
82 | Assert.assertEquals(99, port2received);
83 |
84 | }
85 |
86 | @Test
87 | public void timoutTest() throws Exception {
88 |
89 | serialPort2.setSerialPortTimeout(300);
90 | boolean timeoutExceptionThrown = false;
91 | try {
92 | is2.read();
93 | } catch (SerialPortTimeoutException e) {
94 | timeoutExceptionThrown = true;
95 | }
96 | Assert.assertEquals(true, timeoutExceptionThrown);
97 | }
98 |
99 | @Test
100 | public void streamCloseTest() throws Exception {
101 | Assert.assertEquals(false, serialPort2.isClosed());
102 | is2.close();
103 | Assert.assertEquals(true, serialPort2.isClosed());
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/jrxtx/src/test/setup-virtual-serial-ports.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 |
4 | # configure the directory /dev
5 | # in a way that the tool tty0tty
6 | # can add ttyS* devices without being superuser
7 | if [ ! -w /dev ]
8 | then
9 | sudo chown root:$USER /dev
10 | sudo chmod 775 /dev
11 | fi
12 |
13 |
14 | if [ ! -e /usr/bin/tty0tty ]
15 | then
16 | DIR_NAME=`dirname $0`
17 | cd ${DIR_NAME}
18 | WORKING_DIRECTORY=`pwd`
19 | sudo cp ${WORKING_DIRECTORY}/tty0tty/tty0tty /usr/bin/tty0tty
20 | fi
21 |
22 | killall tty0tty
23 | tty0tty /dev/ttyS99 /dev/ttyS100 &
24 |
--------------------------------------------------------------------------------
/jrxtx/src/test/tty0tty/README.txt:
--------------------------------------------------------------------------------
1 |
2 | tty0tty - linux null modem emulator v1.2
3 |
4 | Copyright (c) : 2013 Luis Claudio Gambôa Lopes and Maximiliano Pin max.pin@bitroit.com
5 |
6 | This program is free software; you can redistribute it and/or modify
7 | it under the terms of the GNU General Public License as published by
8 | the Free Software Foundation; either version 2, or (at your option)
9 | any later version.
10 |
11 | For more details, please have a look in the original tty0tty ZIP folder.
12 |
13 | - To run:
14 | ./tty0tty
15 |
16 | (/dev/pts/1) <=> (/dev/pts/2)
17 |
18 | - Or, with fix aliases, run:
19 | ./tty0tty /dev/ttyS99 /dev/ttyS100
20 |
21 | (/dev/ttyS99) <=> (/dev/ttyS100)
22 |
23 | the connection is (no handshaking!):
24 |
25 | TX -> RX
26 | RX <- TX
27 |
28 |
29 | Sources from https://github.com/freemed/tty0tty.git
30 |
--------------------------------------------------------------------------------
/jrxtx/src/test/tty0tty/tty0tty:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openmuc/jrxtx/a785442a2925b3b55f91b9d53f744e8ab39a267b/jrxtx/src/test/tty0tty/tty0tty
--------------------------------------------------------------------------------
/jrxtx/src/test/tty0tty/tty0tty-1.2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/openmuc/jrxtx/a785442a2925b3b55f91b9d53f744e8ab39a267b/jrxtx/src/test/tty0tty/tty0tty-1.2.zip
--------------------------------------------------------------------------------
/jrxtxWrapper/build.gradle:
--------------------------------------------------------------------------------
1 | version = project(':jrxtx').version
2 | group = project(':jrxtx').group
3 |
4 | dependencies {
5 | compile project(':jrxtx')
6 | }
7 |
8 | jar {
9 | from project(':jrxtx').sourceSets.main.output
10 | manifest {
11 | attributes('Bundle-Name': 'jRxTxWrapper')
12 | attributes('Export-Package': 'org.openmuc.jrxtx')
13 | attributes('Bundle-SymbolicName': project.group+'.'+project.name)
14 | }
15 | }
16 |
17 | uploadArchives {
18 | repositories {
19 | mavenDeployer {
20 | repository(url: "https://plugins.gradle.org/m2/")
21 | pom.project {
22 | name "jRxTxWrapper"
23 | description "jRxTxWrapper is a library for Java serial communication."
24 |
25 | licenses {
26 | license {
27 | name "GNU Lesser General Public License 2.1 or later + linking exception"
28 | url "http://www.gnu.org/licenses/lgpl-2.1.html"
29 | distribution "repo"
30 | }
31 | }
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/native/.gitignore:
--------------------------------------------------------------------------------
1 | .libs/
2 | .autotools
3 | .cproject
4 | Makefile
5 |
6 | aclocal.m4
7 | autom4te.cache/
8 | compile
9 | config.h.in~
10 |
11 |
12 | config.h
13 | config.log
14 | config.status
15 | librxtxSerial.la
16 | libtool
17 | stamp-h1
18 | stamp-h.in
19 |
20 | Makefile.in
21 | config.h.in
22 | configure
23 | ltmain.sh
24 | missing
25 |
--------------------------------------------------------------------------------
/native/BUILD.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euo pipefail
3 |
4 | ./autogen.sh
5 |
6 | ./configure
7 |
8 | make clean
9 | make
10 |
--------------------------------------------------------------------------------
/native/BUILD_java8.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euxo pipefail
3 |
4 | JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_*.jdk/Contents/Home ./BUILD.sh
5 |
--------------------------------------------------------------------------------
/native/MACOSX_IDE/.cvsignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/native/MACOSX_IDE/XCode/.cvsignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | build
3 | Headers
4 |
--------------------------------------------------------------------------------
/native/MACOSX_IDE/XCode/LibSerialUniversal.xcodeproj/.cvsignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | *.mode1
3 | *.pbxuser
4 |
--------------------------------------------------------------------------------
/native/MACOSX_IDE/XCode/config.h:
--------------------------------------------------------------------------------
1 | /* Define if you have the header file. */
2 | #define HAVE_FCNTL_H 1
3 |
4 | /* Define if you have the header file. */
5 | #define HAVE_GRP_H 1
6 |
7 | /* Define if you have the header file. */
8 | #define HAVE_PWD_H 1
9 |
10 | /* Define if you have the header file. */
11 | #define HAVE_SIGNAL_H 1
12 |
13 | /* Define if you have the header file. */
14 | #define HAVE_SYS_FCNTL_H 1
15 |
16 | /* Define if you have the header file. */
17 | #define HAVE_SYS_FILE_H 1
18 |
19 | /* Define if you have the header file. */
20 | #define HAVE_SYS_SIGNAL_H 1
21 |
22 | /* Define if you have the header file. */
23 | #define HAVE_SYS_TIME_H 1
24 |
25 | /* Define if you have the header file. */
26 | #define HAVE_TERMIOS_H 1
27 |
28 | /* Name of package */
29 | #define PACKAGE "Serial"
30 |
31 | /* Version number of package */
32 | #define VERSION "2.1-8"
33 |
34 | //#define DEBUG
35 | //#define DEBUG_VERBOSE
--------------------------------------------------------------------------------
/native/Makefile.lcc:
--------------------------------------------------------------------------------
1 | # Copyright 2001 Valentin Pavlov
2 | #
3 | #
4 | # The library loads but java APIs still need some modifications
5 | # the native - too.
6 | #
7 | # A make file for compiling rxtx with lcc contributed by Valentin Pavlov
8 | # lcc may be downloaded from: http://www.cs.virginia.edu/~lcc-win32/
9 | #
10 | # You will need a config.h file in the src directory. Other builds usually
11 | # generate them automatically. The following should work.
12 | #define HAVE_FCNTL_H
13 | #define HAVE_SIGNAL_H
14 | #undef HAVE_SYS_FCNTL_H
15 | #undef HAVE_SYS_FILE_H
16 | #undef HAVE_SYS_SIGNAL_H
17 | #undef HAVE_TERMIOS_H
18 | #undef HAVE_SYS_TIME_H
19 | # if you know how to create the above in a dos Makefile send in the changes.
20 | #
21 | # the following commands should then work fine on the command line.
22 | #
23 | # cd src
24 | # make -f ..\Makefile.lcc
25 | #
26 | # You will need to do some programming to get this working. rxtx has moved
27 | # to full event support and the win32 code has not been updated to reflect
28 | # the changes. There is no windows parallel port code at this time.
29 | #
30 | # Thur Jan 24 2001 put Comments in the Makefile. taj@www.linux.org.uk.
31 | # added javac/javah/jar build rule.
32 |
33 | CFLAGS=-I\JDK\INCLUDE -I\jdk\include\win32 -I.
34 | CC=lcc
35 | LINKER=lcclnk
36 | OBJS=init.obj SerialImp.obj termios.obj fuserImp.obj
37 | SRC=init.c SerialImp.c termios.c fuserImp.c
38 | LIBS=
39 | JAVA_HOME=D:\jdk
40 |
41 | lib: $(OBJS)
42 | lcclnk -dll $(OBJS) wsock32.lib -o rxtxSerial.dll
43 |
44 | init.obj: RXTXcomm.jar
45 | $(CC) $(CFLAGS) init.c
46 |
47 | SerialImp.obj: RXTXcomm.jar config.h
48 | $(CC) $(CFLAGS) SerialImp.c
49 |
50 | fuserImp.obj: RXTXcomm.jar config.h
51 |
52 | termios.obj: RXTXcomm.jar
53 | $(CC) $(CFLAGS) termios.c
54 |
55 | RXTXcomm.jar:
56 | javac -d . -O *.java
57 | jar -cf RXTXcomm.jar gnu
58 | javah -jni gnu.io.RXTXPort gnu.io.RXTXCommDriver
59 |
60 | config.h:
61 | echo please read how to create config.h in the Makefile
62 |
63 | install:
64 | copy rxtxSerial.dll $(JAVA_HOME)\jre\bin
65 | copy RXTXcomm.jar $(JAVA_HOME)\jre\lib\ext
66 |
--------------------------------------------------------------------------------
/native/Makefile.msvc:
--------------------------------------------------------------------------------
1 | # ----
2 | # The original author is Eugene Melekhov
3 | # Object Tools http://www.object-tools.com
4 | # Contributed to rxtx Wed Sep 8 2004
5 | # Reportedly builds rxtxSerial.dll but rxtxParallel.dll is untested.
6 | # Accepted as is by taj@www.linux.org.uk
7 | # ---
8 | # This is the first quick and dirty attempt to compile rxtx for Windows
9 | # using Microsoft Visual C compiler. I've done this mostly to debug rxtx
10 | # with Microsoft debugger
11 | #
12 | # This makefile was made for MSVC 6.0. I'm afraid that debug info command
13 | # line switches like /Z7 -debugtype:CV -pdb:NONE won't work with
14 | # MSVC 7.0 or above.
15 | # Last tested successfully with Visual C++ Express 2008 (without the
16 | # LINKFLAGS just mentioned).
17 | #
18 | # The serial port library seems to be working, except the hangup while
19 | # writing to unplugged serial port. BTW the mingw32 library behavior
20 | # is the same.
21 | #
22 | # Parallel port library compiles, but I have not used it
23 | #
24 | # To build rxtx library execute commands like the following
25 | # mkdir build
26 | # copy Makefile.msvc build\Makefile
27 | # cd build
28 | # nmake
29 | #
30 | # To build only serial/parallel library use
31 | # nmake serial
32 | # or
33 | # nmake parallel
34 | #
35 | # If you wish to make the version with debug info then do something
36 | # like this
37 | # nmake serial DEBUG_INFO=1
38 | #
39 | # 'nmake clean' will remove all object dll and other working files
40 | #
41 | # Please make sure that variable JAVA_HOME points to the place where
42 | # your Java SDK is located
43 | #
44 |
45 | JAVA_HOME = D:\Apps\Java\j2sdk1.4.2_17
46 | COMMINSTALL="$(JAVA_HOME)\jre\lib\ext"
47 | LIBINSTALL="$(JAVA_HOME)\jre\bin"
48 | JUNIT_JAR=D:\Apps\junit3.8.2\junit.jar
49 |
50 | JAVAC = $(JAVA_HOME)\bin\javac -source 1.5 -target 1.5
51 | JAR = $(JAVA_HOME)\bin\jar
52 | JAVAH = $(JAVA_HOME)\bin\javah
53 | JAVA = $(JAVA_HOME)\bin\java
54 |
55 | SRC=..\src
56 | CFLAGS= -nologo -I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32 -I$(SRC) -I. -DWIN32
57 | LINK_FLAGS = -nologo -map -incremental:no
58 |
59 | !IFDEF DEBUG_INFO
60 | JAVAC = $(JAVAC) -g
61 | CFLAGS = -Z7 -Oi -Oy- $(CFLAGS)
62 | CFLAGS_DLL = $(CFLAGS_DLL) -GZ
63 | #LINK_FLAGS = $(LINK_FLAGS) -debug -debugtype:CV -pdb:NONE
64 | LINK_FLAGS = $(LINK_FLAGS) -debug
65 | DEBUG_INFO_FLAG = DEBUG_INFO^=1
66 | !ELSE
67 | CFLAGS = $(CFLAGS) -Ox
68 | !ENDIF
69 |
70 | OBJS=init.obj SerialImp.obj termios.obj fuserImp.obj
71 | PARALLEL_OBJS= ParallelImp.obj termios.obj init.obj
72 |
73 |
74 | all: serial parallel
75 |
76 | serial: RXTXcomm.jar rxtxSerial.dll
77 |
78 | parallel: RXTXcomm.jar rxtxParallel.dll
79 |
80 | init.obj: config.h
81 | $(CC) $(CFLAGS) /TP -c $(SRC)\init.cc
82 |
83 | fixup.obj: config.h
84 | $(CC) $(CFLAGS) -c $(SRC)\fixup.c
85 |
86 | fuserImp.obj: $(SRC)\fuserImp.c config.h gnu_io_CommPortIdentifier.h
87 | $(CC) $(CFLAGS) -c $(SRC)\fuserImp.c
88 |
89 | termios.obj: $(SRC)\termios.c $(SRC)\win32termios.h config.h
90 | $(CC) $(CFLAGS) -c $(SRC)\termios.c
91 | SerialImp.obj: $(SRC)\SerialImp.c $(SRC)\SerialImp.h $(SRC)\win32termios.h config.h gnu_io_RXTXPort.h
92 | $(CC) $(CFLAGS) -c $(SRC)\SerialImp.c
93 |
94 | ParallelImp.obj: $(SRC)\ParallelImp.c $(SRC)\ParallelImp.h $(SRC)\win32termios.h config.h gnu_io_LPRPort.h
95 | $(CC) $(CFLAGS) -c $(SRC)\ParallelImp.c
96 |
97 | rxtxSerial.dll: $(OBJS)
98 | link -dll -out:$@ $** $(LINK_FLAGS)
99 |
100 | rxtxParallel.dll: $(PARALLEL_OBJS)
101 | link -dll -out:$@ $** $(LINK_FLAGS)
102 |
103 |
104 | gnu_io_RXTXPort.h gnu_io_CommPortIdentifier.h gnu_io_LPRPort.h gnu_io_RXTXVersion.h: RXTXcomm.jar
105 | $(JAVAH) -jni gnu.io.RXTXPort gnu.io.CommPortIdentifier gnu.io.LPRPort gnu.io.RXTXVersion
106 |
107 | RXTXcomm.jar:
108 | $(JAVAC) -d . ..\src\main\java\gnu\io\*.java
109 | $(JAR) -cf RXTXcomm.jar gnu
110 |
111 | config.h: Makefile
112 | echo #define HAVE_FCNTL_H >> config.h
113 | echo #define HAVE_SIGNAL_H >> config.h
114 | echo #undef HAVE_SYS_FCNTL_H >> config.h
115 | echo #undef HAVE_SYS_FILE_H >> config.h
116 | echo #undef HAVE_SYS_SIGNAL_H >> config.h
117 | echo #undef HAVE_TERMIOS_H >> config.h
118 | echo #undef HAVE_SYS_TIME_H >> config.h
119 |
120 | testcp\stamp: RXTXcomm.jar test\java\gnu\io\rxtx\tests\*.java
121 | -mkdir testcp
122 | $(JAVAC) -classpath RXTXcomm.jar;$(JUNIT_JAR) -d testcp test\java\gnu\io\rxtx\tests\*.java
123 | echo > testcp\stamp
124 |
125 | tests: all testcp\stamp
126 | $(JAVA) -classpath RXTXcomm.jar;testcp;$(JUNIT_JAR) gnu.io.rxtx.tests.RXTXTestSuite
127 |
128 | clean:
129 | -rmdir /s /q gnu
130 | -rmdir /s /q testcp
131 | -del *.obj *.h RXTXcomm.jar rxtxSerial.* rxtxParallel.*
132 |
133 | install: all
134 | @REM xcopy /Y RXTXcomm.jar $(COMMINSTALL)
135 | @REM xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32"
136 | @REM xcopy /Y rxtx*.dll $(LIBINSTALL)
137 | @REM xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32"
138 |
--------------------------------------------------------------------------------
/native/README.md:
--------------------------------------------------------------------------------
1 | USE BUILD.sh
2 |
--------------------------------------------------------------------------------
/native/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Run this to generate all the initial makefiles, etc.
3 | # Taken from the GNOME package http://www.gnome.org
4 |
5 | srcdir=.
6 | PKG_NAME="rxtx library"
7 |
8 | DIE=0
9 |
10 | (autoconf --version) < /dev/null > /dev/null 2>&1 || {
11 | echo
12 | echo "**Error**: You must have "\`autoconf\'" installed to compile rxtx."
13 | echo "Download the appropriate package for your distribution,"
14 | echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
15 | DIE=1
16 | }
17 |
18 | # avoid libtool on Mac OS X codename Darwin Dmitry
19 |
20 | LIBTOOLIZE=libtoolize
21 | if test `uname` != "Darwin"; then
22 | (libtoolize --version) < /dev/null > /dev/null 2>&1 || {
23 | echo
24 | echo "**Error**: You must have "\`libtool\'" installed to compile rxtx."
25 | echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2.tar.gz"
26 | echo "(or a newer version if it is available)"
27 | DIE=1
28 | }
29 | else
30 | LIBTOOLIZE=glibtoolize
31 | fi
32 |
33 | (automake --version) < /dev/null > /dev/null 2>&1 || {
34 | echo
35 | echo "**Error**: You must have "\`automake\'" installed to compile rxtx."
36 | echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
37 | echo "(or a newer version if it is available)"
38 | DIE=1
39 | NO_AUTOMAKE=yes
40 | }
41 |
42 |
43 | # if no automake, don't bother testing for aclocal
44 | test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
45 | echo
46 | echo "**Error**: Missing "\`aclocal\'". The version of "\`automake\'
47 | echo "installed doesn't appear recent enough."
48 | echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
49 | echo "(or a newer version if it is available)"
50 | DIE=1
51 | }
52 |
53 | if test "$DIE" -eq 1; then
54 | exit 1
55 | fi
56 |
57 | #if test -z "$*"; then
58 | # echo "**Warning**: I am going to run "\`configure\'" with no arguments."
59 | # echo "If you wish to pass any to it, please specify them on the"
60 | # echo \`$0\'" command line."
61 | # echo
62 | #fi
63 |
64 | for j in `find $srcdir -name configure.ac -print`
65 | do
66 | i=`dirname $j`
67 | if test -f $i/NO-AUTO-GEN; then
68 | echo skipping $i -- flagged as no auto-gen
69 | else
70 | macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $j`
71 | echo processing $i
72 | ## debug
73 | test -n "$macrodirs" && echo \`aclocal\' will also look in \`$macrodirs\'
74 | (cd $i; \
75 | aclocalinclude="$ACLOCAL_FLAGS"; \
76 | for k in $macrodirs; do \
77 | if test -d $k; then aclocalinclude="$aclocalinclude -I $k"; \
78 | else echo "**Warning**: No such directory \`$k'. Ignored."; fi; \
79 | done; \
80 | $LIBTOOLIZE --copy --force; \
81 | aclocal $aclocalinclude; \
82 | autoheader; automake --add-missing --gnu; autoheader; autoconf)
83 | fi
84 | done
85 |
86 | #if test x$NOCONFIGURE = x; then
87 | #echo running $srcdir/configure --enable-maintainer-mode "$@"
88 | #$srcdir/configure --enable-maintainer-mode "$@" \
89 | #&& echo Now type \`make\' to compile the $PKG_NAME
90 | #else
91 | #echo Skipping configure process.
92 | #fi
93 |
--------------------------------------------------------------------------------
/native/buildtest:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | echo buildtest started `date`
3 | MOUNT=/usr/local
4 | export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.3/bin:/usr/local/cross-tools/i386-mingw32/bin/:/usr/local/cross-tools/i386-mingw32/bin
5 | unset JAVA_HOME
6 |
7 |
8 | mount 10.0.2.1:/usr/src/linux-2.2.14 /usr/src/linux
9 | mount 10.0.2.1:/mnt/hda3/local /usr/local
10 |
11 | echo -n building gcc-win32
12 | export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/java/jdk1.3/bin/:
13 | export WIN32INCLUDE=/home/jarvi/RXTX/tools/win32-include
14 | ../configure --target=i386-mingw32 --host=i386-redhat-linux > ../logs/configure-log-mingw32 2>&1 && make > ../logs/make-log-gcc-win32 2>&1
15 | echo " build result=$?"
16 | rm -rf ../build/*
17 | unset WIN32INCLUDE
18 | export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.3/bin:/usr/local/cross-tools/i386-mingw32/bin/:/usr/local/cross-tools/i386-mingw32/bin
19 |
20 | umount /usr/local
21 | mount 10.0.2.1:/mnt/hda3/local/kaffe/usr/local/ /usr/local
22 | echo -n building kaffe
23 | export JAVA_HOME=/usr/local
24 | ../configure > ../logs/configure-log-kaffe 2>&1 && make > ../logs/make-log-kaffe 2>&1
25 | echo " build result=$?"
26 | rm -rf ../build/*
27 | unset JAVA_HOME
28 |
29 | umount /usr/local
30 | mount 10.0.2.1:/mnt/hda3/local /usr/local
31 |
32 | for i in \
33 | j2sdk1.4.0 \
34 | jdk117_v2 \
35 | jdk118 \
36 | jdk118_v1 \
37 | jdk118_v3 \
38 | jdk1.2 \
39 | jdk1.2.2-006-sun \
40 | jdk1.3
41 | do export JAVA_HOME=$MOUNT/$i
42 | echo -n building with $JAVA_HOME
43 | ../configure > ../logs/configure-log-$i 2>&1 && make > ../logs/make-log-$i 2>&1
44 | echo " build result=$?"
45 | rm -rf ../build/*
46 | unset JAVA_HOME
47 | done
48 | umount /usr/local
49 | umount /usr/src/linux
50 | echo buildtest finished `date`
51 |
--------------------------------------------------------------------------------
/native/buildwin32:
--------------------------------------------------------------------------------
1 | rm -f config.cache config.h config.status
2 | export WIN32INCLUDE=/home/bob/win32-include
3 | export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/home/rxtx/jdk1.5.0/bin:
4 | ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32
5 | make
6 | #export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.3/bin:/usr/local/cross-tools/i386-mingw32/bin/:/usr/local/cross-tools/i386-mingw32/bin
7 |
8 |
--------------------------------------------------------------------------------
/native/gen+conf.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ./autogen.sh
4 |
5 | ./configure
6 |
--------------------------------------------------------------------------------
/native/mkinstalldirs:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | # mkinstalldirs --- make directory hierarchy
3 | # Author: Noah Friedman
4 | # Created: 1993-05-16
5 | # Public domain
6 |
7 | # $Id: mkinstalldirs,v 1.1.1.1 1999-03-18 18:18:47 douglau Exp $
8 |
9 | errstatus=0
10 |
11 | for file
12 | do
13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
14 | shift
15 |
16 | pathcomp=
17 | for d
18 | do
19 | pathcomp="$pathcomp$d"
20 | case "$pathcomp" in
21 | -* ) pathcomp=./$pathcomp ;;
22 | esac
23 |
24 | if test ! -d "$pathcomp"; then
25 | echo "mkdir $pathcomp" 1>&2
26 |
27 | mkdir "$pathcomp" || lasterr=$?
28 |
29 | if test ! -d "$pathcomp"; then
30 | errstatus=$lasterr
31 | fi
32 | fi
33 |
34 | pathcomp="$pathcomp/"
35 | done
36 | done
37 |
38 | exit $errstatus
39 |
40 | # mkinstalldirs ends here
41 |
--------------------------------------------------------------------------------
/native/rxtx.spec:
--------------------------------------------------------------------------------
1 | Summary: RXTX
2 | Name: rxtx
3 | Version: 2.1
4 | Release: 7pre17
5 | License: LGPL
6 | Group: Development/Libraries
7 | Source: rxtx-%{PACKAGE_VERSION}-%{PACKAGE_RELEASE}.tar.gz
8 | URL: www.rxtx.org
9 | Buildroot: /var/tmp/rxtx-root
10 |
11 | %description
12 | rxtx is an full implementation of java commapi which aims to support RS232
13 | IEEE 1284, RS485, I2C and RawIO. This is a developers release.
14 | %prep
15 | %setup -q -n rxtx-%{version}-%{release}
16 |
17 | %build
18 | export THREADS_FLAG=native
19 | ./autogen.sh
20 | CFLAGS="$RPM_OPT_FLAGS" LDFLAGS=-s ./configure --prefix=/usr
21 | pwd
22 | make
23 |
24 | %install
25 | rm -rf $RPM_BUILD_ROOT
26 | mkdir -p $RPM_BUILD_ROOT$JAVA_HOME/jre/lib/ext $RPM_BUILD_ROOT$JAVA_HOME/jre/lib/i386
27 | make RXTX_PATH=$RPM_BUILD_ROOT$JAVA_HOME/jre/lib/i386/ JHOME=$RPM_BUILD_ROOT$JAVA_HOME/jre/lib/ext install
28 | echo "Driver=gnu.io.RXTXCommDriver" > $RPM_BUILD_ROOT$JAVA_HOME/jre/lib/ext/gnu.io.rxtx.properties
29 |
30 | find $RPM_BUILD_ROOT/usr -xtype f -print | \
31 | sed "s@^$RPM_BUILD_ROOT@@g" > INSTALLED_FILES
32 |
33 | if [ "$(cat INSTALLED_FILES)X" = "X" ] ; then
34 | echo "No files!"
35 | exit -1
36 | fi
37 |
38 | %files -f INSTALLED_FILES
39 | %defattr(-,root,root)
40 | %doc AUTHORS ChangeLog README RMISecurityManager.html COPYING INSTALL PORTING TODO
41 |
42 | %clean
43 | rm -rf $RPM_BUILD_ROOT
44 |
45 | %changelog
46 | * Sun Mar 21 2004 Willem Riede
47 | - adjust spec file to support rpmbuild by ordinary user in Fedora context.
48 |
--------------------------------------------------------------------------------
/native/src/.gitignore:
--------------------------------------------------------------------------------
1 | win32s.h
2 | fixup.cc
3 | new.c
4 | init.cc
5 | typedefs_md.h.diff
6 | Serial.def
7 | termios.c
8 |
--------------------------------------------------------------------------------
/native/src/ParallelImp.h:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
3 | | RXTX is a native interface to serial ports in java.
4 | | Copyright 1997-2007 by Trent Jarvi tjarvi@qbang.org and others who
5 | | actually wrote it. See individual source files for more information.
6 | |
7 | | A copy of the LGPL v 2.1 may be found at
8 | | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
9 | | here for your convenience.
10 | |
11 | | This library is free software; you can redistribute it and/or
12 | | modify it under the terms of the GNU Lesser General Public
13 | | License as published by the Free Software Foundation; either
14 | | version 2.1 of the License, or (at your option) any later version.
15 | |
16 | | This library is distributed in the hope that it will be useful,
17 | | but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 | | Lesser General Public License for more details.
20 | |
21 | | An executable that contains no derivative of any portion of RXTX, but
22 | | is designed to work with RXTX by being dynamically linked with it,
23 | | is considered a "work that uses the Library" subject to the terms and
24 | | conditions of the GNU Lesser General Public License.
25 | |
26 | | The following has been added to the RXTX License to remove
27 | | any confusion about linking to RXTX. We want to allow in part what
28 | | section 5, paragraph 2 of the LGPL does not permit in the special
29 | | case of linking over a controlled interface. The intent is to add a
30 | | Java Specification Request or standards body defined interface in the
31 | | future as another exception but one is not currently available.
32 | |
33 | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
34 | |
35 | | As a special exception, the copyright holders of RXTX give you
36 | | permission to link RXTX with independent modules that communicate with
37 | | RXTX solely through the Sun Microsytems CommAPI interface version 2,
38 | | regardless of the license terms of these independent modules, and to copy
39 | | and distribute the resulting combined work under terms of your choice,
40 | | provided that every copy of the combined work is accompanied by a complete
41 | | copy of the source code of RXTX (the version of RXTX used to produce the
42 | | combined work), being distributed under the terms of the GNU Lesser General
43 | | Public License plus this exception. An independent module is a
44 | | module which is not derived from or based on RXTX.
45 | |
46 | | Note that people who make modified versions of RXTX are not obligated
47 | | to grant this special exception for their modified versions; it is
48 | | their choice whether to do so. The GNU Lesser General Public License
49 | | gives permission to release a modified version without this exception; this
50 | | exception also makes it possible to release a modified version which
51 | | carries forward this exception.
52 | |
53 | | You should have received a copy of the GNU Lesser General Public
54 | | License along with this library; if not, write to the Free
55 | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56 | | All trademarks belong to their respective owners.
57 | --------------------------------------------------------------------------*/
58 | /* gnu.io.ParallelPort constants */
59 | /* this appears to be handled in /usr/src/linux/misc/parport_pc.c */
60 | #define LPT_MODE_ANY 0
61 | #define LPT_MODE_SPP 1
62 | #define LPT_MODE_PS2 2
63 | #define LPT_MODE_EPP 3
64 | #define LPT_MODE_ECP 4
65 | #define LPT_MODE_NIBBLE 5
66 |
67 | /* some popular releases of Slackware do not have SSIZE_MAX */
68 |
69 | #ifndef SSIZE_MAX
70 | # if defined(INT_MAX)
71 | # define SSIZE_MAX INT_MAX
72 | # elif defined(MAXINT)
73 | # define SSIZE_MAX MAXINT
74 | # else
75 | # define SSIZE_MAX 2147483647 /* ugh */
76 | # endif
77 | #endif
78 |
79 | /* gnu.io.ParallelPortEvent constants */
80 | #define PAR_EV_ERROR 1
81 | #define PAR_EV_BUFFER 2
82 |
83 | /* java exception class names */
84 | #define UNSUPPORTED_COMM_OPERATION "gnu/io/UnsupportedCommOperationException"
85 | #define ARRAY_INDEX_OUT_OF_BOUNDS "java/lang/ArrayIndexOutOfBoundsException"
86 | #define OUT_OF_MEMORY "java/lang/OutOfMemoryError"
87 | #define IO_EXCEPTION "java/io/IOException"
88 | #define PORT_IN_USE_EXCEPTION "gnu/io/PortInUseException"
89 |
90 | /*
91 | Flow Control defines inspired by reading how mgetty by Gert Doering does it
92 | */
93 |
94 | /* PROTOTYPES */
95 | jboolean is_interrupted(JNIEnv *, jobject);
96 | int send_event(JNIEnv *, jobject, jint, int);
97 | int read_byte_array(int fd, unsigned char *buffer, int length, int threshold,
98 | int timeout);
99 | int get_java_var(JNIEnv *, jobject, char *, char *);
100 | void report(char *);
101 | void report_error(char *);
102 | void throw_java_exception(JNIEnv *, char *, char *, char *);
103 | void throw_java_exception_system_msg(JNIEnv *, char *, char *);
104 |
105 |
--------------------------------------------------------------------------------
/native/src/WinCE/README:
--------------------------------------------------------------------------------
1 | Hi.
2 | Enclosed you'll find a version of rxtx for Windows CE.
3 | It was compiled using Microsoft's eMbedded Visual C++ 3.0 (which is free).
4 | It was tested on Compaq iPAQ 3650 (ARM).
5 |
6 | Native code is completely rewritten, since CE doesn't have overlapped IO
7 | (and MANY other things), but does non-overlapped better than regular Win32
8 | - simultanous multiple operations on the same handle are OK.
9 | I tried compiling this project under NT (with Visual C++ 6.0) and it
10 | compiles without problems but it doesn't work right because NT doesn't
11 | support simultanous operations without overlapping.
12 | Yes, that means that there's no compatibility between Win32 and Win32CE -
13 | neither direction. I love Microsoft.
14 |
15 | Aha, I used unicode everywhere, since both CE and Java use it internally
16 | (CE doesn't have ANSI at all) and I didn't find converting data back and
17 | forth sensible.
18 |
19 | Windows CE doesn't have stdio and console at all so I had to make printj()
20 | function. Look at it - it can be quite usable for other projects. Basically
21 | it works like printf() but uses System.out.print() for output.
22 |
23 | You can find more info on Java serial support on
24 | http://www.mhobot.w.pl/java/comm
25 |
26 | Michal Hobot
27 | MichalHobot@netscape.net
28 |
29 | Krakow,
30 | Poland
31 |
--------------------------------------------------------------------------------
/native/src/WinCE/StdAfx.cpp:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
3 | | RXTX is a native interface to serial ports in java.
4 | | Copyright 2002-2004 Michal Hobot MichalHobot@netscape.net
5 | | Copyright 1997-2007 by Trent Jarvi tjarvi@qbang.org and others who
6 | | actually wrote it. See individual source files for more information.
7 | |
8 | | A copy of the LGPL v 2.1 may be found at
9 | | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
10 | | here for your convenience.
11 | |
12 | | This library is free software; you can redistribute it and/or
13 | | modify it under the terms of the GNU Lesser General Public
14 | | License as published by the Free Software Foundation; either
15 | | version 2.1 of the License, or (at your option) any later version.
16 | |
17 | | This library is distributed in the hope that it will be useful,
18 | | but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | | Lesser General Public License for more details.
21 | |
22 | | An executable that contains no derivative of any portion of RXTX, but
23 | | is designed to work with RXTX by being dynamically linked with it,
24 | | is considered a "work that uses the Library" subject to the terms and
25 | | conditions of the GNU Lesser General Public License.
26 | |
27 | | The following has been added to the RXTX License to remove
28 | | any confusion about linking to RXTX. We want to allow in part what
29 | | section 5, paragraph 2 of the LGPL does not permit in the special
30 | | case of linking over a controlled interface. The intent is to add a
31 | | Java Specification Request or standards body defined interface in the
32 | | future as another exception but one is not currently available.
33 | |
34 | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
35 | |
36 | | As a special exception, the copyright holders of RXTX give you
37 | | permission to link RXTX with independent modules that communicate with
38 | | RXTX solely through the Sun Microsytems CommAPI interface version 2,
39 | | regardless of the license terms of these independent modules, and to copy
40 | | and distribute the resulting combined work under terms of your choice,
41 | | provided that every copy of the combined work is accompanied by a complete
42 | | copy of the source code of RXTX (the version of RXTX used to produce the
43 | | combined work), being distributed under the terms of the GNU Lesser General
44 | | Public License plus this exception. An independent module is a
45 | | module which is not derived from or based on RXTX.
46 | |
47 | | Note that people who make modified versions of RXTX are not obligated
48 | | to grant this special exception for their modified versions; it is
49 | | their choice whether to do so. The GNU Lesser General Public License
50 | | gives permission to release a modified version without this exception; this
51 | | exception also makes it possible to release a modified version which
52 | | carries forward this exception.
53 | |
54 | | You should have received a copy of the GNU Lesser General Public
55 | | License along with this library; if not, write to the Free
56 | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
57 | | All trademarks belong to their respective owners.
58 | --------------------------------------------------------------------------*/
59 | // stdafx.cpp : source file that includes just the standard includes
60 | // rxtxSerial.pch will be the pre-compiled header
61 | // stdafx.obj will contain the pre-compiled type information
62 | #include "stdafx.h"
63 |
64 | // TODO: reference any additional headers you need in STDAFX.H
65 | // and not in this file
66 |
--------------------------------------------------------------------------------
/native/src/WinCE/StdAfx.h:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
3 | | RXTX is a native interface to serial ports in java.
4 | | Copyright 2002-2004 Michal Hobot MichalHobot@netscape.net
5 | | actually wrote it. See individual source files for more information.
6 | |
7 | | A copy of the LGPL v 2.1 may be found at
8 | | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
9 | | here for your convenience.
10 | |
11 | | This library is free software; you can redistribute it and/or
12 | | modify it under the terms of the GNU Lesser General Public
13 | | License as published by the Free Software Foundation; either
14 | | version 2.1 of the License, or (at your option) any later version.
15 | |
16 | | This library is distributed in the hope that it will be useful,
17 | | but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 | | Lesser General Public License for more details.
20 | |
21 | | An executable that contains no derivative of any portion of RXTX, but
22 | | is designed to work with RXTX by being dynamically linked with it,
23 | | is considered a "work that uses the Library" subject to the terms and
24 | | conditions of the GNU Lesser General Public License.
25 | |
26 | | The following has been added to the RXTX License to remove
27 | | any confusion about linking to RXTX. We want to allow in part what
28 | | section 5, paragraph 2 of the LGPL does not permit in the special
29 | | case of linking over a controlled interface. The intent is to add a
30 | | Java Specification Request or standards body defined interface in the
31 | | future as another exception but one is not currently available.
32 | |
33 | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
34 | |
35 | | As a special exception, the copyright holders of RXTX give you
36 | | permission to link RXTX with independent modules that communicate with
37 | | RXTX solely through the Sun Microsytems CommAPI interface version 2,
38 | | regardless of the license terms of these independent modules, and to copy
39 | | and distribute the resulting combined work under terms of your choice,
40 | | provided that every copy of the combined work is accompanied by a complete
41 | | copy of the source code of RXTX (the version of RXTX used to produce the
42 | | combined work), being distributed under the terms of the GNU Lesser General
43 | | Public License plus this exception. An independent module is a
44 | | module which is not derived from or based on RXTX.
45 | |
46 | | Note that people who make modified versions of RXTX are not obligated
47 | | to grant this special exception for their modified versions; it is
48 | | their choice whether to do so. The GNU Lesser General Public License
49 | | gives permission to release a modified version without this exception; this
50 | | exception also makes it possible to release a modified version which
51 | | carries forward this exception.
52 | |
53 | | You should have received a copy of the GNU Lesser General Public
54 | | License along with this library; if not, write to the Free
55 | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56 | | All trademarks belong to their respective owners.
57 | --------------------------------------------------------------------------*/
58 |
59 | // stdafx.h : include file for standard system include files,
60 | // or project specific include files that are used frequently, but
61 | // are changed infrequently
62 | //
63 | #if !defined(AFX_STDAFX_H__B78985E1_0CAF_4EE2_8807_4D04C75EAFCE__INCLUDED_)
64 | #define AFX_STDAFX_H__B78985E1_0CAF_4EE2_8807_4D04C75EAFCE__INCLUDED_
65 |
66 | #if _MSC_VER > 1000
67 | #pragma once
68 | #endif // _MSC_VER > 1000
69 |
70 | #include
71 | #include "gnu_io_RXTXPort.h"
72 | #include "gnu_io_RXTXCommDriver.h"
73 |
74 | // Insert your headers here
75 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
76 |
77 | #include
78 | #include
79 | // TODO: reference additional headers your program requires here
80 |
81 | //{{AFX_INSERT_LOCATION}}
82 | // Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
83 |
84 | #endif // !defined(AFX_STDAFX_H__B78985E1_0CAF_4EE2_8807_4D04C75EAFCE__INCLUDED_)
85 |
--------------------------------------------------------------------------------
/native/src/WinCE/gnu_io_RXTXCommDriver.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RXTXCommDriver */
4 |
5 | #ifndef _Included_gnu_io_RXTXCommDriver
6 | #define _Included_gnu_io_RXTXCommDriver
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_RXTXCommDriver_debug
11 | #define gnu_io_RXTXCommDriver_debug 0L
12 | /*
13 | * Class: gnu_io_RXTXCommDriver
14 | * Method: nativeGetVersion
15 | * Signature: ()Ljava/lang/String;
16 | */
17 | JNIEXPORT jstring JNICALL Java_gnu_io_RXTXCommDriver_nativeGetVersion(JNIEnv *,
18 | jclass);
19 |
20 | /*
21 | * Class: gnu_io_RXTXCommDriver
22 | * Method: registerKnownPorts
23 | * Signature: (I)Z
24 | */
25 | JNIEXPORT jboolean JNICALL Java_gnu_io_RXTXCommDriver_registerKnownPorts(
26 | JNIEnv *, jobject, jint);
27 |
28 | /*
29 | * Class: gnu_io_RXTXCommDriver
30 | * Method: isPortPrefixValid
31 | * Signature: (Ljava/lang/String;)Z
32 | */
33 | JNIEXPORT jboolean JNICALL Java_gnu_io_RXTXCommDriver_isPortPrefixValid(
34 | JNIEnv *, jobject, jstring);
35 |
36 | /*
37 | * Class: gnu_io_RXTXCommDriver
38 | * Method: testRead
39 | * Signature: (Ljava/lang/String;I)Z
40 | */
41 | JNIEXPORT jboolean JNICALL Java_gnu_io_RXTXCommDriver_testRead(JNIEnv *,
42 | jobject, jstring, jint);
43 |
44 | /*
45 | * Class: gnu_io_RXTXCommDriver
46 | * Method: getDeviceDirectory
47 | * Signature: ()Ljava/lang/String;
48 | */
49 | JNIEXPORT jstring JNICALL Java_gnu_io_RXTXCommDriver_getDeviceDirectory(
50 | JNIEnv *, jobject);
51 |
52 | #ifdef __cplusplus
53 | }
54 | #endif
55 | #endif
56 |
--------------------------------------------------------------------------------
/native/src/WinCE/rxtxSerial.cpp:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
3 | | RXTX is a native interface to serial ports in java.
4 | | Copyright 2002-2004 Michal Hobot MichalHobot@netscape.net
5 | | Copyright 1997-2007 by Trent Jarvi tjarvi@qbang.org and others who
6 | | actually wrote it. See individual source files for more information.
7 | |
8 | | A copy of the LGPL v 2.1 may be found at
9 | | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
10 | | here for your convenience.
11 | |
12 | | This library is free software; you can redistribute it and/or
13 | | modify it under the terms of the GNU Lesser General Public
14 | | License as published by the Free Software Foundation; either
15 | | version 2.1 of the License, or (at your option) any later version.
16 | |
17 | | This library is distributed in the hope that it will be useful,
18 | | but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 | | Lesser General Public License for more details.
21 | |
22 | | An executable that contains no derivative of any portion of RXTX, but
23 | | is designed to work with RXTX by being dynamically linked with it,
24 | | is considered a "work that uses the Library" subject to the terms and
25 | | conditions of the GNU Lesser General Public License.
26 | |
27 | | The following has been added to the RXTX License to remove
28 | | any confusion about linking to RXTX. We want to allow in part what
29 | | section 5, paragraph 2 of the LGPL does not permit in the special
30 | | case of linking over a controlled interface. The intent is to add a
31 | | Java Specification Request or standards body defined interface in the
32 | | future as another exception but one is not currently available.
33 | |
34 | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
35 | |
36 | | As a special exception, the copyright holders of RXTX give you
37 | | permission to link RXTX with independent modules that communicate with
38 | | RXTX solely through the Sun Microsytems CommAPI interface version 2,
39 | | regardless of the license terms of these independent modules, and to copy
40 | | and distribute the resulting combined work under terms of your choice,
41 | | provided that every copy of the combined work is accompanied by a complete
42 | | copy of the source code of RXTX (the version of RXTX used to produce the
43 | | combined work), being distributed under the terms of the GNU Lesser General
44 | | Public License plus this exception. An independent module is a
45 | | module which is not derived from or based on RXTX.
46 | |
47 | | Note that people who make modified versions of RXTX are not obligated
48 | | to grant this special exception for their modified versions; it is
49 | | their choice whether to do so. The GNU Lesser General Public License
50 | | gives permission to release a modified version without this exception; this
51 | | exception also makes it possible to release a modified version which
52 | | carries forward this exception.
53 | |
54 | | You should have received a copy of the GNU Lesser General Public
55 | | License along with this library; if not, write to the Free
56 | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
57 | | All trademarks belong to their respective owners.
58 | --------------------------------------------------------------------------*/
59 | // rxtxSerial.cpp : Defines the entry point for the DLL application.
60 | //
61 | #include "StdAfx.h"
62 |
63 | BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call,
64 | LPVOID lpReserved) {
65 | switch (ul_reason_for_call) {
66 | case DLL_PROCESS_ATTACH:
67 | case DLL_THREAD_ATTACH:
68 | case DLL_THREAD_DETACH:
69 | case DLL_PROCESS_DETACH:
70 | break;
71 | }
72 | return TRUE;
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/native/src/fixup.c:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
3 | | RXTX is a native interface to serial ports in java.
4 | | Copyright 1997-2007 by Trent Jarvi tjarvi@qbang.org and others who
5 | | actually wrote it. See individual source files for more information.
6 | |
7 | | A copy of the LGPL v 2.1 may be found at
8 | | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
9 | | here for your convenience.
10 | |
11 | | This library is free software; you can redistribute it and/or
12 | | modify it under the terms of the GNU Lesser General Public
13 | | License as published by the Free Software Foundation; either
14 | | version 2.1 of the License, or (at your option) any later version.
15 | |
16 | | This library is distributed in the hope that it will be useful,
17 | | but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 | | Lesser General Public License for more details.
20 | |
21 | | An executable that contains no derivative of any portion of RXTX, but
22 | | is designed to work with RXTX by being dynamically linked with it,
23 | | is considered a "work that uses the Library" subject to the terms and
24 | | conditions of the GNU Lesser General Public License.
25 | |
26 | | The following has been added to the RXTX License to remove
27 | | any confusion about linking to RXTX. We want to allow in part what
28 | | section 5, paragraph 2 of the LGPL does not permit in the special
29 | | case of linking over a controlled interface. The intent is to add a
30 | | Java Specification Request or standards body defined interface in the
31 | | future as another exception but one is not currently available.
32 | |
33 | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
34 | |
35 | | As a special exception, the copyright holders of RXTX give you
36 | | permission to link RXTX with independent modules that communicate with
37 | | RXTX solely through the Sun Microsytems CommAPI interface version 2,
38 | | regardless of the license terms of these independent modules, and to copy
39 | | and distribute the resulting combined work under terms of your choice,
40 | | provided that every copy of the combined work is accompanied by a complete
41 | | copy of the source code of RXTX (the version of RXTX used to produce the
42 | | combined work), being distributed under the terms of the GNU Lesser General
43 | | Public License plus this exception. An independent module is a
44 | | module which is not derived from or based on RXTX.
45 | |
46 | | Note that people who make modified versions of RXTX are not obligated
47 | | to grant this special exception for their modified versions; it is
48 | | their choice whether to do so. The GNU Lesser General Public License
49 | | gives permission to release a modified version without this exception; this
50 | | exception also makes it possible to release a modified version which
51 | | carries forward this exception.
52 | |
53 | | You should have received a copy of the GNU Lesser General Public
54 | | License along with this library; if not, write to the Free
55 | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56 | | All trademarks belong to their respective owners.
57 | --------------------------------------------------------------------------*/
58 | asm(".section .idata$3\n" ".long 0,0,0,0, 0,0,0,0");
59 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_CommPortIdentifier.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_CommPortIdentifier */
4 |
5 | #ifndef _Included_gnu_io_CommPortIdentifier
6 | #define _Included_gnu_io_CommPortIdentifier
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_CommPortIdentifier_debug
11 | #define gnu_io_CommPortIdentifier_debug 0L
12 | #undef gnu_io_CommPortIdentifier_PORT_SERIAL
13 | #define gnu_io_CommPortIdentifier_PORT_SERIAL 1L
14 | #undef gnu_io_CommPortIdentifier_PORT_PARALLEL
15 | #define gnu_io_CommPortIdentifier_PORT_PARALLEL 2L
16 | #undef gnu_io_CommPortIdentifier_PORT_I2C
17 | #define gnu_io_CommPortIdentifier_PORT_I2C 3L
18 | #undef gnu_io_CommPortIdentifier_PORT_RS485
19 | #define gnu_io_CommPortIdentifier_PORT_RS485 4L
20 | #undef gnu_io_CommPortIdentifier_PORT_RAW
21 | #define gnu_io_CommPortIdentifier_PORT_RAW 5L
22 | /*
23 | * Class: gnu_io_CommPortIdentifier
24 | * Method: native_psmisc_report_owner
25 | * Signature: (Ljava/lang/String;)Ljava/lang/String;
26 | */
27 | JNIEXPORT jstring JNICALL Java_gnu_io_CommPortIdentifier_native_1psmisc_1report_1owner(
28 | JNIEnv *, jobject, jstring);
29 |
30 | #ifdef __cplusplus
31 | }
32 | #endif
33 | #endif
34 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_I2C_I2CInputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_I2C_I2CInputStream */
4 |
5 | #ifndef _Included_gnu_io_I2C_I2CInputStream
6 | #define _Included_gnu_io_I2C_I2CInputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_I2C_I2CInputStream_MAX_SKIP_BUFFER_SIZE
11 | #define gnu_io_I2C_I2CInputStream_MAX_SKIP_BUFFER_SIZE 2048L
12 | #ifdef __cplusplus
13 | }
14 | #endif
15 | #endif
16 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_I2C_I2COutputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_I2C_I2COutputStream */
4 |
5 | #ifndef _Included_gnu_io_I2C_I2COutputStream
6 | #define _Included_gnu_io_I2C_I2COutputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 | #endif
14 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_I2C_MonitorThread.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_I2C_MonitorThread */
4 |
5 | #ifndef _Included_gnu_io_I2C_MonitorThread
6 | #define _Included_gnu_io_I2C_MonitorThread
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_I2C_MonitorThread_MIN_PRIORITY
11 | #define gnu_io_I2C_MonitorThread_MIN_PRIORITY 1L
12 | #undef gnu_io_I2C_MonitorThread_NORM_PRIORITY
13 | #define gnu_io_I2C_MonitorThread_NORM_PRIORITY 5L
14 | #undef gnu_io_I2C_MonitorThread_MAX_PRIORITY
15 | #define gnu_io_I2C_MonitorThread_MAX_PRIORITY 10L
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 | #endif
20 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_LPRPort.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_LPRPort */
4 |
5 | #ifndef _Included_gnu_io_LPRPort
6 | #define _Included_gnu_io_LPRPort
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_LPRPort_debug
11 | #define gnu_io_LPRPort_debug 0L
12 | #undef gnu_io_LPRPort_LPT_MODE_ANY
13 | #define gnu_io_LPRPort_LPT_MODE_ANY 0L
14 | #undef gnu_io_LPRPort_LPT_MODE_SPP
15 | #define gnu_io_LPRPort_LPT_MODE_SPP 1L
16 | #undef gnu_io_LPRPort_LPT_MODE_PS2
17 | #define gnu_io_LPRPort_LPT_MODE_PS2 2L
18 | #undef gnu_io_LPRPort_LPT_MODE_EPP
19 | #define gnu_io_LPRPort_LPT_MODE_EPP 3L
20 | #undef gnu_io_LPRPort_LPT_MODE_ECP
21 | #define gnu_io_LPRPort_LPT_MODE_ECP 4L
22 | #undef gnu_io_LPRPort_LPT_MODE_NIBBLE
23 | #define gnu_io_LPRPort_LPT_MODE_NIBBLE 5L
24 | #undef gnu_io_LPRPort_debug
25 | #define gnu_io_LPRPort_debug 0L
26 | /*
27 | * Class: gnu_io_LPRPort
28 | * Method: Initialize
29 | * Signature: ()V
30 | */
31 | JNIEXPORT void JNICALL Java_gnu_io_LPRPort_Initialize
32 | (JNIEnv *, jclass);
33 |
34 | /*
35 | * Class: gnu_io_LPRPort
36 | * Method: open
37 | * Signature: (Ljava/lang/String;)I
38 | */
39 | JNIEXPORT jint JNICALL Java_gnu_io_LPRPort_open(JNIEnv *, jobject, jstring);
40 |
41 | /*
42 | * Class: gnu_io_LPRPort
43 | * Method: setLPRMode
44 | * Signature: (I)Z
45 | */
46 | JNIEXPORT jboolean JNICALL Java_gnu_io_LPRPort_setLPRMode(JNIEnv *, jobject,
47 | jint);
48 |
49 | /*
50 | * Class: gnu_io_LPRPort
51 | * Method: isPaperOut
52 | * Signature: ()Z
53 | */
54 | JNIEXPORT jboolean JNICALL Java_gnu_io_LPRPort_isPaperOut(JNIEnv *, jobject);
55 |
56 | /*
57 | * Class: gnu_io_LPRPort
58 | * Method: isPrinterBusy
59 | * Signature: ()Z
60 | */
61 | JNIEXPORT jboolean JNICALL Java_gnu_io_LPRPort_isPrinterBusy(JNIEnv *, jobject);
62 |
63 | /*
64 | * Class: gnu_io_LPRPort
65 | * Method: isPrinterError
66 | * Signature: ()Z
67 | */
68 | JNIEXPORT jboolean JNICALL Java_gnu_io_LPRPort_isPrinterError(JNIEnv *, jobject);
69 |
70 | /*
71 | * Class: gnu_io_LPRPort
72 | * Method: isPrinterSelected
73 | * Signature: ()Z
74 | */
75 | JNIEXPORT jboolean JNICALL Java_gnu_io_LPRPort_isPrinterSelected(JNIEnv *,
76 | jobject);
77 |
78 | /*
79 | * Class: gnu_io_LPRPort
80 | * Method: isPrinterTimedOut
81 | * Signature: ()Z
82 | */
83 | JNIEXPORT jboolean JNICALL Java_gnu_io_LPRPort_isPrinterTimedOut(JNIEnv *,
84 | jobject);
85 |
86 | /*
87 | * Class: gnu_io_LPRPort
88 | * Method: nativeClose
89 | * Signature: ()V
90 | */
91 | JNIEXPORT void JNICALL Java_gnu_io_LPRPort_nativeClose
92 | (JNIEnv *, jobject);
93 |
94 | /*
95 | * Class: gnu_io_LPRPort
96 | * Method: setInputBufferSize
97 | * Signature: (I)V
98 | */
99 | JNIEXPORT void JNICALL Java_gnu_io_LPRPort_setInputBufferSize
100 | (JNIEnv *, jobject, jint);
101 |
102 | /*
103 | * Class: gnu_io_LPRPort
104 | * Method: getInputBufferSize
105 | * Signature: ()I
106 | */
107 | JNIEXPORT jint JNICALL Java_gnu_io_LPRPort_getInputBufferSize(JNIEnv *, jobject);
108 |
109 | /*
110 | * Class: gnu_io_LPRPort
111 | * Method: setOutputBufferSize
112 | * Signature: (I)V
113 | */
114 | JNIEXPORT void JNICALL Java_gnu_io_LPRPort_setOutputBufferSize
115 | (JNIEnv *, jobject, jint);
116 |
117 | /*
118 | * Class: gnu_io_LPRPort
119 | * Method: getOutputBufferSize
120 | * Signature: ()I
121 | */
122 | JNIEXPORT jint JNICALL Java_gnu_io_LPRPort_getOutputBufferSize(JNIEnv *,
123 | jobject);
124 |
125 | /*
126 | * Class: gnu_io_LPRPort
127 | * Method: getOutputBufferFree
128 | * Signature: ()I
129 | */
130 | JNIEXPORT jint JNICALL Java_gnu_io_LPRPort_getOutputBufferFree(JNIEnv *,
131 | jobject);
132 |
133 | /*
134 | * Class: gnu_io_LPRPort
135 | * Method: writeByte
136 | * Signature: (I)V
137 | */
138 | JNIEXPORT void JNICALL Java_gnu_io_LPRPort_writeByte
139 | (JNIEnv *, jobject, jint);
140 |
141 | /*
142 | * Class: gnu_io_LPRPort
143 | * Method: writeArray
144 | * Signature: ([BII)V
145 | */
146 | JNIEXPORT void JNICALL Java_gnu_io_LPRPort_writeArray
147 | (JNIEnv *, jobject, jbyteArray, jint, jint);
148 |
149 | /*
150 | * Class: gnu_io_LPRPort
151 | * Method: drain
152 | * Signature: ()V
153 | */
154 | JNIEXPORT void JNICALL Java_gnu_io_LPRPort_drain
155 | (JNIEnv *, jobject);
156 |
157 | /*
158 | * Class: gnu_io_LPRPort
159 | * Method: nativeavailable
160 | * Signature: ()I
161 | */
162 | JNIEXPORT jint JNICALL Java_gnu_io_LPRPort_nativeavailable(JNIEnv *, jobject);
163 |
164 | /*
165 | * Class: gnu_io_LPRPort
166 | * Method: readByte
167 | * Signature: ()I
168 | */
169 | JNIEXPORT jint JNICALL Java_gnu_io_LPRPort_readByte(JNIEnv *, jobject);
170 |
171 | /*
172 | * Class: gnu_io_LPRPort
173 | * Method: readArray
174 | * Signature: ([BII)I
175 | */
176 | JNIEXPORT jint JNICALL Java_gnu_io_LPRPort_readArray(JNIEnv *, jobject,
177 | jbyteArray, jint, jint);
178 |
179 | /*
180 | * Class: gnu_io_LPRPort
181 | * Method: eventLoop
182 | * Signature: ()V
183 | */
184 | JNIEXPORT void JNICALL Java_gnu_io_LPRPort_eventLoop
185 | (JNIEnv *, jobject);
186 |
187 | #ifdef __cplusplus
188 | }
189 | #endif
190 | #endif
191 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_LPRPort_MonitorThread.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_LPRPort_MonitorThread */
4 |
5 | #ifndef _Included_gnu_io_LPRPort_MonitorThread
6 | #define _Included_gnu_io_LPRPort_MonitorThread
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_LPRPort_MonitorThread_MIN_PRIORITY
11 | #define gnu_io_LPRPort_MonitorThread_MIN_PRIORITY 1L
12 | #undef gnu_io_LPRPort_MonitorThread_NORM_PRIORITY
13 | #define gnu_io_LPRPort_MonitorThread_NORM_PRIORITY 5L
14 | #undef gnu_io_LPRPort_MonitorThread_MAX_PRIORITY
15 | #define gnu_io_LPRPort_MonitorThread_MAX_PRIORITY 10L
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 | #endif
20 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_LPRPort_ParallelInputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_LPRPort_ParallelInputStream */
4 |
5 | #ifndef _Included_gnu_io_LPRPort_ParallelInputStream
6 | #define _Included_gnu_io_LPRPort_ParallelInputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_LPRPort_ParallelInputStream_MAX_SKIP_BUFFER_SIZE
11 | #define gnu_io_LPRPort_ParallelInputStream_MAX_SKIP_BUFFER_SIZE 2048L
12 | #ifdef __cplusplus
13 | }
14 | #endif
15 | #endif
16 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_LPRPort_ParallelOutputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_LPRPort_ParallelOutputStream */
4 |
5 | #ifndef _Included_gnu_io_LPRPort_ParallelOutputStream
6 | #define _Included_gnu_io_LPRPort_ParallelOutputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 | #endif
14 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_ParallelPort.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_ParallelPort */
4 |
5 | #ifndef _Included_gnu_io_ParallelPort
6 | #define _Included_gnu_io_ParallelPort
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_ParallelPort_debug
11 | #define gnu_io_ParallelPort_debug 0L
12 | #undef gnu_io_ParallelPort_LPT_MODE_ANY
13 | #define gnu_io_ParallelPort_LPT_MODE_ANY 0L
14 | #undef gnu_io_ParallelPort_LPT_MODE_SPP
15 | #define gnu_io_ParallelPort_LPT_MODE_SPP 1L
16 | #undef gnu_io_ParallelPort_LPT_MODE_PS2
17 | #define gnu_io_ParallelPort_LPT_MODE_PS2 2L
18 | #undef gnu_io_ParallelPort_LPT_MODE_EPP
19 | #define gnu_io_ParallelPort_LPT_MODE_EPP 3L
20 | #undef gnu_io_ParallelPort_LPT_MODE_ECP
21 | #define gnu_io_ParallelPort_LPT_MODE_ECP 4L
22 | #undef gnu_io_ParallelPort_LPT_MODE_NIBBLE
23 | #define gnu_io_ParallelPort_LPT_MODE_NIBBLE 5L
24 | #ifdef __cplusplus
25 | }
26 | #endif
27 | #endif
28 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_RS485_MonitorThread.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RS485_MonitorThread */
4 |
5 | #ifndef _Included_gnu_io_RS485_MonitorThread
6 | #define _Included_gnu_io_RS485_MonitorThread
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_RS485_MonitorThread_MIN_PRIORITY
11 | #define gnu_io_RS485_MonitorThread_MIN_PRIORITY 1L
12 | #undef gnu_io_RS485_MonitorThread_NORM_PRIORITY
13 | #define gnu_io_RS485_MonitorThread_NORM_PRIORITY 5L
14 | #undef gnu_io_RS485_MonitorThread_MAX_PRIORITY
15 | #define gnu_io_RS485_MonitorThread_MAX_PRIORITY 10L
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 | #endif
20 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_RS485_RS485InputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RS485_RS485InputStream */
4 |
5 | #ifndef _Included_gnu_io_RS485_RS485InputStream
6 | #define _Included_gnu_io_RS485_RS485InputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_RS485_RS485InputStream_MAX_SKIP_BUFFER_SIZE
11 | #define gnu_io_RS485_RS485InputStream_MAX_SKIP_BUFFER_SIZE 2048L
12 | #ifdef __cplusplus
13 | }
14 | #endif
15 | #endif
16 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_RS485_RS485OutputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RS485_RS485OutputStream */
4 |
5 | #ifndef _Included_gnu_io_RS485_RS485OutputStream
6 | #define _Included_gnu_io_RS485_RS485OutputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 | #endif
14 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_RXTXCommDriver.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RXTXCommDriver */
4 |
5 | #ifndef _Included_gnu_io_RXTXCommDriver
6 | #define _Included_gnu_io_RXTXCommDriver
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_RXTXCommDriver_debug
11 | #define gnu_io_RXTXCommDriver_debug 0L
12 | #undef gnu_io_RXTXCommDriver_devel
13 | #define gnu_io_RXTXCommDriver_devel 0L
14 | /*
15 | * Class: gnu_io_RXTXCommDriver
16 | * Method: registerKnownPorts
17 | * Signature: (I)Z
18 | */
19 | JNIEXPORT jboolean JNICALL Java_gnu_io_RXTXCommDriver_registerKnownPorts(
20 | JNIEnv *, jobject, jint);
21 |
22 | /*
23 | * Class: gnu_io_RXTXCommDriver
24 | * Method: isPortPrefixValid
25 | * Signature: (Ljava/lang/String;)Z
26 | */
27 | JNIEXPORT jboolean JNICALL Java_gnu_io_RXTXCommDriver_isPortPrefixValid(
28 | JNIEnv *, jobject, jstring);
29 |
30 | /*
31 | * Class: gnu_io_RXTXCommDriver
32 | * Method: testRead
33 | * Signature: (Ljava/lang/String;I)Z
34 | */
35 | JNIEXPORT jboolean JNICALL Java_gnu_io_RXTXCommDriver_testRead(JNIEnv *,
36 | jobject, jstring, jint);
37 |
38 | /*
39 | * Class: gnu_io_RXTXCommDriver
40 | * Method: getDeviceDirectory
41 | * Signature: ()Ljava/lang/String;
42 | */
43 | JNIEXPORT jstring JNICALL Java_gnu_io_RXTXCommDriver_getDeviceDirectory(
44 | JNIEnv *, jobject);
45 |
46 | /*
47 | * Class: gnu_io_RXTXCommDriver
48 | * Method: nativeGetVersion
49 | * Signature: ()Ljava/lang/String;
50 | */
51 | JNIEXPORT jstring JNICALL Java_gnu_io_RXTXCommDriver_nativeGetVersion(JNIEnv *,
52 | jclass);
53 |
54 | #ifdef __cplusplus
55 | }
56 | #endif
57 | #endif
58 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_RXTXPort_MonitorThread.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RXTXPort_MonitorThread */
4 |
5 | #ifndef _Included_gnu_io_RXTXPort_MonitorThread
6 | #define _Included_gnu_io_RXTXPort_MonitorThread
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_RXTXPort_MonitorThread_MIN_PRIORITY
11 | #define gnu_io_RXTXPort_MonitorThread_MIN_PRIORITY 1L
12 | #undef gnu_io_RXTXPort_MonitorThread_NORM_PRIORITY
13 | #define gnu_io_RXTXPort_MonitorThread_NORM_PRIORITY 5L
14 | #undef gnu_io_RXTXPort_MonitorThread_MAX_PRIORITY
15 | #define gnu_io_RXTXPort_MonitorThread_MAX_PRIORITY 10L
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 | #endif
20 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_RXTXPort_SerialInputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RXTXPort_SerialInputStream */
4 |
5 | #ifndef _Included_gnu_io_RXTXPort_SerialInputStream
6 | #define _Included_gnu_io_RXTXPort_SerialInputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_RXTXPort_SerialInputStream_MAX_SKIP_BUFFER_SIZE
11 | #define gnu_io_RXTXPort_SerialInputStream_MAX_SKIP_BUFFER_SIZE 2048L
12 | #ifdef __cplusplus
13 | }
14 | #endif
15 | #endif
16 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_RXTXPort_SerialOutputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RXTXPort_SerialOutputStream */
4 |
5 | #ifndef _Included_gnu_io_RXTXPort_SerialOutputStream
6 | #define _Included_gnu_io_RXTXPort_SerialOutputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 | #endif
14 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_RXTXVersion.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_RXTXVersion */
4 |
5 | #ifndef _Included_gnu_io_RXTXVersion
6 | #define _Included_gnu_io_RXTXVersion
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | /*
11 | * Class: gnu_io_RXTXVersion
12 | * Method: nativeGetVersion
13 | * Signature: ()Ljava/lang/String;
14 | */
15 | JNIEXPORT jstring JNICALL Java_gnu_io_RXTXVersion_nativeGetVersion(JNIEnv *,
16 | jclass);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 | #endif
22 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_Raw_MonitorThread.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_Raw_MonitorThread */
4 |
5 | #ifndef _Included_gnu_io_Raw_MonitorThread
6 | #define _Included_gnu_io_Raw_MonitorThread
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_Raw_MonitorThread_MIN_PRIORITY
11 | #define gnu_io_Raw_MonitorThread_MIN_PRIORITY 1L
12 | #undef gnu_io_Raw_MonitorThread_NORM_PRIORITY
13 | #define gnu_io_Raw_MonitorThread_NORM_PRIORITY 5L
14 | #undef gnu_io_Raw_MonitorThread_MAX_PRIORITY
15 | #define gnu_io_Raw_MonitorThread_MAX_PRIORITY 10L
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 | #endif
20 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_Raw_RawInputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_Raw_RawInputStream */
4 |
5 | #ifndef _Included_gnu_io_Raw_RawInputStream
6 | #define _Included_gnu_io_Raw_RawInputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_Raw_RawInputStream_MAX_SKIP_BUFFER_SIZE
11 | #define gnu_io_Raw_RawInputStream_MAX_SKIP_BUFFER_SIZE 2048L
12 | #ifdef __cplusplus
13 | }
14 | #endif
15 | #endif
16 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_Raw_RawOutputStream.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_Raw_RawOutputStream */
4 |
5 | #ifndef _Included_gnu_io_Raw_RawOutputStream
6 | #define _Included_gnu_io_Raw_RawOutputStream
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 | #endif
14 |
--------------------------------------------------------------------------------
/native/src/include/gnu_io_Zystem.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class gnu_io_Zystem */
4 |
5 | #ifndef _Included_gnu_io_Zystem
6 | #define _Included_gnu_io_Zystem
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef gnu_io_Zystem_SILENT_MODE
11 | #define gnu_io_Zystem_SILENT_MODE 0L
12 | #undef gnu_io_Zystem_FILE_MODE
13 | #define gnu_io_Zystem_FILE_MODE 1L
14 | #undef gnu_io_Zystem_NET_MODE
15 | #define gnu_io_Zystem_NET_MODE 2L
16 | #undef gnu_io_Zystem_MEX_MODE
17 | #define gnu_io_Zystem_MEX_MODE 3L
18 | #undef gnu_io_Zystem_PRINT_MODE
19 | #define gnu_io_Zystem_PRINT_MODE 4L
20 | #undef gnu_io_Zystem_J2EE_MSG_MODE
21 | #define gnu_io_Zystem_J2EE_MSG_MODE 5L
22 | #undef gnu_io_Zystem_J2SE_LOG_MODE
23 | #define gnu_io_Zystem_J2SE_LOG_MODE 6L
24 | #ifdef __cplusplus
25 | }
26 | #endif
27 | #endif
28 |
--------------------------------------------------------------------------------
/native/src/init.c:
--------------------------------------------------------------------------------
1 | /* init.c is used for compiling dll's with lcc. More info in Makefile.lcc */
2 |
3 | #ifdef _WIN32
4 | #include
5 | #include
6 |
7 | /**
8 | * Lcc requuires that there should be LibraryMain function and seeks
9 | * by default for LibMain. This might be someway not usefull for jni
10 | * interface it satisfies lcc linker.
11 | */
12 | BOOL WINAPI __declspec(dllexport) LibMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved) {
13 | return TRUE;
14 | }
15 |
16 | /**
17 | * This is the standart implementation of Java 2 OnLoad and OnUnload native
18 | * library calls. This template defines them empty functions
19 | *
20 | * Now in SerialImp.c
21 | */
22 | /*
23 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { return JNI_VERSION_1_2; }
24 | JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {}
25 | */
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/native/src/init.cc:
--------------------------------------------------------------------------------
1 | #include
2 | /*
3 | extern "C"
4 | { int WINAPI dll_entry (HANDLE handke, DWORD dword, void *var); };
5 | int WINAPI dll_entry (HANDLE , DWORD dword, void *)
6 | { return 1; }
7 | */
8 | #ifdef __CYGWIN32__
9 |
10 | struct _reent *_impure_ptr;
11 | extern struct _reent *__imp_reent_data;
12 | #endif
13 |
14 | extern "C" {
15 | int WINAPI dll_entry (HANDLE h, DWORD reason, void *ptr);
16 | }
17 | ;
18 |
19 | int WINAPI dll_entry (HANDLE ,
20 | DWORD reason,
21 | void *)
22 | {
23 | #ifdef __CYGWIN32__
24 | _impure_ptr = __imp_reent_data;
25 | #endif
26 |
27 | switch (reason)
28 | {
29 | case DLL_PROCESS_ATTACH:
30 | break;
31 | case DLL_PROCESS_DETACH:
32 | break;
33 | case DLL_THREAD_ATTACH:
34 | break;
35 | case DLL_THREAD_DETACH:
36 | break;
37 | }
38 | return 1;
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/native/src/lfd/INSTALL:
--------------------------------------------------------------------------------
1 | /*-------------------------------------------------------------------------
2 | | RXTX License v 2.1 - LGPL v 2.1 + Linking Over Controlled Interface.
3 | | RXTX is a native interface to serial ports in java.
4 | | Copyright 2002-2007 by Trent Jarvi tjarvi@qbang.org and others who
5 | | actually wrote it. See individual source files for more information.
6 | |
7 | | A copy of the LGPL v 2.1 may be found at
8 | | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is
9 | | here for your convenience.
10 | |
11 | | This library is free software; you can redistribute it and/or
12 | | modify it under the terms of the GNU Lesser General Public
13 | | License as published by the Free Software Foundation; either
14 | | version 2.1 of the License, or (at your option) any later version.
15 | |
16 | | This library is distributed in the hope that it will be useful,
17 | | but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 | | Lesser General Public License for more details.
20 | |
21 | | An executable that contains no derivative of any portion of RXTX, but
22 | | is designed to work with RXTX by being dynamically linked with it,
23 | | is considered a "work that uses the Library" subject to the terms and
24 | | conditions of the GNU Lesser General Public License.
25 | |
26 | | The following has been added to the RXTX License to remove
27 | | any confusion about linking to RXTX. We want to allow in part what
28 | | section 5, paragraph 2 of the LGPL does not permit in the special
29 | | case of linking over a controlled interface. The intent is to add a
30 | | Java Specification Request or standards body defined interface in the
31 | | future as another exception but one is not currently available.
32 | |
33 | | http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
34 | |
35 | | As a special exception, the copyright holders of RXTX give you
36 | | permission to link RXTX with independent modules that communicate with
37 | | RXTX solely through the Sun Microsytems CommAPI interface version 2,
38 | | regardless of the license terms of these independent modules, and to copy
39 | | and distribute the resulting combined work under terms of your choice,
40 | | provided that every copy of the combined work is accompanied by a complete
41 | | copy of the source code of RXTX (the version of RXTX used to produce the
42 | | combined work), being distributed under the terms of the GNU Lesser General
43 | | Public License plus this exception. An independent module is a
44 | | module which is not derived from or based on RXTX.
45 | |
46 | | Note that people who make modified versions of RXTX are not obligated
47 | | to grant this special exception for their modified versions; it is
48 | | their choice whether to do so. The GNU Lesser General Public License
49 | | gives permission to release a modified version without this exception; this
50 | | exception also makes it possible to release a modified version which
51 | | carries forward this exception.
52 | |
53 | | You should have received a copy of the GNU Lesser General Public
54 | | License along with this library; if not, write to the Free
55 | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56 | | All trademarks belong to their respective owners.
57 | --------------------------------------------------------------------------*/
58 | 1. BUILDING LFD
59 |
60 | In the src/lfd directory edit lockdaemon.c and specify the following defines:
61 |
62 | #define LOCK fhs_lock
63 | #define UNLOCK fhs_unlock
64 | #define LOCKDIR "/var/lock"
65 |
66 | LOCK may be fhs_lock (linux) or uucp_lock (Solaris)
67 | UNLOCK may be fhs_unlock (Linux) or fhs_unlock (Solaris)
68 | LOCkDIR may be /var/lock (Linux) or /var/spool/lock (Solaris)
69 |
70 | After setting up the defines type make to build lfd.
71 |
72 | 2. INSTALLING.
73 |
74 | daemons are usually placed in the /usr/sbin directory.
75 | in.lfd will need to be setup for inetd or xinetd support.
76 |
77 | 2.1 xinetd support on RedHat Linux:
78 |
79 | edit /etc/services and add the following lines:
80 |
81 | lockfiled 50001/tcp # lock file daemon
82 | lockfiled 50001/ucp # lock file daemon
83 |
84 |
85 | create a file /etc/xinetd.d/lfd with the folowing contents:
86 |
87 | # default: on
88 | # description: The lockfiled server serves lockfiles; it uses \
89 | #
90 | service lfd
91 | {
92 | flags = REUSE
93 | socket_type = stream
94 | wait = no
95 | user = uucp
96 | server = /usr/sbin/in.lfd
97 | log_on_failure += USERID
98 | disable = no
99 | }
100 |
101 | 2.2 inetd support on Solaris:
102 |
103 | edit /etc/services and add the following lines:
104 |
105 | lfd 50001/tcp # lock file daemon
106 | lfd 50001/ucp # lock file daemon
107 |
108 | add the following line to /etc/inetd.conf
109 |
110 | lockfiled stream tcp nowait uucp /usr/sbin/in.lfd lfd
111 |
112 |
113 |
--------------------------------------------------------------------------------
/native/src/lfd/Makefile:
--------------------------------------------------------------------------------
1 | CC=gcc
2 | CFLAGS= -Wall -g
3 |
4 | all:
5 | $(CC) $(CFLAGS) lockdaemon.c -o lfd
6 | chown root:uucp lfd
7 | chmod 2755 lfd
8 |
--------------------------------------------------------------------------------
/native/src/psmisc/COPYING:
--------------------------------------------------------------------------------
1 | psmisc (fuser, killall and pstree) program code, documentation and
2 | auxiliary programs are
3 | Copyright 1993-1998 Werner Almesberger.
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms of parts of or the
7 | whole original or derived work are permitted provided that the
8 | original work is properly attributed to the author. The name of the
9 | author may not be used to endorse or promote products derived from
10 | this software without specific prior written permission. This work
11 | is provided "as is" and without any express or implied warranties.
12 |
--------------------------------------------------------------------------------
/native/src/psmisc/Makefile:
--------------------------------------------------------------------------------
1 | CC=cc
2 | CFLAGS=-O -D_GNU_SOURCE -Wall -Wno-parentheses -Wwrite-strings -Wpointer-arith
3 | REAL_CPP=/lib/cpp
4 | LIBDIR=/usr/lib
5 |
6 | all: libpsmisc.la testing
7 |
8 | testing: testing.c libpsmisc.la
9 | cp .libs/*so* .
10 | $(CC) $(CFLAGS) -L .libs -lpsmisc -o testing testing.c
11 | libpsmisc.la: fuser.c Makefile
12 | libtool --mode=compile $(CC) $(CFLAGS) -c fuser.c
13 | libtool --mode=link $(CC) $(CFLAGS) --version-info 1:0:1 -o libpsmisc.la -rpath $(LIBDIR) fuser.lo
14 |
15 | clean:
16 | rm -rf *.o .libs *~ core testing *.lo libps*
17 |
--------------------------------------------------------------------------------
/native/src/psmisc/README:
--------------------------------------------------------------------------------
1 | psmisc, version 18
2 | + _hacks_ to get a lib Trent Jarvi taj@parcelfarce.linux.theplanet.co.uk
3 | This is experimental work for rxtx.
4 | try testing /dev/tty1 to see whats up.
5 |
6 | get psmisc if you are interested in the real package
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | ==================
26 |
27 | This package contains four little utilities that use the proc FS:
28 |
29 | fuser identifies processes using files or sockets (similar to Sun's
30 | or SGI's fuser)
31 | killall kills processes by name, e.g. killall -HUP named
32 | pidof like killall, buts lists PIDs instead of killing processes
33 | pstree shows the currently running processes as a tree
34 |
35 | They should work with most recent kernels. Man pages are included.
36 |
37 | - Werner Almesberger
38 |
--------------------------------------------------------------------------------
/native/src/psmisc/testing.c:
--------------------------------------------------------------------------------
1 | extern void show_user(char[]);
2 |
3 | int main(int argc, char **argv) {
4 |
5 | if (argv[1])
6 | show_user(argv[1]);
7 | else
8 | show_user("/dev/tty1");
9 | exit(0);
10 | }
11 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'openmuc-jrxtx'
2 | include ":gnu-io", ":jrxtx", ":jrxtxWrapper"
3 |
--------------------------------------------------------------------------------