|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The IUdpServerService is used to give a remote network UDP client access to a serial port or a local serial port device the ability to send data to a remote UDP listening port.
Field Summary | |
static java.lang.String |
DATATBITS_5
|
static java.lang.String |
DATATBITS_6
|
static java.lang.String |
DATATBITS_7
|
static java.lang.String |
DATATBITS_8
|
static java.lang.String |
PARALLEL_LP_DRIVER
|
static java.lang.String |
PARALLEL_USB_LP_DRIVER
|
static java.lang.String |
PARITY_EVEN
|
static java.lang.String |
PARITY_MARK
|
static java.lang.String |
PARITY_NONE
|
static java.lang.String |
PARITY_ODD
|
static java.lang.String |
PARITY_SPACE
|
static java.lang.String |
SERIAL_CUSTOM_DRIVER
|
static java.lang.String |
SERIAL_LINUX_DRIVER
|
static java.lang.String |
SERIAL_TO_UDP
|
static java.lang.String |
SERIAL_USB_DRIVER
|
static java.lang.String |
SERIAL_VIRTUALPAIR_DRIVER
|
static java.lang.String |
SERVICE_NAME
Reports the class name representing this interface. |
static java.lang.String |
STOPBITS_1
|
static java.lang.String |
STOPBITS_2
|
static java.lang.String |
UDP_MASTER
|
static java.lang.String |
UDP_SLAVE
|
static java.lang.String |
UDP_TO_SERIAL
|
Method Summary | |
void |
changeUdpServerBufferSize(int UdpServId,
int BufferSize)
This method modifies the BufferSize for a previously created UdpSever |
void |
changeUdpServerDemarkationMsec(int UdpServId,
int DemarkationMsec)
This method modifies the DemarkationMsec time limit of a previously created UdpServer. |
void |
changeUdpServerLocalAddress(int UdpServId,
java.lang.String LocalAddress)
This method modifies the TCP/IP dotted notation PeerAddress of a previously created UdpServer. |
void |
changeUdpServerOperation(int UdpServId,
java.lang.String Operation)
This method modifies the Operation mode of a previously created UdpServer. |
void |
changeUdpServerParallelPortDeviceDriver(int UdpServerId,
int ParallPortId,
java.lang.String DeviceDriver)
This method modifies the Device driver used in a previously created UdpServer. |
void |
changeUdpServerParallelPortEndDeviceIndex(int UdpServerId,
int ParallPortId,
int EndDeviceIndex)
This method modifies the EndDeviceIndex of parallel port for a previously created UdpServer. |
void |
changeUdpServerPeerAddress(int UdpServId,
java.lang.String PeerAddress)
This method modifies the TCP/IP dotted notation PeerAddress of a previously created UdpServer. |
void |
changeUdpServerPrimaryIpPort(int UdpServId,
int PrimaryIpPort)
This method modifies the PrimaryIpPort of a previously created UdpServer. |
void |
changeUdpServerSecondaryIpPort(int UdpServId,
int SecondaryIpPort)
This method modifies the SecondaryIpPort of a previously created UdpServer. |
int |
createUdpServer(java.lang.String sPeerAddress,
int iPrimaryIpPort,
java.lang.String LocalIpAddress,
int iSecondaryIpPort,
java.lang.String sOperation,
int iDemarkationMsec,
int iBufferSize)
Configure operating parameters for UDP Server minus the end device(s) parameters which use another method |
int |
createUdpServerParallelPort(int iUdpServerId,
java.lang.String sDeviceDriver,
int iEndDeviceIndex)
This method adds a parallel port to the UdpServer. |
int |
createUdpServerSerialPort(int iUdpServerId,
java.lang.String sDeviceDriver,
int iEndDeviceIndex,
int iBaudRate,
java.lang.String sParity,
java.lang.String sStopBits,
java.lang.String sDataBits,
int iWarmUpMSec,
int iWarmDownMSec,
boolean fCancelEchoChars)
This method adds a serial port to the UdpServer. |
void |
deleteUdpServerEndDevice(int iUdpServerId,
int iEndDeviceIndex)
This method will eliminate one of the attached end devices that was created for the selected (iUdpServerId) UdpServers. |
int |
getUdpServerBufferSize(int UdpServId)
This method returns the BufferSize for a previously created UdpSever |
int |
getUdpServerCount()
Get the current count of configured UDP Servers without guessing |
int |
getUdpServerDemarkationMsec(int UdpServId)
This method returns the DemarkationMsec time limit of a previously created UdpServer. |
int |
getUdpServerEndDeviceCount(int iUdpServerId)
This method will return the count of end devices added to a select UdpServer |
java.lang.String[] |
getUdpServerEndDeviceNames(int iUdpServerId)
This function returns an array of Strings. |
java.lang.String |
getUdpServerLocalAddress(int UdpServId)
This method returns the TCP/IP dotted notation PeerAddress of a previously created UdpServer. |
java.lang.String |
getUdpServerOperation(int UdpServId)
This method returns the Operation mode of a previously created UdpServer. |
java.lang.String |
getUdpServerParallelPortDeviceDriver(int UdpServerId,
int ParallPortId)
This method returns the Device driver used in a previously created UdpServer. |
int |
getUdpServerParallelPortEndDeviceIndex(int UdpServerId,
int ParallPortId)
This method returns the EndDeviceIndex of parallel port for a previously created UdpServer. |
java.lang.String |
getUdpServerPeerAddress(int UdpServId)
This method returns the TCP/IP dotted notation PeerAddress of a previously created UdpServer. |
int |
getUdpServerPrimaryIpPort(int UdpServId)
This method returns the PrimaryIpPort of a previously created UdpServer. |
int |
getUdpServerSecondaryIpPort(int UdpServId)
This method returns the SecondaryIpPort of a previously created UdpServer. |
void |
startUdpServerInstance(int iUdpServerId)
This method will attempt to start a new instance of UdpServer using the appropriate configuration parameters. |
void |
stopUdpServerInstance(int iUdpServerId)
This method will attempt to stop a previously running instance of UdpServer. |
Field Detail |
public static final java.lang.String SERVICE_NAME
public static final java.lang.String SERIAL_TO_UDP
public static final java.lang.String UDP_TO_SERIAL
public static final java.lang.String UDP_MASTER
public static final java.lang.String UDP_SLAVE
public static final java.lang.String SERIAL_LINUX_DRIVER
public static final java.lang.String SERIAL_CUSTOM_DRIVER
public static final java.lang.String SERIAL_VIRTUALPAIR_DRIVER
public static final java.lang.String SERIAL_USB_DRIVER
public static final java.lang.String PARALLEL_LP_DRIVER
public static final java.lang.String PARALLEL_USB_LP_DRIVER
public static final java.lang.String PARITY_NONE
public static final java.lang.String PARITY_EVEN
public static final java.lang.String PARITY_ODD
public static final java.lang.String PARITY_MARK
public static final java.lang.String PARITY_SPACE
public static final java.lang.String STOPBITS_1
public static final java.lang.String STOPBITS_2
public static final java.lang.String DATATBITS_5
public static final java.lang.String DATATBITS_6
public static final java.lang.String DATATBITS_7
public static final java.lang.String DATATBITS_8
Method Detail |
public int getUdpServerCount()
public int createUdpServer(java.lang.String sPeerAddress, int iPrimaryIpPort, java.lang.String LocalIpAddress, int iSecondaryIpPort, java.lang.String sOperation, int iDemarkationMsec, int iBufferSize) throws java.lang.Exception
sPeerAddress
- In UDP_TO_SERIAL or UDP_SLAVE mode this parameter is used to bind() to the listen socket. A value of 0.0.0.0 would listen for any clients UDP packets. A value of 192.168.1.5
would only listen for packets from 192.168.1.5. In SERIAL_TO_UDP or UDP_MASTER mode this parameter is use to create the sendto() socket.iPrimaryIpPort
- In UDP_TO_SERIAL or UDP_SLAVE mode this parameter is used to bind() to the listen socket. In SERIAL_TO_UDP or UDP_MASTER mode this parameter is used to create sendto()
socket.LocalIpAddress
- If Secondary port is not zero this this is the IP address used as the Source address of the outbound UDP packetiSecondaryIpPort
- In UDP_TO_SERIAL mode this parameter is not used. In UDP_SLAVE mode if this parameter is not zero then it is used as the port to forwarded serial packets at the last
Clients IP Address. If set to zero then the packets are returned to the same IP Port that the client used in its source port of the UDP packet. In SERIAL_TO_UDP or UDP_MASTER mode if
this value is not zero then the UDP packets source port is overridden to iSecondaryIpPort. If this value is zero then the source port will be set to 12345 + iUdpServerId.sOperation
- Use the service.UDP_TO_SERIAL to send packets from the network port to the serial port(s). Use the service.SERIAL_TO_UDP to send packets from the serial port(s) to the network
port. Use the service.UDP_MASTER when the ESF system is a UDP Master so packets are originated on the serial port and the ESF system waits on UDP Packets as replies. Use the
service.UDP_SLAVE when the ESF system is a UDP Slave so packets are originated on the network port and the ESF wait on serial packets as replies to go back to the network master.iDemarkationMsec
- This is used to determine when to stop building a payload of end device bytes and forward any previously received bytes to the TCP client in milliseconds.iBufferSize
- This is the maximum number of bytes that are to received from either the Client or the end device. If the buffer gets full then it is immediately returned to the other side
of the UdpServer.
java.lang.Exception
public void changeUdpServerPeerAddress(int UdpServId, java.lang.String PeerAddress) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().PeerAddress
- In UDP_TO_SERIAL or UDP_SLAVE mode this parameter is used to bind() to the listen socket. A value of 0.0.0.0 would listen for any clients UDP packets. A value of 192.168.1.5
would only listen for packets from 192.168.1.5. In SERIAL_TO_UDP or UDP_MASTER mode this parameter is use to create the sendto() socket.
java.lang.Exception
public void changeUdpServerLocalAddress(int UdpServId, java.lang.String LocalAddress) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().LocalAddress
- If the Secondary IP Port is not zero then this is the IP Address placed into the outbound UDP packet's 'source address'.
java.lang.Exception
public void changeUdpServerPrimaryIpPort(int UdpServId, int PrimaryIpPort) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().PrimaryIpPort
- In UDP_TO_SERIAL or UDP_SLAVE mode this parameter is used to bind() to the listen socket. In SERIAL_TO_UDP or UDP_MASTER mode this parameter is used to create sendto()
socket.
java.lang.Exception
public void changeUdpServerSecondaryIpPort(int UdpServId, int SecondaryIpPort) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().SecondaryIpPort
- In UDP_TO_SERIAL mode this parameter is not used. In UDP_SLAVE mode if this parameter is not zero then it is used as the port to forwarded serial packets at the last
Clients IP Address. If set to zero then the packets are returned to the same IP Port that the client used in its source port of the UDP packet. In SERIAL_TO_UDP or UDP_MASTER mode if
this value is not zero then the UDP packets source port is overridden to iSecondaryIpPort. If this value is zero then the source port will be set to 12345 + iUdpServerId.
java.lang.Exception
public void changeUdpServerOperation(int UdpServId, java.lang.String Operation) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().Operation
- Use the service.UDP_TO_SERIAL to send packets from the network port to the serial port(s). Use the service.SERIAL_TO_UDP to send packets from the serial port(s) to the network
port. Use the service.UDP_MASTER when the ESF system is a UDP Master so packets are originated on the serial port and the ESF system waits on UDP Packets as replies. Use the
service.UDP_SLAVE when the ESF system is a UDP Slave so packets are originated on the network port and the ESF wait on serial packets as replies to go back to the network master.
java.lang.Exception
public void changeUdpServerDemarkationMsec(int UdpServId, int DemarkationMsec) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().DemarkationMsec
- This is used to determine when to stop building a payload of end device bytes and forward any previously received bytes to the TCP client in milliseconds.
java.lang.Exception
public void changeUdpServerBufferSize(int UdpServId, int BufferSize) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().BufferSize
- This is the maximum number of bytes that are to received from either the Client or the end device. If the buffer gets full then it is immediately returned to the other side of
the UdpServer.
java.lang.Exception
public java.lang.String getUdpServerPeerAddress(int UdpServId) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().
java.lang.Exception
public java.lang.String getUdpServerLocalAddress(int UdpServId) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().
java.lang.Exception
public int getUdpServerPrimaryIpPort(int UdpServId) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().
java.lang.Exception
public int getUdpServerSecondaryIpPort(int UdpServId) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().
java.lang.Exception
public java.lang.String getUdpServerOperation(int UdpServId) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().
java.lang.Exception
public int getUdpServerDemarkationMsec(int UdpServId) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().
java.lang.Exception
public int getUdpServerBufferSize(int UdpServId) throws java.lang.Exception
UdpServId
- The index value returned by createUdpServer().
java.lang.Exception
public int createUdpServerSerialPort(int iUdpServerId, java.lang.String sDeviceDriver, int iEndDeviceIndex, int iBaudRate, java.lang.String sParity, java.lang.String sStopBits, java.lang.String sDataBits, int iWarmUpMSec, int iWarmDownMSec, boolean fCancelEchoChars) throws java.lang.Exception
iUdpServerId
- This should be on of the Id's that is returned by the createUdpServer() method. This value ranges from 0 to 'last UdpServerId'sDeviceDriver
- This is the device driver used for the end device. Use service.SERIAL_LINUX_DRIVER if you want to use the native Linux serial port (e.g. /dev/ttyS[0-12]). Use
service.SERIAL_CUSTOM_DRIVER if you want to use the EuroTech custom serial driver (e.g. /dev/acscomm[0-36]) Use service.SERIAL_USB_DRIVER if you want to use the native Linux driver
usb serial ports (e.g. /dev/ttyUSB[0-8]).iEndDeviceIndex
- This is the index that is appended to the root device name such as /dev/ttyS? /dev/acscomm? or in the case of virtual serial ports add 64 to /dev/acscomm and the pairs
would be [0,1], [2,3], [4,5] etc...iBaudRate
- This is the baud rate to be used on the serial device. Valid entries are... 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200.sParity
- This is the parity to be used on the serial port. Valid entries could be... service.PARITY_NONE, service.PARITY_EVEN, service.PARITY_ODD, service.PARITY_MARK,
service.PARITY_SPACE, and that's all folks.sStopBits
- This is the number of stop bits to be used on the serial device and can only be... service.STOPBITS_1 or service.STOPBITS_2.sDataBits
- This is the number of data bits in a character for the end devices. Valid entries... service.DATABITS_5 or service.DATABITS_6 or service.DATABITS_7 or service.DATABITS_8iWarmUpMSec
- This is the number of milliseconds used after raising RTS before sending a payload to the serial port.. If set to 0 then nothing is sent until CTS is true. If it is set to -1
then no handshaking is used on the serial port. Only available when using the SERIAL_CUSTOM_DRIVER.iWarmDownMSec
- This is the number of milliseconds to delay lowering RTS after the last byte leaves the serial port. Only available with the SERIAL_CUSTOM_DRIVER.fCancelEchoChars
- This will configure the serial port to not accept any bytes while it is transmitting. Only available with SERIAL_CUSTOM_DRIVER.
java.lang.Exception
public int createUdpServerParallelPort(int iUdpServerId, java.lang.String sDeviceDriver, int iEndDeviceIndex) throws java.lang.Exception
iUdpServerId
- This should be one of the Id's that is returned by the createUdpServer() method. This value ranges from 0 to 'last UdpServer Id'sDeviceDriver
- This is the device driver used for the end device. Use service.PARALLEL_LP_DRIVER is you want to use the native Linux parallel port driver (e.g. /dev/lp[0-3]). Use the
service.PARALLEL_USB_LP_DRIVER if you want to user the native Linux usb parallel port driver (e.g. /dev/usb/lp[0-3]).iEndDeviceIndex
- This is the index that is appended to the root device name such as.. /dev/lp? /dev/usb/lp? ...
java.lang.Exception
public void changeUdpServerParallelPortDeviceDriver(int UdpServerId, int ParallPortId, java.lang.String DeviceDriver) throws java.lang.Exception
UdpServerId
- This should be one of the Id's that is returned by the createUdpServer() method. This value ranges from 0 to 'last UdpServer Id'ParallPortId
- This should be one of the ParallelPortIds returned by createUdpServerParallelPort()DeviceDriver
- This is the device driver used for the end device. Use service.PARALLEL_LP_DRIVER is you want to use the native Linux parallel port driver (e.g. /dev/lp[0-3]). Use the
service.PARALLEL_USB_LP_DRIVER if you want to user the native Linux usb parallel port driver (e.g. /dev/usb/lp[0-3]).
java.lang.Exception
public void changeUdpServerParallelPortEndDeviceIndex(int UdpServerId, int ParallPortId, int EndDeviceIndex) throws java.lang.Exception
UdpServerId
- This should be one of the Id's that is returned by the createUdpServer() method. This value ranges from 0 to 'last UdpServer Id'ParallPortId
- This should be one of the ParallelPortIds returned by createUdpServerParallelPort()EndDeviceIndex
- This is the index that is appended to the root device name such as.. /dev/lp? /dev/usb/lp? ...
java.lang.Exception
public java.lang.String getUdpServerParallelPortDeviceDriver(int UdpServerId, int ParallPortId) throws java.lang.Exception
UdpServerId
- This should be one of the Id's that is returned by the createUdpServer() method. This value ranges from 0 to 'last UdpServer Id'ParallPortId
- This should be one of the ParallelPortIds returned by createUdpServerParallelPort()
java.lang.Exception
public int getUdpServerParallelPortEndDeviceIndex(int UdpServerId, int ParallPortId) throws java.lang.Exception
UdpServerId
- This should be one of the Id's that is returned by the createUdpServer() method. This value ranges from 0 to 'last UdpServer Id'ParallPortId
- This should be one of the ParallelPortIds returned by createUdpServerParallelPort()
java.lang.Exception
public int getUdpServerEndDeviceCount(int iUdpServerId) throws java.lang.Exception
iUdpServerId
- This is the index (or handle) that is returned by the createUdpServer() method.
java.lang.Exception
public java.lang.String[] getUdpServerEndDeviceNames(int iUdpServerId) throws java.lang.Exception
iUdpServerId
- This is the index (or handle if you like) that is returned by the createUdpServer() method.
java.lang.Exception
public void deleteUdpServerEndDevice(int iUdpServerId, int iEndDeviceIndex) throws java.lang.Exception
iUdpServerId
- The index for a selected UdpServer.iEndDeviceIndex
- The index for a selected 'end device'.
java.lang.Exception
public void startUdpServerInstance(int iUdpServerId) throws java.lang.Exception
iUdpServerId
- This is the handle that was returned by the createUdpServer() method.
java.lang.Exception
public void stopUdpServerInstance(int iUdpServerId) throws java.lang.Exception
iUdpServerId
- This is the handle that was returned by the createUdpServer() method.
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |