public class CommLayerParams
extends java.net.InetSocketAddress
setServiceType(ForteServiceType)
method.
Additionally, the inputs and outputs must be set by calling addInput(ForteDataType)
and addOutput(ForteDataType)
(if the numbers of inputs/outputs differ from each other)
or by calling addInputOutput(ForteDataType)
if the numbers of inputs/outputs are the same.
To add arrays as inputs or outputs, the following methods can be called: addInput(ForteDataType, int)
, addOutput(ForteDataType, int)
and addInputOutput(ForteDataType, int)
.
If no output is added, calling recvData() on the generated IForteSocket will await a response from the connected FORTE CSIFB.
Likewise, if no input is added, calling sendData() on the generated IForteSocket will send a response to the connected FORTE CSIFB.
Once all the parameters are set, an IForteSocket can be initialized by calling this class's makeIPSocket()
method.
IForteSocket
,
ForteServiceType
,
AbstractCommunicationLayer
,
ForteDataType
,
IPluginController
,
FORTE communication architecture,
Serialized FormConstructor and Description |
---|
CommLayerParams(java.net.InetAddress addr,
int port)
Creates a set of communication layer parameters.
|
CommLayerParams(int port)
Creates a set of communication layer parameters with the default address and a specified port.
|
CommLayerParams(java.lang.String hostname,
int port)
Creates a set of communication layer parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addInput(ForteDataType dataType)
Adds a data input to the set-up parameters.
|
void |
addInput(ForteDataType dataType,
int arrayLength)
Adds a data input with a specified array length to the set-up parameters.
|
void |
addInputOutput(ForteDataType dataType)
Adds a data type as an input and as an output at the same time.
|
void |
addInputOutput(ForteDataType dataType,
int arrayLength)
Adds a data type with a specified array length as an input and as an output at the same time.
|
void |
addOutput(ForteDataType dataType)
Adds a data output to the set-up parameters.
|
void |
addOutput(ForteDataType dataType,
int arrayLength)
Adds a data output with a specified array length to the set-up parameters.
|
java.net.InetSocketAddress |
getInetSocketAddress() |
java.util.List<java.lang.Integer> |
getInputArrayLengths() |
java.util.List<java.lang.Enum<?>> |
getInputs() |
java.util.List<java.lang.Integer> |
getOutputArrayLengths() |
java.util.List<java.lang.Enum<?>> |
getOutputs() |
ForteServiceType |
getServiceType() |
IForteSocket |
makeIPSocket() |
void |
setServiceType(ForteServiceType type)
Sets the ForteServiceType enum used by the IPCommunicationLayer to determine which layer to set up below.
|
public CommLayerParams(int port)
port
- the port number. A valid port value is between 0 and 65535. A port number of zero will let the system pick up an ephemeral port in a bind operation.public CommLayerParams(java.net.InetAddress addr, int port)
addr
- the IP addressport
- the port number. A valid port value is between 0 and 65535. A port number of zero will let the system pick up an ephemeral port in a bind operation.serviceType
- one of the 4 IEC 61499 communication service interface function block (CSIFB) types.public CommLayerParams(java.lang.String hostname, int port)
hostname
- the Host name. An attempt will be made to resolve the hostname into an InetAddress. If that attempt fails, the address will be flagged as unresolved. If there is a security manager, its checkConnect method is called with the host name as its argument to check the permissiom to resolve it. This could result in a SecurityException.port
- the port number. A valid port value is between 0 and 65535. A port number of zero will let the system pick up an ephemeral port in a bind operation.serviceType
- one of the 4 IEC 61499 communication service interface function block (CSIFB) types.public ForteServiceType getServiceType()
public void setServiceType(ForteServiceType type)
public java.net.InetSocketAddress getInetSocketAddress()
public void addInput(ForteDataType dataType)
dataType
- the FORTE data type of the input.public void addInput(ForteDataType dataType, int arrayLength)
dataType
- the FORTE data type of the input.arrayLength
- length of the array.public void addOutput(ForteDataType dataType)
dataType
- the FORTE data type of the output.public void addOutput(ForteDataType dataType, int arrayLength)
dataType
- the FORTE data type of the outputarrayLength
- length of the arraypublic void addInputOutput(ForteDataType dataType)
dataType
- the FORTE input/outputpublic void addInputOutput(ForteDataType dataType, int arrayLength)
dataType
- the FORTE input/outputarrayLength
- length of the arraypublic java.util.List<java.lang.Enum<?>> getInputs()
public java.util.List<java.lang.Enum<?>> getOutputs()
public java.util.List<java.lang.Integer> getInputArrayLengths()
public java.util.List<java.lang.Integer> getOutputArrayLengths()
public IForteSocket makeIPSocket() throws java.io.IOException
java.io.IOException