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

gnu.io.SerialManager Maven / Gradle / Ivy

Go to download

Fork of the RXTX library with a focus on ease of use and the ability to embed in other libraries.

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

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SerialManager {

    private static final Logger LOGGER = LoggerFactory.getLogger(SerialManager.class);

    private static SerialManager instance;

    private static boolean loaded = false;

    private SerialManager() throws NativeResourceException {
        if (!loaded) {
            loaded = true;

            LOGGER.info("Load native library.");
            new NativeResource().load("libNRJavaSerial");
        }
    }

    public static SerialManager getInstance() throws NativeResourceException {
        if (instance == null) {
            instance = new SerialManager();
        }
        return instance;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy