net.solarnetwork.io.modbus.serial.SerialPortProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nifty-modbus-api Show documentation
Show all versions of nifty-modbus-api Show documentation
A delightful little Modbus library for Java.
/* ==================================================================
* SerialPortProvider.java - 2/12/2022 10:23:44 am
*
* Copyright 2022 SolarNetwork.net Dev Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
* ==================================================================
*/
package net.solarnetwork.io.modbus.serial;
/**
* A provider of {@link SerialPort} instances.
*
* @author matt
* @version 1.0
*/
@FunctionalInterface
public interface SerialPortProvider {
/**
* Get a serial port.
*
* @param name
* the device name of the serial port to get, such as
* {@literal /dev/ttyUSB0}, {@literal COM1}
* @return the serial port
*/
SerialPort getSerialPort(String name);
}