Module diozero.provider.remote
Class GrpcClientDeviceFactory
java.lang.Object
com.diozero.internal.spi.AbstractDeviceFactory
com.diozero.internal.spi.BaseNativeDeviceFactory
com.diozero.internal.provider.remote.grpc.GrpcClientDeviceFactory
- All Implemented Interfaces:
AnalogInputDeviceFactoryInterface,AnalogOutputDeviceFactoryInterface,DeviceFactoryInterface,GpioDeviceFactoryInterface,I2CDeviceFactoryInterface,NativeDeviceFactoryInterface,PwmOutputDeviceFactoryInterface,SerialDeviceFactoryInterface,ServoDeviceFactoryInterface,SpiDeviceFactoryInterface,AutoCloseable
-
Field Summary
FieldsFields inherited from class com.diozero.internal.spi.AbstractDeviceFactory
closed, deviceStatesFields inherited from interface com.diozero.internal.spi.I2CDeviceFactoryInterface
I2C_PREFIXFields inherited from interface com.diozero.internal.spi.SerialDeviceFactoryInterface
SERIAL_PREFIXFields inherited from interface com.diozero.internal.spi.SpiDeviceFactoryInterface
DEFAULT_SPI_BUFFER_SIZE, SPI_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionGrpcClientDeviceFactory(String hostname) GrpcClientDeviceFactory(String hostname, int port) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(AnalogInputEvent event) voidaccept(DigitalInputEvent event) createAnalogInputDevice(String key, PinInfo pinInfo) createAnalogOutputDevice(String key, PinInfo pinInfo, float initialValue) createDigitalInputDevice(String key, PinInfo pinInfo, GpioPullUpDown pud, GpioEventTrigger trigger) createDigitalInputOutputDevice(String key, PinInfo pinInfo, DeviceMode mode) createDigitalOutputDevice(String key, PinInfo pinInfo, boolean initialValue) createI2CDevice(String key, int controller, int address, I2CConstants.AddressSize addressSize) createPwmOutputDevice(String key, PinInfo pinInfo, int pwmFrequency, float initialValue) createSerialDevice(String key, String deviceFile, int baud, SerialConstants.DataBits dataBits, SerialConstants.StopBits stopBits, SerialConstants.Parity parity, boolean readBlocking, int minReadChars, int readTimeoutMillis) createServoDevice(String key, PinInfo pinInfo, int pwmFrequency, int minPulseWidthUs, int maxPulseWidthUs, int initialPulseWidthUs) createSpiDevice(String key, int controller, int chipSelect, int frequency, SpiClockMode spiClockMode, boolean lsbFirst) intintfloatgetGpioMode(int gpio) intgetGpioValue(int gpio) intgetI2CFunctionalities(int controller) getName()intprotected BoardInfovoidsetBoardPwmFrequency(int frequency) voidsetBoardServoFrequency(int frequency) voidshutdown()Methods inherited from class com.diozero.internal.spi.BaseNativeDeviceFactory
close, getBoardInfo, getBoardPinInfo, getVRef, provisionServoDevice, registerDeviceFactoryMethods inherited from class com.diozero.internal.spi.AbstractDeviceFactory
createI2CKey, createPinKey, createPwmPinKey, createSerialKey, createServoPinKey, createSpiKey, deviceClosed, deviceOpened, getDevice, isClosed, isDeviceOpened, reopenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.diozero.internal.spi.AnalogInputDeviceFactoryInterface
provisionAnalogInputDeviceMethods inherited from interface com.diozero.internal.spi.AnalogOutputDeviceFactoryInterface
provisionAnalogOutputDeviceMethods inherited from interface com.diozero.internal.spi.DeviceFactoryInterface
createI2CKey, createPinKey, createPwmPinKey, createSerialKey, createServoPinKey, createSpiKey, deviceClosed, deviceOpened, getDevice, isClosed, isDeviceOpened, reopen, startMethods inherited from interface com.diozero.internal.spi.GpioDeviceFactoryInterface
provisionDigitalInputDevice, provisionDigitalInputOutputDevice, provisionDigitalOutputDeviceMethods inherited from interface com.diozero.internal.spi.I2CDeviceFactoryInterface
provisionI2CDeviceMethods inherited from interface com.diozero.internal.spi.PwmOutputDeviceFactoryInterface
provisionPwmOutputDeviceMethods inherited from interface com.diozero.internal.spi.SerialDeviceFactoryInterface
provisionSerialDeviceMethods inherited from interface com.diozero.internal.spi.SpiDeviceFactoryInterface
provisionSpiDevice
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
GrpcClientDeviceFactory
public GrpcClientDeviceFactory() -
GrpcClientDeviceFactory
-
GrpcClientDeviceFactory
-
-
Method Details
-
getServerHostname
-
shutdown
public void shutdown()- Specified by:
shutdownin classBaseNativeDeviceFactory
-
getName
-
lookupBoardInfo
- Overrides:
lookupBoardInfoin classBaseNativeDeviceFactory
-
getBoardPwmFrequency
public int getBoardPwmFrequency() -
setBoardPwmFrequency
public void setBoardPwmFrequency(int frequency) -
getBoardServoFrequency
public int getBoardServoFrequency() -
setBoardServoFrequency
public void setBoardServoFrequency(int frequency) -
getSpiBufferSize
public int getSpiBufferSize() -
getGpioMode
-
getGpioValue
public int getGpioValue(int gpio) -
getCpuTemperature
public float getCpuTemperature()- Specified by:
getCpuTemperaturein interfaceNativeDeviceFactoryInterface- Overrides:
getCpuTemperaturein classBaseNativeDeviceFactory
-
getI2CBusNumbers
-
getI2CFunctionalities
public int getI2CFunctionalities(int controller) -
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 InternalPwmOutputDeviceInterface createPwmOutputDevice(String key, PinInfo pinInfo, int pwmFrequency, float initialValue) -
createServoDevice
public InternalServoDeviceInterface createServoDevice(String key, PinInfo pinInfo, int pwmFrequency, int minPulseWidthUs, int maxPulseWidthUs, int initialPulseWidthUs) -
createAnalogInputDevice
-
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
-
accept
-