|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.stz.bt.fnd.FND_Datagram
Object Oriented representation of a FND-Datagram.
Field Summary | |
(package private) FND_DataPointContext |
context
|
static byte |
D_R_ACK
|
static byte |
D_R_CMD
|
static byte |
D_R_RSP
|
static byte |
D_R_USM
|
(package private) byte[] |
data
|
(package private) int |
dataLen
|
static byte |
DP_TAB_0
|
static byte |
DP_TAB_1
|
static byte |
DP_TAB_1_2
|
static byte |
DP_TAB_2
|
static int |
FND10
|
static int |
FND20
|
static byte |
IMPLICIT_FCT
|
static byte |
MODIFY_FCT
|
static byte |
MPR_HIGH
|
static byte |
MPR_IMPORTANT
|
static byte |
MPR_NORMAL
|
static byte |
MPR_URGENT
|
static byte |
READ_FCT
|
static byte |
SEG_FIRST
|
static byte |
SEG_LAST
|
static byte |
SEG_NEXT
|
static byte |
SEG_NO
|
(package private) java.net.InetAddress |
sender
|
static byte |
TAG_ERROR
|
static byte |
TAG_NORMAL
|
static byte |
TAG_REJECT
|
Constructor Summary | |
FND_Datagram()
|
Method Summary | |
byte[] |
getApplicationControl()
Returns applicationControl. |
byte[] |
getCentralControl()
Returns CentralControlID and centralControlSubID. |
FND_DataPointContext |
getContext()
|
byte[] |
getDatagramHeader()
|
byte |
getDatagramSegmentType()
|
byte |
getDatagramTag()
|
byte |
getDatagramType()
|
byte[] |
getDataPart()
Returns DateTime. |
byte[] |
getDataPointID()
Returns dataPointID. |
byte |
getDatapointType()
|
byte[] |
getDateTime()
Returns DateTime. |
byte[] |
getFndDatagramByteArray()
Returns raw byte array of the FND_Datagram. |
byte[] |
getInfoCode()
Returns InfoCode. |
byte[] |
getInfoEvent()
Returns InfoEvent. |
boolean[] |
getInfoEventBits()
returns the InfoEvent field as an array of boolean values |
byte |
getInvokeID()
Returns Datagrams invoke ID. |
byte[] |
getIslandControl()
Returns islandControlID and islandControlSubID. |
byte |
getLen()
|
byte[] |
getMask()
Returns Mask. |
byte[] |
getOperationsCode()
Returns operationsCode. |
int |
getProtocolVersion()
|
byte |
getSegmentNr()
Returns Datagrams segment number. |
java.net.InetAddress |
getSender()
|
byte[] |
getTransportControl()
Used to get the four values of the transport-control byte. |
void |
setApplicationControl(byte prd,
byte rpr,
byte emq)
These settings are used to implement acces rights and access priorities. |
void |
setCentralControl(byte centralControlID,
byte centralControlSubID)
This information is used to indentify the central control associated with the datagram |
void |
setContext(FND_DataPointContext context)
|
void |
setDatagramSegmentType(byte dgramsegtype)
|
void |
setDatagramTag(byte dgramattr)
|
void |
setDatagramType(byte dgramtype)
|
void |
setDataPart(byte[] data)
Put raw byte data into the data-part of the FND_Datagram. |
void |
setDataPointID(byte[] dataPointID)
The DataPoint ID is a unique ID assigned to every datapoint. |
void |
setDatapointType(byte dpointtype)
|
void |
setDateTime(byte year,
byte month,
byte day,
byte hour,
byte minute,
byte second)
Date and time the datagram was created. |
void |
setInfoCode(byte exc_1,
byte exc_2)
If the parameter "tag" from the transport control byte is 1, the datagram has been rejected. |
void |
setInfoEvent(byte info,
byte event)
These Settings are used to specify additional information about the data-point and wich events occured. |
void |
setInvokeID(byte invokeID)
The invode ID is used as an internal flow control and securing mechanism. |
void |
setIslandControl(byte islandControlID,
byte islandControlSubID)
This information is used to indentify the island control associated with the datagram |
void |
setLen(byte len)
Set Length of Datagram. |
void |
setMask(byte val,
byte apr,
byte mis,
byte msk)
These settings are used to specify permissions and the message surpression of a datapoint. |
void |
setOperationsCode(byte fct_id,
byte tab_id,
byte dp_type,
byte dp_subtype)
Sets all parameters of the operations code. |
void |
setSegmentNr(byte segNr)
Used to set the segment number. |
void |
setSender(java.net.InetAddress address)
|
void |
setTransportControl(byte d_r,
byte tag,
byte mpr,
byte seg)
Creates the transport control byte by combining all the function parameters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FND10
public static final int FND20
public static final byte TAG_NORMAL
public static final byte TAG_REJECT
public static final byte TAG_ERROR
public static final byte D_R_CMD
public static final byte D_R_RSP
public static final byte D_R_USM
public static final byte D_R_ACK
public static final byte MPR_NORMAL
public static final byte MPR_IMPORTANT
public static final byte MPR_HIGH
public static final byte MPR_URGENT
public static final byte SEG_NO
public static final byte SEG_FIRST
public static final byte SEG_NEXT
public static final byte SEG_LAST
public static final byte IMPLICIT_FCT
public static final byte READ_FCT
public static final byte MODIFY_FCT
public static final byte DP_TAB_0
public static final byte DP_TAB_1
public static final byte DP_TAB_2
public static final byte DP_TAB_1_2
FND_DataPointContext context
java.net.InetAddress sender
byte[] data
int dataLen
Constructor Detail |
public FND_Datagram()
Method Detail |
public void setLen(byte len)
len
- Length of FND_Datagram.public byte getLen()
setLen(byte)
public void setTransportControl(byte d_r, byte tag, byte mpr, byte seg) throws java.lang.IndexOutOfBoundsException
d_r
- Direction and response bits. tag
- Type of Telegram. 0 = NORMAL-Datagram
1 = REJECT-Datagram
2 = ERROR-Datagram
3 = reserved
mpr
- Datagram priority. The higher the value the higher the priority.
seg
- Segmentation status. 0 = no segementation
3 = segmentation: first element
2 = segmentation: following element
1 = segemantation: last element
java.lang.IndexOutOfBoundsException
- In case any parameter exceeds its maximum value this
exception is thrownpublic byte[] getTransportControl()
transportControl[0] = d_r
transportControl[1] = tag
transportControl[2] = mpr
transportControl[3] = seg
setTransportControl(byte d_r, byte tag, byte mpr, byte
seg)
public void setSegmentNr(byte segNr)
segNr
- Segment number.public byte getSegmentNr()
setSegmentNr(byte segNr)
public void setInvokeID(byte invokeID)
invokeID
- public byte getInvokeID()
setInvokeID(byte invokeID)
public void setCentralControl(byte centralControlID, byte centralControlSubID)
centralControlID
- Used to indetify the central control.
centralControlSubID
- Optional ID (default 0), connects the datagram with a corresponding internal Process.
public byte[] getCentralControl()
centralControl[0] = centralControlID
centralControl[1] = centralControlSubID
setCentralControl(byte centralControlID, byte
centralControlSubID)
public void setIslandControl(byte islandControlID, byte islandControlSubID)
islandControlID
- Used to indetify the island control.
islandControlSubID
- Optional ID (default 0), connects the datagram with a corresponding Process.
public byte[] getIslandControl()
islandControlID[0] = islandControlID
islandControlID[1] = islandControlSubID
setIslandControl(byte islandControlID, byte
islandControlSubID)
public void setDataPointID(byte[] dataPointID) throws java.lang.IndexOutOfBoundsException
dataPointID
- The DataPoint ID to be assigned to the datagram
java.lang.IndexOutOfBoundsException
- If the datapoint ID is too large (more than 16 charcters) this exception is thrown.
public byte[] getDataPointID()
dataPointID[0] to dataPointID[15] = dataPointID.
(byte[] dataPointID)
public void setOperationsCode(byte fct_id, byte tab_id, byte dp_type, byte dp_subtype) throws java.lang.IndexOutOfBoundsException
fct_id
- One of three elementary funcions:
0 = Implizit (only valid for transferpoints, meaning has to specified)
1 = Read (Reading of DataPoint tables)
2 = Modify (Modifying of DataPoint tables)
tab_id
- One of four values, that determine the DataPoint table to be affected.
0 = DataPoint table 0
1 = DataPoint table 1
2 = DataPoint table 2
3 = DataPoint table 1 and 2
dp_type
- The datapoint type.
0 = Transferpoint
1 = Messagepoint
2 = Switchpoint
3 = Measurepoint
4 = Settingpoint
5 = Countingpoint
6 = Collectionpoint
dp_subtype
- The datapoint subtype.
Transferpoints are the only Datapoints using this parameter.
The possible values, depending on the DataPoint ID are specified as followed:
DataPoint type Datpoint subtype Comment 0 0 Adresspoint for transparent
data transfer1 Adresspoint for error messages 2 Authentification point
java.lang.IndexOutOfBoundsException
- In Case any of the supplied parameters exceeds its maximum
value, this exception is thrown.public byte[] getOperationsCode()
operationCode[0] = fct_id
operationCode[1] = tab_id
operationCode[2] = dp_type
operationCode[3] = dp_subtype
(byte fct_id, byte tab_id, byte
dp_type, byte dp_subtype)
public void setApplicationControl(byte prd, byte rpr, byte emq) throws java.lang.IndexOutOfBoundsException
prd
- Identification. The higher the value, the more rights are assigned to the datagram. 0 = regular user
1 = privileged user
2 = super user
3 = administrator
rpr
- Access control. Sets the threshold that determines wich user is allowed to use the datapoint used by this datagram.
0 = regular user, priviledged user, super user and adiministrator has access rights to the datapoint
1 = priviledged user, super user and administrator has acces rights to the datapoint.
2 = super user and administrator has access rights to the datapoint.
3 = only administrator has access rights to the datapoint.
emq
- Event Modification Qualifier
Has a different meaning, depending on wether the datagram is used as command or message.
Command Mode: (Used as modification control)
To be abled to modify only a small part of the whole DP-table, the four bits of this parameter can be set individually, to specify that only those DP-table entries are beeing modified who's bit is set to 1.The first bit (if set to 1) enables modification of the first DP-table entry
The second bit (if set to 1) enables modification of the second DP-table entry
...
The fourth bit (if set to 1) enables modification of the fourth DP-table entry.
Message Mode: (Used to indicate the reason for a spontanious message)
Seems like nonsense at first but in case the one reason for a sponatnious message is still there (a sensor malfunction for example) and a second reason for a spontanious message appears later, causing a second sponatnious message (a value has changed, for example), you need to specify wich reason caused the datagram. The second datagram would only set the emq-bit connected with the very reason of the spontanious message (the emq-bit connected to the event-bit for value changes, for example).The first bit (if set to 1) indicates the first bit of event (last four bits of the byte info_event) was the reason for the spontanious message.When creating an ACK-datagram the value must be copied from the REQ-datagram without any modifications.
The second bit (if set to 1) indicates the second bit of event (last four bits of the byte info_event) was the reason for the spontanious message.
...
The second bit (if set to 1) indicates the first bit of event (last four bits of the byte info_event) was the reason for the spontanious message.
java.lang.IndexOutOfBoundsException
- In Case any of the supplied parameters exceeds its maximum
value, this exception is thrown.public byte[] getApplicationControl()
applicationControl[0] = prd
applicationControl[1] = rpr
applicationControl[2] = emq
(byte id, byte rights, byte mec)
public void setMask(byte val, byte apr, byte mis, byte msk) throws java.lang.IndexOutOfBoundsException
val
-
val Meaning 0 0 Central control exclusive:
Unrestricted modification by central control. Island control isn't allowed to modify anything at all.0 1 Central control preference:
Highest priority (3) can only be set and changed by central control.1 0 Island control preference:
Highest priority (3) can only be set and changed by island control.0 0 Island control exclusive:
Unrestricted modification by Island control. Central control is allowed to change DP_#0 only.
apr
- Access priority. It's value represents the current access priority held by the datapoint at the moment. It can be used to decide wether sending a datagram to change options of the datapoint makes sense or would be blocked anyway.
mis
- Specifies the type of messages to be surpressed (island-specific).
0 = Nothing is surpressed.
1 = Operational Messages are surpressed.
2 = Operational and BTA-Error messages are surpressed.
3 = All Messages are surpressed.
msk
- Specifies the type of messages to be surpressed (central-control-specific).
0 = Nothing is surpressed.
1 = Operational Messages are surpressed.
2 = Operational and BTA-Error messages are surpressed.
3 = All Messages are surpressed.
java.lang.IndexOutOfBoundsException
- In Case any of the supplied parameters exceeds its maximum
value, this exception is thrown.public byte[] getMask()
mask[0] = val
mask[1] = apr
mask[2] = mis
mask[3] = msk
(byte val, byte apr, byte mis, byte msk)
public void setInfoEvent(byte info, byte event) throws java.lang.IndexOutOfBoundsException
info
- Specifies additional information about the data-point.
No cheking is done wether the supplied values are valid for the very datagram, as it depends on the datapoint-type.
event
- Specifies wich events have occured. The possible values depend on the datapoint-type.
java.lang.IndexOutOfBoundsException
- In case a parameter exceeds it's maximum value this exception
is thrown.public byte[] getInfoEvent()
infoEvent[0] = info
infoEvent[1] = event
(byte info, byte event)
public boolean[] getInfoEventBits()
public void setInfoCode(byte exc_1, byte exc_2)
exc_1 | exc_2 | Explanation |
1 | 0 | Recieved an unexpected datagram segment. |
2 | 0 | Recieved an unexpected datagram start segment, or an unsegmented datagram while trying to reassemble a fragmented datagram. |
3 | seg_exp | Recieved a datagram segment with an unexpected segment number. "seg_exp" is the expected segment number. |
4 | 0 | "invoke_id" busy. Some other taks is still beeing processed. |
5 | 0 | DataPoint not accessable. |
5 | 1 | DataPoint served locally. |
5 | 2 | DataPoint locked. |
6 | 0 | DataPoint busy. Some other task is still beeing processed. |
7 | 0 | Central control not acessable. |
8 | 0 | Island control not accessable |
9 | apr | No suficcent access rights. (prd < apr) |
10 | 0 | Authentification mechanism currently running. |
exc_1
- exc_2
- public byte[] getInfoCode()
infoCode[0] = exc_1
infoCode[1] = exc_2
(byte exc_1, byte exc_2)
public void setDateTime(byte year, byte month, byte day, byte hour, byte minute, byte second) throws java.lang.IndexOutOfBoundsException
year
- Allowed values: 0-99.
month
- Allowed values: 1-12.
day
- Allowed values: 1-31.
hour
- Allowed values: 0-23.
minute
- Allowed values: 0-59.
second
- Allowed values: 0-59.
java.lang.IndexOutOfBoundsException
- In case any of the parameters exceeds its maximum value.public byte[] getDateTime()
dateTime[0] = year
dateTime[1] = month
dateTime[2] = day
dateTime[3] = hour
dateTime[4] = minute
dateTime[5] = second
(byte year, byte month, byte day, byte
hour, byte minute, byte second)
public void setDataPart(byte[] data) throws java.lang.IndexOutOfBoundsException
data
- The raw data. Maximum length is 128-38 = 90 byte.
java.lang.IndexOutOfBoundsException
- public byte[] getDataPart()
dataPart[0] to dataPart[89] (maximum)
(byte[] data)
public byte[] getFndDatagramByteArray()
public FND_DataPointContext getContext()
public void setContext(FND_DataPointContext context)
context
- an Context object that is responsible for working with this
datapointpublic byte[] getDatagramHeader()
public byte getDatapointType()
public void setDatapointType(byte dpointtype)
dpointtype
- the new value for the dp_type field of the datagrampublic byte getDatagramSegmentType()
public void setDatagramSegmentType(byte dgramsegtype)
public byte getDatagramTag()
public void setDatagramTag(byte dgramattr)
public byte getDatagramType()
public void setDatagramType(byte dgramtype)
public int getProtocolVersion()
public java.net.InetAddress getSender()
public void setSender(java.net.InetAddress address)
address
- sets the InetAdress object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |