Main Page | Packages | Class Hierarchy | Compound List | Compound Members

de.stz.bt.fnd.FND_Datagram Class Reference

List of all members.

Public Member Functions

void setLen (byte len)
byte getLen ()
void setTransportControl (byte d_r, byte tag, byte mpr, byte seg) throws IndexOutOfBoundsException
byte[] getTransportControl ()
void setSegmentNr (byte segNr)
byte getSegmentNr ()
void setInvokeID (byte invokeID)
byte getInvokeID ()
void setCentralControl (byte centralControlID, byte centralControlSubID)
byte[] getCentralControl ()
void setIslandControl (byte islandControlID, byte islandControlSubID)
byte[] getIslandControl ()
void setDataPointID (byte[] dataPointID) throws IndexOutOfBoundsException
byte[] getDataPointID ()
void setOperationsCode (byte fct_id, byte tab_id, byte dp_type, byte dp_subtype) throws IndexOutOfBoundsException
byte[] getOperationsCode ()
void setApplicationControl (byte prd, byte rpr, byte emq) throws IndexOutOfBoundsException
byte[] getApplicationControl ()
void setMask (byte val, byte apr, byte mis, byte msk) throws IndexOutOfBoundsException
byte[] getMask ()
void setInfoEvent (byte info, byte event) throws IndexOutOfBoundsException
byte[] getInfoEvent ()
boolean[] getInfoEventBits ()
void setInfoCode (byte exc_1, byte exc_2)
byte[] getInfoCode ()
void setDateTime (byte year, byte month, byte day, byte hour, byte minute, byte second) throws IndexOutOfBoundsException
byte[] getDateTime ()
void setDataPart (byte[] data) throws IndexOutOfBoundsException
byte[] getDataPart ()
byte[] getFndDatagramByteArray ()
FND_DataPointContext getContext ()
void setContext (FND_DataPointContext context)
byte[] getDatagramHeader ()
byte getDatapointType ()
void setDatapointType (byte dpointtype)
byte getDatagramSegmentType ()
void setDatagramSegmentType (byte dgramsegtype)
byte getDatagramTag ()
void setDatagramTag (byte dgramattr)
byte getDatagramType ()
void setDatagramType (byte dgramtype)
int getProtocolVersion ()
InetAddress getSender ()
void setSender (InetAddress address)

Static Public Attributes

final int FND10 = 0xF0
final int FND20 = 0xF1
final byte TAG_NORMAL = 0
final byte TAG_REJECT = 1
final byte TAG_ERROR = 2
final byte D_R_CMD = 0
final byte D_R_RSP = 3
final byte D_R_USM = 2
final byte D_R_ACK = 1
final byte MPR_NORMAL = 0
final byte MPR_IMPORTANT = 1
final byte MPR_HIGH = 2
final byte MPR_URGENT = 3
final byte SEG_NO = 0
final byte SEG_FIRST = 3
final byte SEG_NEXT = 2
final byte SEG_LAST = 1
final byte IMPLICIT_FCT = 0
final byte READ_FCT = 1
final byte MODIFY_FCT = 2
final byte DP_TAB_0 = 0
final byte DP_TAB_1 = 1
final byte DP_TAB_2 = 2
final byte DP_TAB_1_2 = 3

Package Attributes

FND_DataPointContext context = null
InetAddress sender = null
byte[] data = null
int dataLen = 0

Detailed Description

Object Oriented representation of a FND-Datagram.

Author:
Lars Heineken

J. Seitter

Version:
Id
FND_Datagram.java,v 1.5 2004/11/12 09:08:18 jseitter Exp


Member Function Documentation

byte [] de.stz.bt.fnd.FND_Datagram.getApplicationControl  ) 
 

Returns applicationControl.

See also:
FND_Datagram.setApplicationControl (byte id, byte rights, byte mec)
Returns:
applicationControl[] applicationControl[0] = prd
applicationControl[1] = rpr
applicationControl[2] = emq

00592                                         {
00593     // For explanation and an example what's happening here see
00594     // getTransportControl()
00595     byte[] applicationControl = {(byte) ((data[27] & 0xC0) >>> 6), // id
00596        (byte) ((data[27] & 0x30) >>> 4), // rights
00597        (byte) ((data[27] & 0x0F)) // mec
00598     };
00599     return applicationControl;
00600   }

byte [] de.stz.bt.fnd.FND_Datagram.getCentralControl  ) 
 

Returns CentralControlID and centralControlSubID.

See also:
FND_Datagram.setCentralControl(byte centralControlID, byte centralControlSubID)
Returns:
centralControl[] centralControl[0] = centralControlID
centralControl[1] = centralControlSubID

00275                                     {
00276     byte[] centralControl = { data[5], data[6] };
00277     return centralControl;
00278   }

FND_DataPointContext de.stz.bt.fnd.FND_Datagram.getContext  ) 
 

Returns:
The current context for this datapoint

01131                                            {
01132     return context;
01133   }

byte [] de.stz.bt.fnd.FND_Datagram.getDatagramHeader  ) 
 

Returns:
the datagram header part (mainly used by error datagrams)

01154                                    {
01155     
01156     //copy the header part of the datagram
01157     byte[] header = new byte[38];
01158     for(int i=0; i<38; i++){
01159       header[i]=this.data[i];
01160     }
01161     return header;
01162   }

byte de.stz.bt.fnd.FND_Datagram.getDatagramTag  ) 
 

Returns:
the tag field of the datagram
This field describes if this is an NORMAL, ERROR or REJECT datagram

01217                                {
01218     // returns the tag field
01219     // it's used together with the constants
01220     return this.getTransportControl()[1];
01221   }

byte [] de.stz.bt.fnd.FND_Datagram.getDataPart  ) 
 

Returns DateTime.

See also:
FND_Datagram.setDataPart (byte[] data)
Returns:
dataPart[] dataPart[0] to dataPart[89] (maximum)

01109                               {
01110     byte[] dataPart = new byte[data[1] - 36];
01111     // space for dataPart (length-2-36)
01112     for (int i = 0; i < dataPart.length; i++) {
01113       dataPart[i] = data[38 + i];
01114     }
01115     return dataPart;
01116   }

byte [] de.stz.bt.fnd.FND_Datagram.getDataPointID  ) 
 

Returns dataPointID.

See also:
FND_Datagram.setDataPointID (byte[] dataPointID)
Returns:
dataPoint[] dataPointID[0] to dataPointID[15] = dataPointID.

00346                                  {
00347     byte[] dataPointID = new byte[16];
00348     for (int i = 0; i < 16; ++i) {
00349       dataPointID[i] = data[i + 9]; // data[9] to [25]
00350     }
00351     return dataPointID;
00352   }

byte de.stz.bt.fnd.FND_Datagram.getDatapointType  ) 
 

Returns:
the dp_type field of the datagram

01167                                  {
01168     // returns the dp_type field already casted to int
01169     // it's used together with the constants
01170     return this.getOperationsCode()[2];
01171   }

byte [] de.stz.bt.fnd.FND_Datagram.getDateTime  ) 
 

Returns DateTime.

See also:
FND_Datagram.setDateTime (byte year, byte month, byte day, byte hour, byte minute, byte second)
Returns:
dateTime[] dateTime[0] = year
dateTime[1] = month
dateTime[2] = day
dateTime[3] = hour
dateTime[4] = minute
dateTime[5] = second

01065                               {
01066     byte[] dateTime =
01067       {
01068         (byte) (data[32]),
01069         (byte) (data[33]),
01070         (byte) (data[34]),
01071         (byte) (data[35]),
01072         (byte) (data[36]),
01073         (byte) (data[37])};
01074     return dateTime;
01075   }

byte [] de.stz.bt.fnd.FND_Datagram.getFndDatagramByteArray  ) 
 

Returns raw byte array of the FND_Datagram.

This is needed for sending the FND_Datagram with i.e. UDP

Returns:
data[]

01125                                           {
01126     return data;
01127   }

byte [] de.stz.bt.fnd.FND_Datagram.getInfoCode  ) 
 

Returns InfoCode.

See also:
FND_Datagram.setInfoCode (byte exc_1, byte exc_2)
Returns:
infoCode[] infoCode[0] = exc_1
infoCode[1] = exc_2

00951                               {
00952     // For an explanation and an example what's happening here, see
00953     // getTransportControl()
00954     byte[] infoCode = {(byte) (data[30]), (byte) (data[31])};
00955     return infoCode;
00956   }

byte [] de.stz.bt.fnd.FND_Datagram.getInfoEvent  ) 
 

Returns InfoEvent.

See also:
FND_Datagram.setInfoEvent (byte info, byte event)
Returns:
infoEvent[] infoEvent[0] = info
infoEvent[1] = event

00789                                {
00790     byte[] infoEvent = {(byte) ((data[29] & 0xF0) >>> 4), // info
00791        (byte) ((data[29] & 0x0F)) // event
00792     };
00793     return infoEvent;
00794   }

boolean [] de.stz.bt.fnd.FND_Datagram.getInfoEventBits  ) 
 

returns the InfoEvent field as an array of boolean values

Returns:
array of boolean representing bits 0..7 of InfoEvent byte

00801                                       {
00802     boolean[] infoEventBits = new boolean[8];
00803         if((data[29] & 0x01)==1) 
00804         {infoEventBits[0]=true;}
00805         else
00806         {infoEventBits[0]=false;}
00807 
00808         if(((data[29] & 0x02)>>>1)==1) 
00809         {infoEventBits[1]=true;}
00810         else
00811         {infoEventBits[1]=false;}
00812 
00813         if(((data[29] & 0x04)>>>2)==1) 
00814         {infoEventBits[2]=true;}
00815         else
00816         {infoEventBits[2]=false;}
00817 
00818         if(((data[29] & 0x08)>>>3)==1) 
00819         {infoEventBits[3]=true;}
00820         else
00821         {infoEventBits[3]=false;}
00822 
00823         if(((data[29] & 0x10)>>>4)==1) 
00824         {infoEventBits[4]=true;}
00825         else
00826         {infoEventBits[4]=false;}
00827         
00828         if(((data[29] & 0x20)>>>5)==1) 
00829         {infoEventBits[5]=true;}
00830         else
00831         {infoEventBits[5]=false;}
00832 
00833         if(((data[29] & 0x40)>>>6)==1) 
00834         {infoEventBits[6]=true;}
00835         else
00836         {infoEventBits[6]=false;}
00837 
00838         if(((data[29] & 0x80)>>>7)==1) 
00839         {infoEventBits[7]=true;}
00840         else
00841         {infoEventBits[7]=false;}
00842         
00843         return infoEventBits;
00844   }

byte de.stz.bt.fnd.FND_Datagram.getInvokeID  ) 
 

Returns Datagrams invoke ID.

See also:
FND_Datagram.setInvokeID(byte invokeID)
Returns:
Datagram's invoke ID.

00243                             {
00244     return this.data[4];
00245   }

byte [] de.stz.bt.fnd.FND_Datagram.getIslandControl  ) 
 

Returns islandControlID and islandControlSubID.

See also:
FND_Datagram.setIslandControl(byte islandControlID, byte islandControlSubID)
Returns:
islandControlID[] islandControlID[0] = islandControlID
islandControlID[1] = islandControlSubID

00308                                    {
00309     byte[] islandControl = { data[7], data[8] };
00310     return islandControl;
00311   }

byte de.stz.bt.fnd.FND_Datagram.getLen  ) 
 

See also:
FND_Datagram.setLen(byte)
Returns:
lenght of FND_Datagram, in bytes, minus 2 .

00102                        {
00103     return this.data[1];
00104   }

byte [] de.stz.bt.fnd.FND_Datagram.getMask  ) 
 

Returns Mask.

See also:
FND_Datagram.setMask (byte val, byte apr, byte mis, byte msk)
Returns:
mask[] mask[0] = val
mask[1] = apr
mask[2] = mis
mask[3] = msk

00730                           {
00731     // For an explanation and an example what's been done here, see
00732     // getTransportControl()
00733     byte[] mask = {(byte) ((data[28] & 0xC0) >>> 6), // val (2 bits)
00734        (byte) ((data[28] & 0x30) >>> 4), // apr (2 bits)
00735        (byte) ((data[28] & 0x0C) >>> 2), // mis (2 bits)
00736        (byte) ((data[28] & 0x03)) // msk (2 bits)
00737     };
00738     return mask;
00739   }

byte [] de.stz.bt.fnd.FND_Datagram.getOperationsCode  ) 
 

Returns operationsCode.

See also:
FND_Datagram.setOperationsCode (byte fct_id, byte tab_id, byte dp_type, byte dp_subtype)
Returns:
operationCode operationCode[0] = fct_id
operationCode[1] = tab_id
operationCode[2] = dp_type
operationCode[3] = dp_subtype

00468                                     {
00469     // for an example and what's happening here, see getTransportControl()
00470     byte[] operationCode =
00471       {(byte) ((this.data[25] & 0xF0) >>> 4), // fct_id
00472        (byte) ((this.data[25] & 0x0F)), // tab_id
00473        (byte) ((this.data[26] & 0xF0) >>> 4), // dp_type
00474        (byte) ((this.data[26] & 0x0F)) // dp_subtype
00475     };
00476     return operationCode;
00477   }

int de.stz.bt.fnd.FND_Datagram.getProtocolVersion  ) 
 

Returns:
the ProtocolVersion as an Integer ( 0xF0 for FND 1.0)

01259                                  {
01260       return (int) data[0];
01261     }

byte de.stz.bt.fnd.FND_Datagram.getSegmentNr  ) 
 

Returns Datagrams segment number.

See also:
FND_Datagram.setSegmentNr(byte segNr)
Returns:
Datagram's segment number.

00219                              {
00220     return this.data[3];
00221   }

InetAddress de.stz.bt.fnd.FND_Datagram.getSender  ) 
 

Returns:
the InetAddress Object of the socket receiving the datagram

01266                                  {
01267     return sender;
01268   }

byte [] de.stz.bt.fnd.FND_Datagram.getTransportControl  ) 
 

Used to get the four values of the transport-control byte.

See also:
FND_Datagram.setTransportControl(byte d_r, byte tag, byte mpr, byte seg)
Returns:
transportControl[]
transportControl[0] = d_r
transportControl[1] = tag
transportControl[2] = mpr
transportControl[3] = seg

00185                                       {
00186     // masks out the values inside the transportControl byte (data[2]) and
00187     // builds a byte array.
00188     byte[] transportControl = {(byte) ((this.data[2] & 0xC0) >>> 6), //d_r
00189        (byte) ((this.data[2] & 0x30) >>> 4), // tag
00190        (byte) ((this.data[2] & 0x0C) >>> 2), // mpr
00191        (byte) (this.data[2] & 0x03) // seg
00192     };
00193     // transportControl tag extraction (example):
00194     // transportControl 1011 0110
00195     // 1011 0110 & 0x30 => 0011 0000
00196     // 0011 0000 >>> 4 => 0000 0011 -> tag = 3
00197 
00198     return transportControl;
00199   }

void de.stz.bt.fnd.FND_Datagram.setApplicationControl byte  prd,
byte  rpr,
byte  emq
throws IndexOutOfBoundsException
 

These settings are used to implement acces rights and access priorities.
If creating a datagram that does not alter DP_#1 or DP_#2, prd and rpr have to be 0. Same goes for USM-datgrams. Respond- and ACK-datagrams need to copy the values of prd and rpr ,without modifications, from the datagram that belongs to that Respond- or ACK-datagram.

Parameters:
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.
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.
When creating an ACK-datagram the value must be copied from the REQ-datagram without any modifications.
Exceptions:
IndexOutOfBoundsException In Case any of the supplied parameters exceeds its maximum value, this exception is thrown.

00554                                      {
00555     if (prd > 3) {
00556       throw (
00557         new IndexOutOfBoundsException(
00558           "FND_Datagram.setApplicationControl() parameter id, above maximum, value="
00559             + prd
00560             + "maximum value=3"));
00561     }
00562     if (rpr > 3) {
00563       throw (
00564         new IndexOutOfBoundsException(
00565           "FND_Datagram.setApplicationControl() parameter rights, above maximum, value="
00566             + rpr
00567             + "maximum value=3"));
00568     }
00569     if (emq > 15) {
00570       throw (
00571         new IndexOutOfBoundsException(
00572           "FND_Datagram.setApplicationControl() parameter mec, above maximum, value="
00573             + emq
00574             + "maximum value=15"));
00575     }
00576 
00577     this.data[27] = prd;
00578     this.data[27] <<= 2;
00579     this.data[27] |= rpr;
00580     this.data[27] <<= 2;
00581     this.data[27] |= emq;
00582   }

void de.stz.bt.fnd.FND_Datagram.setCentralControl byte  centralControlID,
byte  centralControlSubID
 

This information is used to indentify the central control associated with the datagram

Parameters:
centralControlID Used to indetify the central control.
centralControlSubID Optional ID (default 0), connects the datagram with a corresponding internal Process.

00261                               {
00262     this.data[5] = centralControlID;
00263     this.data[6] = centralControlSubID;
00264   }

void de.stz.bt.fnd.FND_Datagram.setContext FND_DataPointContext  context  ) 
 

Parameters:
context an Context object that is responsible for working with this datapoint

01140                                                        {
01141     this.context = context;
01142   }

void de.stz.bt.fnd.FND_Datagram.setDataPart byte[]  data  )  throws IndexOutOfBoundsException
 

Put raw byte data into the data-part of the FND_Datagram.

Parameters:
data The raw data. Maximum length is 128-38 = 90 byte.
Exceptions:
IndexOutOfBoundsException 
In case the array supplied is too large.

01088                                                                         {
01089     if (data.length > 90) {
01090       throw (
01091         new IndexOutOfBoundsException(
01092           "FND_Datagram.SetDataPart() parameter data, above maximum length, value="
01093             + data.length
01094             + "maximum length=90"));
01095     }
01096 
01097     for (int i = 0; i < data.length; ++i) {
01098       this.data[38 + i] = data[i];
01099     }
01100   }

void de.stz.bt.fnd.FND_Datagram.setDataPointID byte[]  dataPointID  )  throws IndexOutOfBoundsException
 

The DataPoint ID is a unique ID assigned to every datapoint.

Parameters:
dataPointID The DataPoint ID to be assigned to the datagram
Exceptions:
IndexOutOfBoundsException If the datapoint ID is too large (more than 16 charcters) this exception is thrown.

00325                                      {
00326 
00327     if (dataPointID.length > 16) {
00328       throw (
00329         new IndexOutOfBoundsException("FND_Datagram.setDataPointID: dataPointID too large (too many characters"));
00330     }
00331     System.arraycopy(dataPointID, 0, data, 9, dataPointID.length);
00332 
00333     // If the dataPointID is shorter than 16 characters, zeros are added.
00334     for (int i = dataPointID.length; i <= 16; ++i) {
00335       this.data[9 + dataPointID.length] = 0;
00336     }
00337   }

void de.stz.bt.fnd.FND_Datagram.setDatapointType byte  dpointtype  ) 
 

Parameters:
dpointtype the new value for the dp_type field of the datagram

01178                                                 {
01179     // returns the dp_type field
01180     // it's used together with the constants
01181     byte[] tmp_dpointtype = this.getTransportControl();
01182     tmp_dpointtype[2] = dpointtype;
01183     this.setTransportControl(
01184       tmp_dpointtype[0],
01185       tmp_dpointtype[1],
01186       tmp_dpointtype[2],
01187       tmp_dpointtype[3]);
01188   }

void de.stz.bt.fnd.FND_Datagram.setDateTime byte  year,
byte  month,
byte  day,
byte  hour,
byte  minute,
byte  second
throws IndexOutOfBoundsException
 

Date and time the datagram was created.

Parameters:
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.
Exceptions:
IndexOutOfBoundsException In case any of the parameters exceeds its maximum value.

00989                                      {
00990     if (year > 99) {
00991       throw (
00992         new IndexOutOfBoundsException(
00993           "FND_Datagram.SetDateTime() parameter year, above maximum, value="
00994             + year
00995             + "maximum value=99"));
00996     }
00997     if (month == 0) {
00998       throw (
00999         new IndexOutOfBoundsException(
01000           "FND_Datagram.SetDateTime() parameter month, below minimum, value="
01001             + month
01002             + "minumum value=1"));
01003     } else if (month > 12) {
01004       throw (
01005         new IndexOutOfBoundsException(
01006           "FND_Datagram.SetDateTime() parameter month, above maximum, value="
01007             + month
01008             + "maximum value=12"));
01009     }
01010     if (day == 0) {
01011       throw (
01012         new IndexOutOfBoundsException(
01013           "FND_Datagram.SetDateTime() parameter day, below minimum, value="
01014             + day
01015             + "minimum value=1"));
01016     } else if (day > 31) {
01017       throw (
01018         new IndexOutOfBoundsException(
01019           "FND_Datagram.SetDateTime() parameter day, above maximum, value="
01020             + day
01021             + "maximum value=31"));
01022     }
01023     if (hour > 23) {
01024       throw (
01025         new IndexOutOfBoundsException(
01026           "FND_Datagram.SetDateTime() parameter hour, above maximum, value="
01027             + hour
01028             + "maximum value=23"));
01029     }
01030     if (minute > 59) {
01031       throw (
01032         new IndexOutOfBoundsException(
01033           "FND_Datagram.SetDateTime() parameter minute, above maximum, value="
01034             + minute
01035             + "maximum value=59"));
01036     }
01037     if (second > 59) {
01038       throw (
01039         new IndexOutOfBoundsException(
01040           "FND_Datagram.SetDateTime() parameter second, above maximum, value="
01041             + second
01042             + "maximum value=59"));
01043     }
01044 
01045     this.data[32] = year;
01046     this.data[33] = month;
01047     this.data[34] = day;
01048     this.data[35] = hour;
01049     this.data[36] = minute;
01050     this.data[37] = second;
01051   }

void de.stz.bt.fnd.FND_Datagram.setInfoCode byte  exc_1,
byte  exc_2
 

If the parameter "tag" from the transport control byte is 1, the datagram has been rejected. The info-code is used to specify the reason for the reject.
If the parameter "tag" from the transport control byte is 2, the datagram contains a syntactical error. The info-code parameter exc_1 points to the byte inside the data-part where the error occured. exc_2 contains additional information about the error.
When creating message or command datagrams both values have to be 0.

Possible values for the two parameters exc_1 and 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.

Parameters:
exc_1 
See above.
exc_2 
See above.

00938                                                   {
00939     this.data[30] = exc_1;
00940     this.data[31] = exc_2;
00941   }

void de.stz.bt.fnd.FND_Datagram.setInfoEvent byte  info,
byte  event
throws IndexOutOfBoundsException
 

These Settings are used to specify additional information about the data-point and wich events occured. The possible parameter values depend on the type of the data point.

Parameters:
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.
Exceptions:
IndexOutOfBoundsException In case a parameter exceeds it's maximum value this exception is thrown.

00761                                      {
00762     if (info > 15) {
00763       throw (
00764         new IndexOutOfBoundsException(
00765           "FND_Datagram.setInfoEvent() parameter info, above maximum, value="
00766             + info
00767             + "maximum value=15"));
00768     }
00769     if (event > 15) {
00770       throw (
00771         new IndexOutOfBoundsException(
00772           "FND_Datagram.setInfoEvent() parameter event, above maximum, value="
00773             + event
00774             + "maximum value=15"));
00775     }
00776 
00777     this.data[29] = info;
00778     this.data[29] <<= 4;
00779     this.data[29] |= event;
00780   }

void de.stz.bt.fnd.FND_Datagram.setInvokeID byte  invokeID  ) 
 

The invode ID is used as an internal flow control and securing mechanism. It limits the number of currently pending request or processings by issueing a ticket (the invokeID) out of a limited pool. After completion of the request or process, the ticket is returned to the pool and can be issued again. If all avaialable tickets are in use no more request are accepted.

Parameters:
invokeID 

00233                                          {
00234     this.data[4] = invokeID;
00235   }

void de.stz.bt.fnd.FND_Datagram.setIslandControl byte  islandControlID,
byte  islandControlSubID
 

This information is used to indentify the island control associated with the datagram

Parameters:
islandControlID Used to indetify the island control.
islandControlSubID Optional ID (default 0), connects the datagram with a corresponding Process.

00293                              {
00294     this.data[7] = islandControlID;
00295     this.data[8] = islandControlSubID;
00296   }

void de.stz.bt.fnd.FND_Datagram.setLen byte  len  ) 
 

Set Length of Datagram. Has to be the complete length of FND_Datagram (in bytes) minus 2.

Parameters:
len Length of FND_Datagram.

00094                                {
00095     this.data[1] = len;
00096   }

void de.stz.bt.fnd.FND_Datagram.setMask byte  val,
byte  apr,
byte  mis,
byte  msk
throws IndexOutOfBoundsException
 

These settings are used to specify permissions and the message surpression of a datapoint.

mis and msk:
Island specific message surpression affects central-control message surpression. If messages are surpressed island-specific, they are surpressed central-control-specific, too.

val and apr:
Permissions are needed to make sure that information altering datagrams don't conflict with each other.
Command datagrams and datagrams for transferpoints have both val and apr set to 0.


Parameters:
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.
Exceptions:
IndexOutOfBoundsException In Case any of the supplied parameters exceeds its maximum value, this exception is thrown.

00681                                      {
00682     if (val > 3) {
00683       throw (
00684         new IndexOutOfBoundsException(
00685           "FND_Datagram.setMask() parameter val, above maximum, value="
00686             + val
00687             + "maximum value=3"));
00688     }
00689     if (apr > 3) {
00690       throw (
00691         new IndexOutOfBoundsException(
00692           "FND_Datagram.setMask() parameter apr, above maximum, value="
00693             + apr
00694             + "maximum value=3"));
00695     }
00696     if (mis > 3) {
00697       throw (
00698         new IndexOutOfBoundsException(
00699           "FND_Datagram.setMask() parameter mis, above maximum, value="
00700             + mis
00701             + "maximum value=3"));
00702     }
00703     if (msk > 3) {
00704       throw (
00705         new IndexOutOfBoundsException(
00706           "FND_Datagram.setMask() parameter msk, above maximum, value="
00707             + msk
00708             + "maximum value=3"));
00709     }
00710 
00711     this.data[28] = val;
00712     this.data[28] <<= 2;
00713     this.data[28] |= apr;
00714     this.data[28] <<= 2;
00715     this.data[28] |= mis;
00716     this.data[28] <<= 2;
00717     this.data[28] |= msk;
00718   }

void de.stz.bt.fnd.FND_Datagram.setOperationsCode byte  fct_id,
byte  tab_id,
byte  dp_type,
byte  dp_subtype
throws IndexOutOfBoundsException
 

Sets all parameters of the operations code. It is used to determine wich operation is requested and wich DataPoint tables is to be modified.

Parameters:
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 transfer
1 Adresspoint for error messages
2 Authentification point
Exceptions:
IndexOutOfBoundsException In Case any of the supplied parameters exceeds its maximum value, this exception is thrown.

00419                                      {
00420     if (fct_id > 2) {
00421       throw (
00422         new IndexOutOfBoundsException(
00423           "FND_Datagram.setOperationsCode: Parameter fct_id, above maximum, value="
00424             + fct_id
00425             + "maximum value=2"));
00426     }
00427     if (tab_id > 3) {
00428       throw (
00429         new IndexOutOfBoundsException(
00430           "FND_Datagram.setOperationsCode: Parameter tab_id, above maximum, value="
00431             + tab_id
00432             + "maximum value=3"));
00433     }
00434     if (dp_type > 6) {
00435       throw (
00436         new IndexOutOfBoundsException(
00437           "FND_Datagram.setOperationsCode: Parameter dp_type, above maximum, value="
00438             + dp_type
00439             + "maximum value=6"));
00440     }
00441     if (dp_subtype > 6) {
00442       throw (
00443         new IndexOutOfBoundsException(
00444           "FND_Datagram.setOperationsCode: Parameter dp_subtype, above maximum, value="
00445             + dp_subtype
00446             + "maximum value=6"));
00447     }
00448 
00449     // Adding and shifting
00450     this.data[25] = fct_id;
00451     this.data[25] <<= 4;
00452     this.data[25] |= tab_id;
00453     this.data[26] = dp_type;
00454     this.data[26] <<= 4;
00455     this.data[26] |= dp_subtype;
00456   }

void de.stz.bt.fnd.FND_Datagram.setSegmentNr byte  segNr  ) 
 

Used to set the segment number. If there is no segmentation, the value is zero. In case there is a segmentation this number needs to be a 0-based, continously increasing value, used in all fragments of the FND datagram.

Parameters:
segNr Segment number.

00209                                        {
00210     this.data[3] = segNr;
00211   }

void de.stz.bt.fnd.FND_Datagram.setSender InetAddress  address  ) 
 

Parameters:
address sets the InetAdress object

01274                                              {
01275     sender = address;
01276   }

void de.stz.bt.fnd.FND_Datagram.setTransportControl byte  d_r,
byte  tag,
byte  mpr,
byte  seg
throws IndexOutOfBoundsException
 

Creates the transport control byte by combining all the function parameters. The maximum value for every parameter is 3.

Parameters:
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
Exceptions:
IndexOutOfBoundsException In case any parameter exceeds its maximum value this exception is thrown

00133                                      {
00134 
00135     // Check wether any parameter has exceeded it's maximum allowed value.
00136     if (d_r >= 4) {
00137       throw (
00138         new IndexOutOfBoundsException(
00139           "FND_Datagram.setTransportControl: d_r parameter, above maximum, value="
00140             + d_r
00141             + " maximum value=3"));
00142     }
00143     if (tag >= 4) {
00144       throw (
00145         new IndexOutOfBoundsException(
00146           "FND_Datagram.setTransportControl: tag parameter, above maximum, value="
00147             + tag
00148             + " maximum value=3"));
00149     }
00150     if (mpr >= 4) {
00151       throw (
00152         new IndexOutOfBoundsException(
00153           "FND_Datagram-setTransportControl: mpr parameter, above maximum, value="
00154             + mpr
00155             + " maximum value=3"));
00156     }
00157     if (seg >= 4) {
00158       throw (
00159         new IndexOutOfBoundsException(
00160           "FND_Datagram-setTransportControl: seg parameter, above maximum, value="
00161             + seg
00162             + " maximum value=3"));
00163     }
00164 
00165     this.data[2] = d_r;
00166     this.data[2] <<= 2;
00167     this.data[2] |= tag;
00168     this.data[2] <<= 2;
00169     this.data[2] |= mpr;
00170     this.data[2] <<= 2;
00171     this.data[2] |= seg;
00172   }


The documentation for this class was generated from the following file:
Generated on Mon Nov 15 08:36:09 2004 for FND4J by doxygen 1.3.3