Package com.pi4j.io.serial
Class SerialFactory
- java.lang.Object
-
- com.pi4j.io.serial.SerialFactory
-
public class SerialFactory extends Object
This factory class provide a static method to create new 'Serial' instances.
Before using the Pi4J library, you need to ensure that the Java VM in configured with access to the following system libraries:
- pi4j
- wiringPi
This library depends on the wiringPi native system library. (developed by Gordon Henderson @ http://wiringpi.com/)
- Author:
- Robert Savage (http://www.savagehomeautomation.com)
- See Also:
Serial,SerialDataEvent,SerialDataEventListener, https://pi4j.com/
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SerialcreateInstance()Create New Serial instancestatic ExecutorServiceFactorygetExecutorServiceFactory()Return instance ofExecutorServiceFactory.static booleanisShutdown()This method returns TRUE if the serial controller has been shutdown.static voidsetExecutorServiceFactory(ExecutorServiceFactory executorServiceFactory)Sets defaultExecutorServiceFactory.static voidshutdown()This method can be called to forcefully shutdown all serial port monitoring, listening, and task threads/executors.
-
-
-
Method Detail
-
createInstance
public static Serial createInstance()
Create New Serial instance- Returns:
- Return a new Serial implementation instance.
-
getExecutorServiceFactory
public static ExecutorServiceFactory getExecutorServiceFactory()
Return instance of
ExecutorServiceFactory.Note: .
- Returns:
- Return a new GpioController impl instance.
-
setExecutorServiceFactory
public static void setExecutorServiceFactory(ExecutorServiceFactory executorServiceFactory)
Sets defaultExecutorServiceFactory.- Parameters:
executorServiceFactory- service factory instance
-
isShutdown
public static boolean isShutdown()
This method returns TRUE if the serial controller has been shutdown.- Returns:
- shutdown state
-
shutdown
public static void shutdown()
This method can be called to forcefully shutdown all serial port monitoring, listening, and task threads/executors.
-
-