Package io.openems.edge.bridge.modbus
Class BridgeModbusTcpImpl
java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.bridge.modbus.api.AbstractModbusBridge
io.openems.edge.bridge.modbus.BridgeModbusTcpImpl
- All Implemented Interfaces:
BridgeModbus
,BridgeModbusTcp
,OpenemsComponent
,org.osgi.service.event.EventHandler
public class BridgeModbusTcpImpl
extends AbstractModbusBridge
implements BridgeModbus, BridgeModbusTcp, OpenemsComponent, org.osgi.service.event.EventHandler
Provides a service for connecting to, querying and writing to a Modbus/TCP
device.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.openems.edge.bridge.modbus.api.BridgeModbus
BridgeModbus.ChannelId
Nested classes/interfaces inherited from interface io.openems.edge.bridge.modbus.api.BridgeModbusTcp
BridgeModbusTcp.ChannelId
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
Field Summary
Fields inherited from class io.openems.edge.bridge.modbus.api.AbstractModbusBridge
DEFAULT_RETRIES, DEFAULT_TIMEOUT, worker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Closes the Modbus connection.protected void
Handles @Deactivate of implementations.Gets the IP address.com.ghgande.j2mod.modbus.io.ModbusTransaction
Creates a new Modbus Transaction on an open Modbus connection.void
setIpAddress
(InetAddress ipAddress) Methods inherited from class io.openems.edge.bridge.modbus.api.AbstractModbusBridge
activate, activate, addProtocol, debugLog, getLogVerbosity, handleEvent, invalidateElementsAfterReadErrors, modified, modified, removeProtocol, retryModbusCommunication
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, removeChannel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.openems.edge.bridge.modbus.api.BridgeModbus
_setCycleDelay, _setCycleTimeIsTooShort, addProtocol, getCycleDelay, getCycleDelayChannel, getCycleTimeIsTooShort, getCycleTimeIsTooShortChannel, removeProtocol, retryModbusCommunication
Methods inherited from interface org.osgi.service.event.EventHandler
handleEvent
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
Constructor Details
-
BridgeModbusTcpImpl
public BridgeModbusTcpImpl()
-
-
Method Details
-
deactivate
protected void deactivate()Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractModbusBridge
-
closeModbusConnection
public void closeModbusConnection()Description copied from class:AbstractModbusBridge
Closes the Modbus connection.- Specified by:
closeModbusConnection
in classAbstractModbusBridge
-
getNewModbusTransaction
public com.ghgande.j2mod.modbus.io.ModbusTransaction getNewModbusTransaction() throws OpenemsExceptionDescription copied from class:AbstractModbusBridge
Creates a new Modbus Transaction on an open Modbus connection.- Specified by:
getNewModbusTransaction
in classAbstractModbusBridge
- Returns:
- the Modbus Transaction
- Throws:
OpenemsException
- on error
-
getIpAddress
Description copied from interface:BridgeModbusTcp
Gets the IP address.- Specified by:
getIpAddress
in interfaceBridgeModbusTcp
- Returns:
- the IP address
-
setIpAddress
-