org.avineas.modbus.impl
public class ModbusReceiver extends FrameHandler implements java.lang.Runnable
Constructor and Description |
---|
ModbusReceiver(Channel channel,
long defaultTimeout) |
ModbusReceiver(Channel channel,
long defaultTimeout,
java.util.Map<java.lang.Integer,ModbusUnit> units)
Create a modbus receiver.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int id,
ModbusUnit unit)
Add a unit to our managed set.
|
void |
destroy()
Destroy this handler.
|
void |
join() |
void |
remove(ModbusUnit unit)
Remove a unit from our managed set.
|
void |
run()
The run method for handling incoming requests.
|
public ModbusReceiver(Channel channel, long defaultTimeout, java.util.Map<java.lang.Integer,ModbusUnit> units)
channel
- The channel to listen on for slave messagesdefaultTimeout
- The default time-out, as inter character delay in ms.units
- The units to initially definepublic ModbusReceiver(Channel channel, long defaultTimeout)
public void run()
run
in interface java.lang.Runnable
public void add(int id, ModbusUnit unit)
id
- The identification of the unit to addunit
- The unit to addpublic void remove(ModbusUnit unit)
unit
- The unit to remove@PreDestroy public void destroy() throws java.io.IOException
FrameHandler
destroy
in class FrameHandler
java.io.IOException
public void join() throws java.lang.InterruptedException
java.lang.InterruptedException