|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.wimpi.modbus.net.UDPMasterTerminal
class UDPMasterTerminal
Class implementing a UDPMasterTerminal.
| Field Summary | |
|---|---|
private boolean |
m_Active
|
protected InetAddress |
m_LocalAddress
|
private int |
m_LocalPort
|
protected ModbusUDPTransport |
m_ModbusTransport
|
protected InetAddress |
m_RemoteAddress
|
private int |
m_RemotePort
|
private DatagramSocket |
m_Socket
|
private int |
m_Timeout
|
| Constructor Summary | |
|---|---|
|
UDPMasterTerminal()
|
protected |
UDPMasterTerminal(InetAddress addr)
|
| Method Summary | |
|---|---|
void |
activate()
Activate this UDPTerminal. |
void |
deactivate()
Deactivates this UDPSlaveTerminal. |
InetAddress |
getLocalAddress()
Returns the local address of this UDPTerminal. |
int |
getLocalPort()
Returns the local port of this UDPTerminal. |
ModbusUDPTransport |
getModbusTransport()
Returns the ModbusTransport associated with this TCPMasterConnection. |
InetAddress |
getRemoteAddress()
Returns the destination InetAddress of this UDPSlaveTerminal. |
int |
getRemotePort()
Returns the destination port of this UDPSlaveTerminal. |
int |
getTimeout()
Returns the timeout for this UDPMasterTerminal. |
boolean |
isActive()
Tests if this UDPSlaveTerminal is active. |
byte[] |
receiveMessage()
Receives and returns a message. |
void |
receiveMessage(byte[] buffer)
|
void |
sendMessage(byte[] msg)
Sends the given message. |
void |
setLocalAddress(InetAddress addr)
|
protected void |
setLocalPort(int port)
|
void |
setRemoteAddress(InetAddress adr)
Sets the destination InetAddress of this UDPSlaveTerminal. |
void |
setRemotePort(int port)
Sets the destination port of this UDPSlaveTerminal. |
void |
setTimeout(int timeout)
Sets the timeout for this UDPMasterTerminal. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private DatagramSocket m_Socket
private int m_Timeout
private boolean m_Active
protected InetAddress m_LocalAddress
protected InetAddress m_RemoteAddress
private int m_RemotePort
private int m_LocalPort
protected ModbusUDPTransport m_ModbusTransport
| Constructor Detail |
|---|
public UDPMasterTerminal()
protected UDPMasterTerminal(InetAddress addr)
| Method Detail |
|---|
public InetAddress getLocalAddress()
UDPTerminal
getLocalAddress in interface UDPTerminalpublic void setLocalAddress(InetAddress addr)
public int getLocalPort()
UDPTerminal
getLocalPort in interface UDPTerminalprotected void setLocalPort(int port)
public int getRemotePort()
public void setRemotePort(int port)
port - the port number as int.public InetAddress getRemoteAddress()
public void setRemoteAddress(InetAddress adr)
adr - the destination address as InetAddress.public boolean isActive()
isActive in interface UDPTerminal
public void activate()
throws Exception
activate in interface UDPTerminalException - if there is a network failure.public void deactivate()
deactivate in interface UDPTerminalpublic ModbusUDPTransport getModbusTransport()
getModbusTransport in interface UDPTerminalpublic int getTimeout()
public void setTimeout(int timeout)
timeout - the timeout as int.
public void sendMessage(byte[] msg)
throws Exception
UDPTerminal
sendMessage in interface UDPTerminalmsg - the message as byte[].
Exception - if sending the message fails.
public byte[] receiveMessage()
throws Exception
UDPTerminal
receiveMessage in interface UDPTerminalException - if receiving a message fails.
public void receiveMessage(byte[] buffer)
throws Exception
Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||