All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gnu.io.factory.SerialPortFactory Maven / Gradle / Ivy

Go to download

A fork of the RXTX library with a focus on ease of use and embeddability in other libraries.

There is a newer version: 5.2.1
Show newest version
package gnu.io.factory;

import gnu.io.NoSuchPortException;
import gnu.io.PortInUseException;
import gnu.io.SerialPort;
import gnu.io.UnsupportedCommOperationException;

public interface SerialPortFactory {

	/**
	 * Creates a {@link SerialPort} instance out of the given portName.
	 * @param portName The port's name to parse out whether to create a serial connection or a remote (rfc2217) connection.
	 * @param expectedClass The {@link SerialPort} class that is expected to return.
	 * @return The newly created and opened SerialPort.
	 * @throws PortInUseException
	 * @throws NoSuchPortException
	 * @throws UnsupportedCommOperationException
	 */
	 T createSerialPort(String portName, Class expectedClass)
			throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException;

	/**
	 * Creates a {@link SerialPort} instance out of the given portName.
	 * @param portName The port's name to parse out whether to create a serial connection or a remote (rfc2217) connection.
	 * @return The newly created and opened SerialPort.
	 * @throws PortInUseException
	 * @throws NoSuchPortException
	 * @throws UnsupportedCommOperationException
	 */
	SerialPort createSerialPort(String portName)
			throws PortInUseException, NoSuchPortException, UnsupportedCommOperationException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy