public class BridgeModbusTcpImpl extends AbstractModbusBridge implements BridgeModbus, BridgeModbusTcp, OpenemsComponent, org.osgi.service.event.EventHandler
Modifier and Type | Class and Description |
---|---|
static class |
BridgeModbusTcpImpl.ChannelId |
DEFAULT_RETRIES, DEFAULT_TIMEOUT
Constructor and Description |
---|
BridgeModbusTcpImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context,
io.openems.edge.bridge.modbus.ConfigTcp config) |
void |
closeModbusConnection()
Closes the Modbus connection.
|
protected void |
deactivate()
Handles @Deactivate of implementations.
|
java.net.InetAddress |
getIpAddress()
Gets the IP address.
|
com.ghgande.j2mod.modbus.io.ModbusTransaction |
getNewModbusTransaction()
Creates a new Modbus Transaction on an open Modbus connection.
|
void |
setIpAddress(java.net.InetAddress ipAddress) |
activate, addProtocol, getLogVerbosity, handleEvent, invalidateElementsAfterReadErrors, logError, logInfo, logWarn, removeProtocol
_channel, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, modified, removeChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_setCycleTimeIsTooShort, _setExecutionDuration, _setSlaveCommunicationFailed, addProtocol, getCycleTimeIsTooShort, getCycleTimeIsTooShortChannel, getExecutionDuration, getExecutionDurationChannel, getSlaveCommunicationFailed, getSlaveCommunicationFailedChannel, removeProtocol
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getModbusSlaveNatureTable, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid, updateConfigurationProperty, updateReferenceFilter
protected void activate(org.osgi.service.component.ComponentContext context, io.openems.edge.bridge.modbus.ConfigTcp config) throws java.net.UnknownHostException
java.net.UnknownHostException
protected void deactivate()
AbstractOpenemsComponent
deactivate
in class AbstractModbusBridge
public void closeModbusConnection()
AbstractModbusBridge
closeModbusConnection
in class AbstractModbusBridge
public com.ghgande.j2mod.modbus.io.ModbusTransaction getNewModbusTransaction() throws OpenemsException
AbstractModbusBridge
getNewModbusTransaction
in class AbstractModbusBridge
OpenemsException
- on errorpublic java.net.InetAddress getIpAddress()
BridgeModbusTcp
getIpAddress
in interface BridgeModbusTcp
public void setIpAddress(java.net.InetAddress ipAddress)