Class RemoteDeviceFactory
- java.lang.Object
-
- com.diozero.internal.spi.AbstractDeviceFactory
-
- com.diozero.internal.spi.BaseNativeDeviceFactory
-
- com.diozero.internal.provider.remote.devicefactory.RemoteDeviceFactory
-
- All Implemented Interfaces:
AnalogInputDeviceFactoryInterface,AnalogOutputDeviceFactoryInterface,DeviceFactoryInterface,GpioDeviceFactoryInterface,I2CDeviceFactoryInterface,NativeDeviceFactoryInterface,PwmOutputDeviceFactoryInterface,SerialDeviceFactoryInterface,SpiDeviceFactoryInterface,AutoCloseable
public class RemoteDeviceFactory extends BaseNativeDeviceFactory
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEVICE_NAME-
Fields inherited from class com.diozero.internal.spi.AbstractDeviceFactory
closed, deviceStates
-
Fields inherited from interface com.diozero.internal.spi.I2CDeviceFactoryInterface
I2C_PREFIX
-
Fields inherited from interface com.diozero.internal.spi.SerialDeviceFactoryInterface
SERIAL_PREFIX
-
Fields inherited from interface com.diozero.internal.spi.SpiDeviceFactoryInterface
DEFAULT_SPI_BUFFER_SIZE, SPI_PREFIX
-
-
Constructor Summary
Constructors Constructor Description RemoteDeviceFactory()
-
Method Summary
-
Methods inherited from class com.diozero.internal.spi.BaseNativeDeviceFactory
close, getBoardInfo, getBoardPinInfo, getVRef, registerDeviceFactory
-
Methods inherited from class com.diozero.internal.spi.AbstractDeviceFactory
createI2CKey, createPinKey, createSerialKey, createSpiKey, deviceClosed, deviceOpened, getDevice, isClosed, isDeviceOpened, reopen
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.diozero.internal.spi.AnalogInputDeviceFactoryInterface
provisionAnalogInputDevice
-
Methods inherited from interface com.diozero.internal.spi.AnalogOutputDeviceFactoryInterface
provisionAnalogOutputDevice
-
Methods inherited from interface com.diozero.internal.spi.DeviceFactoryInterface
createI2CKey, createPinKey, createSerialKey, createSpiKey, deviceClosed, deviceOpened, getDevice, isClosed, isDeviceOpened, reopen
-
Methods inherited from interface com.diozero.internal.spi.GpioDeviceFactoryInterface
provisionDigitalInputDevice, provisionDigitalInputOutputDevice, provisionDigitalOutputDevice
-
Methods inherited from interface com.diozero.internal.spi.I2CDeviceFactoryInterface
provisionI2CDevice
-
Methods inherited from interface com.diozero.internal.spi.PwmOutputDeviceFactoryInterface
provisionPwmOutputDevice
-
Methods inherited from interface com.diozero.internal.spi.SerialDeviceFactoryInterface
provisionSerialDevice
-
Methods inherited from interface com.diozero.internal.spi.SpiDeviceFactoryInterface
provisionSpiDevice
-
-
-
-
Field Detail
-
DEVICE_NAME
public static final String DEVICE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start()
-
shutdown
public void shutdown()
- Specified by:
shutdownin classBaseNativeDeviceFactory
-
getName
public String getName()
-
lookupBoardInfo
protected BoardInfo lookupBoardInfo()
- Overrides:
lookupBoardInfoin classBaseNativeDeviceFactory
-
getBoardPwmFrequency
public int getBoardPwmFrequency()
-
setBoardPwmFrequency
public void setBoardPwmFrequency(int frequency)
-
getSpiBufferSize
public int getSpiBufferSize()
-
createDigitalInputDevice
public GpioDigitalInputDeviceInterface createDigitalInputDevice(String key, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger)
-
createDigitalOutputDevice
public GpioDigitalOutputDeviceInterface createDigitalOutputDevice(String key, PinInfo pinInfo, boolean initialValue)
-
createDigitalInputOutputDevice
public GpioDigitalInputOutputDeviceInterface createDigitalInputOutputDevice(String key, PinInfo pinInfo, DeviceMode mode)
-
createPwmOutputDevice
public PwmOutputDeviceInterface createPwmOutputDevice(String key, PinInfo pinInfo, int pwmFrequency, float initialValue)
-
createAnalogInputDevice
public AnalogInputDeviceInterface createAnalogInputDevice(String key, PinInfo pinInfo)
-
createAnalogOutputDevice
public AnalogOutputDeviceInterface createAnalogOutputDevice(String key, PinInfo pinInfo, float initialValue)
-
createI2CDevice
public InternalI2CDeviceInterface createI2CDevice(String key, int controller, int address, I2CConstants.AddressSize addressSize) throws RuntimeIOException
- Throws:
RuntimeIOException
-
createSpiDevice
public InternalSpiDeviceInterface createSpiDevice(String key, int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst) throws RuntimeIOException
- Throws:
RuntimeIOException
-
createSerialDevice
public InternalSerialDeviceInterface createSerialDevice(String key, String deviceFile, int baud, SerialConstants.DataBits dataBits, SerialConstants.StopBits stopBits, SerialConstants.Parity parity, boolean readBlocking, int minReadChars, int readTimeoutMillis) throws RuntimeIOException
- Throws:
RuntimeIOException
-
accept
public void accept(DigitalInputEvent event)
-
accept
public void accept(AnalogInputEvent event)
-
-