### Usage example Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-model.md Shows how to parse an ICD file, navigate the model, and access URCB, BRCB, and DataSet. The example prints each data set member's reference and functional constraint. ```java // From an ICD file (server side) or retrieved from a device (client side) List models = SclParser.parse("sample-model.icd"); ServerModel model = models.get(0); // Navigate ModelNode ld = model.findModelNode("simpleIOGenericIO", null); Urcb urcb = model.getUrcb("simpleIOGenericIO/LLN0$RP$urcb01"); Brcb brcb = model.getBrcb("simpleIOGenericIO/LLN0$BR$brcb01"); DataSet ds = model.getDataSet("simpleIOGenericIO/LLN0$dsl"); if (ds != null) { for (FcModelNode member : ds) { System.out.println(member.getReference() + " [" + member.getFc() + "]"); } } ``` -------------------------------- ### startListening() Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Starts listening for incoming connections. Throws IOException if an error occurs. ```APIDOC ## Method ### Description Starts listening for incoming connections. ### Signature ```java public void startListening() throws IOException ``` ### Exceptions - **IOException** - If an I/O error occurs. ``` -------------------------------- ### ServerSap usage example in Java Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Shows how to parse an ICD file, create a ServerSap, configure limits, start listening with a ServerEventListener, update values via a model copy, and stop the server. The write listener applies writes via setValues and returns null to accept all writes. ```java import com.beanit.iec61850bean.*; import java.util.List; List models = SclParser.parse("sample-model.icd"); ServerSap serverSap = new ServerSap(102, 0, null, models.get(0), null); serverSap.setMaxAssociations(50); serverSap.setMaxMmsPduSize(65000); serverSap.startListening(new ServerEventListener() { @Override public List write(List bdas) { serverSap.setValues(bdas); // apply writes and trigger reports return null; // null = all writes accepted } @Override public void serverStoppedListening(ServerSap serverSap) { System.out.println("Server stopped listening"); } }); // ... application generates values: ServerModel modelCopy = serverSap.getModelCopy(); FcModelNode anIn1 = (FcModelNode) modelCopy.findModelNode( new ObjectReference("simpleIOGenericIO/LLN0$MX$AnIn1"), Fc.MX); // set BDA values in the copy, then push to the server: serverSap.setValues(anIn1.getBasicDataAttributes()); // shutdown: serverSap.stop(); ``` -------------------------------- ### ServerAcseSap.startListening Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Starts listening for incoming connections on the configured port. This method begins the server's listening loop. ```APIDOC ## [METHOD] ServerAcseSap.startListening ### Description Starts listening for incoming connections on the configured port. ### Method startListening ### Endpoint ServerAcseSap.startListening() ### Parameters None ### Response No return value. ### Exceptions - **IOException** - Thrown if listening cannot be started. ``` -------------------------------- ### startListening(ServerEventListener) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Creates a server socket on the configured port and starts accepting association requests. Non-blocking. Throws IOException if binding to the port fails. ```APIDOC ## startListening(ServerEventListener) ### Description Creates a server socket on the configured port and starts accepting association requests. Non-blocking. Throws IOException if binding to the port fails. ### Method startListening ### Signature public void startListening(ServerEventListener serverEventListener) throws IOException ### Parameters - **serverEventListener** (ServerEventListener) - Required - Notified of incoming writes (`write(List)`) and when the server stopped listening (`serverStoppedListening(ServerSap)`) ### Notes The server's `ServerEventListener.write` implementation decides whether a client's write is accepted. The console server's default simply applies the values; a custom listener may return per-BDA `ServiceError`s to reject writes. ### Source `ServerSap.java:266` ``` -------------------------------- ### ServerAcseSap.startListening Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/errors.md Starts listening for connections. Throws IllegalStateException if the listener or TSAP is missing. ```APIDOC ## ServerAcseSap.startListening ### Description Starts listening for connections. Throws IllegalStateException if the listener or TSAP is missing. ### Method startListening ### Exceptions - **IllegalStateException** - Thrown when listener or TSAP is missing. Message: "AcseSAP is unable to listen because it was not initialized.". ``` -------------------------------- ### DataSet usage example Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/data-set.md Shows how to build a DataSet from model nodes, create it on the server via association.createDataSet, and later read all member values with association.getDataSetValues. A null entry in the returned errors list indicates a successful read. ```java // Build a data set from model nodes and create it on the server: ServerModel model = association.retrieveModel(); FcModelNode st1 = (FcModelNode) model.findModelNode( new ObjectReference("simpleIOGenericIO/LLN0$ST$Ind1"), Fc.ST); FcModelNode mx1 = (FcModelNode) model.findModelNode( new ObjectReference("simpleIOGenericIO/LLN0$MX$AnIn1"), Fc.MX); List members = new ArrayList<>(); members.add(st1); members.add(mx1); DataSet dataSet = new DataSet("simpleIOGenericIO/LLN0.myDataSet", members); // deletable default true association.createDataSet(dataSet); // Later: read all member values (null entry == read OK) List errors = association.getDataSetValues(dataSet); for (int i = 0; i < errors.size(); i++) { if (errors.get(i) == null) { System.out.println(dataSet.getMember(i).getValueString()); } else { System.out.println("member " + i + " failed: " + errors.get(i).getErrorCode()); } } ``` -------------------------------- ### ObjectReference usage example Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/data-set.md Shows parsing behavior: splits on '/' and '.', not on '$'. The example creates a reference with two parts and prints LD name, logical node flag, and last name. ```java ObjectReference ref = new ObjectReference("simpleIOGenericIO/LLN0$ST$Ind1"); // The parser splits on '/' and '.', not on '$' — '$' stays inside the name parts, e.g.: // ["simpleIOGenericIO", "LLN0$ST$Ind1"] (2 parts) System.out.println(ref.getLdName()); // simpleIOGenericIO System.out.println(ref.isLogicalNodeRef()); // true (size() == 2) System.out.println(ref.getName()); // LLN0$ST$Ind1 ``` -------------------------------- ### get(int i) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/data-set.md Returns the name part at the specified index (0-based). ```APIDOC ## get(int i) ### Description Returns the name part at the specified index (0-based). ### Method ```java public String get(int i) ``` ### Parameters - **i** (int) - Required - The index of the name part to retrieve. ### Returns - **String** - The name part at the given index. ### Example ```java ObjectReference ref = new ObjectReference("simpleIOGenericIO/LLN0$ST$Ind1"); String first = ref.get(0); // "simpleIOGenericIO" ``` ``` -------------------------------- ### ClientSap association example Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/client-sap.md Shows how to create a ClientSap, set MMS PDU size and response timeout, associate with a server, and disconnect. The listener receives reports and association-closed events. Associate may throw IOException, which is caught and printed. ```java import com.beanit.iec61850bean.*; import java.net.InetAddress; ClientSap clientSap = new ClientSap(); clientSap.setMaxMmsPduSize(20000); clientSap.setResponseTimeout(30000); InetAddress address = InetAddress.getByName("192.168.1.10"); ClientEventListener listener = new ClientEventListener() { @Override public void newReport(Report report) { System.out.println("Report received: " + report); } @Override public void associationClosed(java.io.IOException e) { System.out.println("Association closed: " + e); } }; try { ClientAssociation association = clientSap.associate(address, 102, null, listener); // work with the association ... association.disconnect(); } catch (java.io.IOException e) { System.err.println("Association failed: " + e.getMessage()); } ``` -------------------------------- ### Usage example: connect, retrieve model, read values Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/client-association.md Connects to a server, retrieves the model, finds a node, reads data values, and disconnects. The comment references client-sap.md for connection details. The `$` separates LN/FCDO in the ObjectReference. ```java // Connect (see client-sap.md), then retrieve the model and read/write a value: ClientSap sap = new ClientSap(); ClientAssociation assoc = sap.associate(InetAddress.getByName("127.0.0.1"), 102, null, null); ServerModel model = assoc.retrieveModel(); FcModelNode measurand = (FcModelNode) model.findModelNode( new ObjectReference("simpleIOGenericIO/LLN0$ST$AnIn1"), Fc.ST); // `$` separates LN/FCDO assoc.getDataValues(measurand); // BDA values are now populated for (BasicDataAttribute bda : measurand.getBasicDataAttributes()) { System.out.println(bda.getReference() + " = " + bda.getValueString()); } assoc.disconnect(); ``` -------------------------------- ### DataSet constructor Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/errors.md Constructs a DataSet with a reference. Throws IllegalArgumentException if the reference does not start with '@' or contain a slash. ```APIDOC ## DataSet constructor ### Description Constructs a DataSet with a reference. Throws IllegalArgumentException if the reference does not start with '@' or contain a slash. ### Method Constructor ### Parameters - **reference** (String) - Required - The data set reference. ### Exceptions - **IllegalArgumentException** - Thrown when reference is invalid. Message: "DataSet reference is invalid. Must either start with @ or contain a slash.". ``` -------------------------------- ### ServerTSap setters after startListening Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/errors.md Setters for server TSAP parameters. Throws RuntimeException if called after the server has started listening. ```APIDOC ## ServerTSap setters after startListening ### Description Setters for server TSAP parameters. Throws RuntimeException if called after the server has started listening. ### Method Various setters ### Exceptions - **RuntimeException** - Thrown when called after startListening. Messages: "Message timeout may not be set while the server SAP ist listening." or "Trying to set parameter although server has started.". ``` -------------------------------- ### Transport layer usage example with ServerTSap and ClientTSap Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Shows a server and client using the jositransport package. The server listens on port 10002, receives a message, and echoes it back. The client connects to 127.0.0.1:10002, sends "hello", and receives the response. ```java import com.beanit.jositransport.*; // Server ServerTSap serverTsap = new ServerTSap(10002, 0, null, new TConnectionListener() { @Override public void connectionIndication(TConnection tConnection) { System.out.println("New connection"); ByteBuffer buf = ByteBuffer.allocate(1024); try { tConnection.receive(buf); buf.flip(); tConnection.send(buf.array(), buf.position(), buf.remaining()); } catch (Exception e) { // handle } } @Override public void serverStoppedListeningIndication(java.io.IOException e) { } }); serverTsap.startListening(); // Client ClientTSap clientTsap = new ClientTSap(); clientTsap.tSelLocal = new byte[] {0, 0}; clientTsap.tSelRemote = new byte[] {0, 1}; TConnection con = clientTsap.connectTo(InetAddress.getByName("127.0.0.1"), 10002); ByteBuffer out = ByteBuffer.wrap("hello".getBytes()); con.send(out.array(), 0, 5); ByteBuffer in = ByteBuffer.allocate(1024); con.receive(in); con.disconnect(); ``` -------------------------------- ### Client: reserve RCB, configure, enable, receive reports Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/reporting.md Shows the client-side flow to associate with a server, retrieve the model, configure a URCB, enable reporting, and start a general interrogation. The newReport callback prints report ID, member references, values, and reason codes. Requires a running server at 127.0.0.1:102. ```java // Client: reserve RCB, configure, enable, receive reports ClientSap sap = new ClientSap(); ClientAssociation assoc = sap.associate(InetAddress.getByName("127.0.0.1"), 102, null, new ClientEventListener() { @Override public void newReport(Report report) { System.out.println("Report " + report.getRptId()); for (int i = 0; i < report.getValues().size(); i++) { FcModelNode member = report.getValues().get(i); System.out.println(" " + member.getReference() + " = " + member.getBasicDataAttributes().get(0).getValueString()); if (report.getReasonCodes() != null) { System.out.println(" reason: " + report.getReasonCodes().get(i)); } } } @Override public void associationClosed(java.io.IOException e) { /* ... */ } }); ServerModel model = assoc.retrieveModel(); Urcb urcb = model.getUrcb("simpleIOGenericIO/LLN0$RP$urcb01"); assoc.getRcbValues(urcb); assoc.reserveUrcb(urcb); assoc.setRcbValues(urcb, true, // setRptId true, // setDatSet true, // setOptFlds false, // setBufTm true, // setTrgOps false, // setIntgPd false, // setPurgeBuf (BRCB only) false); // setEntryId (BRCB only) assoc.enableReporting(urcb); assoc.startGi(urcb); ``` -------------------------------- ### Reading a Quality Attribute (BdaQuality) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/complex-data-attributes.md Shows how to read a quality attribute from a data object using BdaQuality. The example retrieves the child element named "q" and prints its validity, overflow, and test flags. ```java // Reading a quality attribute: BdaQuality quality = (BdaQuality) anIn1.getChild("q"); System.out.println("validity=" + quality.getValidity() + " overflow=" + quality.isOverflow() + " test=" + quality.isTest()); ``` -------------------------------- ### DataSet constructors Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/data-set.md Provides two constructors for DataSet. The first delegates to the second with deletable set to true. The second allows specifying whether the data set is deletable. The reference must start with '@' or contain a slash, otherwise an IllegalArgumentException is thrown. ```java public DataSet(String dataSetReference, List members) { this(dataSetReference, members, true); } public DataSet(String dataSetReference, List members, boolean deletable) { ``` -------------------------------- ### BdaCheck Methods Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/complex-data-attributes.md Methods to get and set the synchrocheck and interlock check bits, copy the attribute, and get a string representation. ```APIDOC ## BdaCheck Methods ### Description Methods to get and set the synchrocheck and interlock check bits, copy the attribute, and get a string representation. ### Methods #### getSynchrocheck ```java public boolean getSynchrocheck() ``` - Returns the synchrocheck bit (0x80). - Source: `BdaCheck.java:25` #### setSynchrocheck ```java public void setSynchrocheck(boolean value) ``` - Sets the synchrocheck bit (0x80). - Source: `BdaCheck.java:29` #### getInterlockCheck ```java public boolean getInterlockCheck() ``` - Returns the interlock check bit (0x40). - Source: `BdaCheck.java:37` #### setInterlockCheck ```java public void setInterlockCheck(boolean value) ``` - Sets the interlock check bit (0x40). - Source: `BdaCheck.java:41` #### copy ```java public BdaCheck copy() ``` - Returns a copy of this BdaCheck. - Source: `BdaCheck.java:50` #### toString ```java public String toString() ``` - Returns a string representation of this BdaCheck. - Source: `BdaCheck.java:65` ``` -------------------------------- ### BdaDoubleBitPos Methods Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/complex-data-attributes.md Methods to get and set the double bit position, get a string value, copy the attribute, and set the default value. ```APIDOC ## BdaDoubleBitPos Methods ### Description Methods to get and set the double bit position, get a string value, copy the attribute, and set the default value. ### Methods #### getDoubleBitPos ```java public DoubleBitPos getDoubleBitPos() ``` - Returns the current double bit position. - Source: `BdaDoubleBitPos.java:45` #### setDoubleBitPos ```java public void setDoubleBitPos(DoubleBitPos doubleBitPos) ``` - Sets the double bit position. - Source: `BdaDoubleBitPos.java:62` #### getValueString ```java public String getValueString() ``` - Returns a string representation of the value. - Source: `BdaDoubleBitPos.java:75` #### copy ```java public BdaDoubleBitPos copy() ``` - Returns a copy of this BdaDoubleBitPos. - Source: `BdaDoubleBitPos.java:32` #### setDefault ```java public void setDefault() ``` - Sets the default value. - Source: `BdaDoubleBitPos.java:27` ``` -------------------------------- ### ServerSap constructor Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Creates a ServerSap instance for an IEC 61850 server application. Configure the instance and then call startListening(). ```APIDOC ## Constructor ### Description Creates a ServerSap instance for an IEC 61850 server application. Configure the instance and then call startListening(). ### Signature ```java public ServerSap( int port, int backlog, InetAddress bindAddr, ServerModel serverModel, ServerSocketFactory serverSocketFactory) ``` ### Parameters - **port** (int) - Required - Local port to listen on for new connections - **backlog** (int) - Required - Maximum queue length for incoming connection indications; if full, connections are refused. 0 or less = OS default. - **bindAddr** (InetAddress) - Optional (null) - Local IP to bind to; null binds to all. - **serverModel** (ServerModel) - Required - The server's data model (obtain a copy via SclParser.parse). - **serverSocketFactory** (ServerSocketFactory) - Optional (null) - Factory for the ServerSocket, e.g. for SSL; null = ServerSocketFactory.getDefault(). ``` -------------------------------- ### Run ConsoleClient with host, port, and model file Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/console-apps.md Launches the interactive IEC 61850 MMS client. The -h option is required; -p defaults to 102 and -m is optional. After connecting, use keys like m to print the model, g to send GetDataValues, and q to quit. ```bash bin/iec61850bean-console-client -h 127.0.0.1 -p 10002 -m sample-model.icd # interactive: m -> prints model # g simpleIOGenericIO/LLN0$MX$AnIn1 MX # q -> quit ``` -------------------------------- ### BdaVisibleString Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/basic-data-attributes.md Represents a visible string basic data attribute in the IEC 61850 model. Provides methods to get and set the string value, get the maximum length, set default value, and copy the attribute. ```APIDOC ## BdaVisibleString ### Description Represents a visible string basic data attribute in the IEC 61850 model. Provides methods to get and set the string value, get the maximum length, set default value, and copy the attribute. ### Constructor `BdaVisibleString(ObjectReference, Fc, String sAddr, int maxLength, boolean dchg, boolean dupd)` ### Methods - `public byte[] getValue()` - Returns the current value as a byte array. - `public void setValue(byte[] value)` - Sets the value from a byte array. Throws `IllegalArgumentException` if value is null or exceeds maxLength. - `public void setValue(String value)` - Convenience overload that sets the value from a UTF-8 encoded string. - `public void setValueFrom(BasicDataAttribute bda)` - Copies the value from another BasicDataAttribute. - `public int getMaxLength()` - Returns the maximum allowed length of the string. - `public String getStringValue()` - Returns the value as a UTF-8 string. - `public void setDefault()` - Sets the value to an empty byte array. - `public BdaVisibleString copy()` - Returns a copy of this attribute. - `public String getValueString()` - Returns a string representation of the value. ``` -------------------------------- ### toString() Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-model.md Renders the tree of logical devices plus URCBs, BRCBs, and Data sets sections. ```APIDOC ## toString() ### Description Renders the tree of logical devices plus URCBs, BRCBs, and Data sets sections. ### Signature ```java public String toString() ``` ### Returns - **String** - String representation of the model ### Source `ServerModel.java:203` ``` -------------------------------- ### TConnection timeout getters and setters Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Methods to get and set message and message fragment timeouts. ```java public int getMessageTimeout() { // :448 public void setMessageTimeout(int messageTimeout) { // :458 (0 = wait forever) public int getMessageFragmentTimeout() { // :462 public void setMessageFragmentTimeout(int messageFragmentTimeout) { // :472 ``` -------------------------------- ### startGi(Rcb) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/client-association.md Sets the GI (general interrogation) child to true and writes it. ```APIDOC ## startGi(Rcb) ### Description Sets the `GI` (general interrogation) child to `true` and writes it. ### Method Java method ### Signature ```java public void startGi(Rcb rcb) throws ServiceError, IOException ``` ### Parameters - **rcb** (Rcb) - Required - The report control block ### Throws - `ServiceError` - on service error - `IOException` - on I/O error ``` -------------------------------- ### ServerModel constructor Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-model.md Creates a new ServerModel instance with the given logical devices and initial data sets. The constructor wires URCB/BRCB dataSet fields to the referenced data sets. ```APIDOC ## Constructor ### Description Creates a new ServerModel instance with the given logical devices and initial data sets. The constructor wires URCB/BRCB dataSet fields to the referenced data sets. ### Signature ```java public ServerModel(List logicalDevices, Collection dataSets) ``` ### Parameters - **logicalDevices** (List) - Required - The logical devices of the model - **dataSets** (Collection) - Optional - Initial data sets; may be `null` ### Source `ServerModel.java:35` ``` -------------------------------- ### getBindAddress() / setBindAddress(InetAddress) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Gets or sets the local IP address to bind to. A null value binds to all interfaces. ```APIDOC ## getBindAddress() / setBindAddress(InetAddress) ### Description Gets or sets the local IP address to bind to. A null value binds to all interfaces. ### Methods ```java public InetAddress getBindAddress() public void setBindAddress(InetAddress bindAddr) ``` ### Parameters (setBindAddress) - **bindAddr** (InetAddress) - Optional (null) - Local IP to bind to; null binds to all. ``` -------------------------------- ### ClientAcseSap constructors and config methods Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Constructors and setter methods for configuring the client ACSE SAP. ```java public ClientAcseSap() { // :49 public ClientAcseSap(SocketFactory socketFactory) { // :53 public void setApTitleCalled(int[] title) // :57 public void setApTitleCalling(int[] title) // :61 public void setAeQualifierCalled(int qualifier) // :65 public void setAeQualifierCalling(int qualifier) // :69 ``` -------------------------------- ### ClientTSap configuration methods Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Configuration methods for timeouts and max TPDU size. ```java public void setMessageTimeout(int messageTimeout) { // :74 (connect timeout, ms; 0 = none) public void setMessageFragmentTimeout(int messageFragmentTimeout) { // :84 (default 60000 ms) public int getMaxTPDUSizeParam() { // :93 public void setMaxTPDUSizeParam(int maxTPDUSizeParam) { // :105 (7..16, default 16 → 65531) public void setSocketFactory(SocketFactory socketFactory) { // :154 ``` -------------------------------- ### getPort() / setPort(int) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Gets or sets the local port the server listens on. Default is 102 (standard MMS port). ```APIDOC ## getPort() / setPort(int) ### Description Gets or sets the local port the server listens on. Default is 102 (standard MMS port). ### Methods ```java public int getPort() public void setPort(int port) ``` ### Parameters (setPort) - **port** (int) - Required - The port number to listen on. ``` -------------------------------- ### ServerModel constructor Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-model.md Creates a ServerModel with logical devices and initial data sets. The dataSets parameter may be null. The constructor wires URCB/BRCB dataSet fields to the data sets referenced by their DatSet attribute ($ converted to .). ```java public ServerModel(List logicalDevices, Collection dataSets) { ``` -------------------------------- ### getProposedDataStructureNestingLevel() / setProposedDataStructureNestingLevel(int) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Gets or sets the proposed data structure nesting level. This is an informational parameter with no effect on server functionality. ```APIDOC ## getProposedDataStructureNestingLevel() / setProposedDataStructureNestingLevel(int) ### Description Gets or sets the proposed data structure nesting level. This is an informational parameter with no effect on server functionality. ### Method Getter/Setter (Java) ### Endpoint ServerSap.getProposedDataStructureNestingLevel() / ServerSap.setProposedDataStructureNestingLevel(int) ### Parameters #### Setter Parameter - **value** (int) - Required - The proposed data structure nesting level. Default: 10. ### Source ServerSap.java:223 / :233 ``` -------------------------------- ### getConfRev() Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/reporting.md Returns the configuration revision. ```APIDOC ## getConfRev() ### Description Returns the configuration revision. ### Method Getter ### Signature ```java public Long getConfRev() ``` ### Returns - **Long** - The configuration revision. ``` -------------------------------- ### getBacklog() / setBacklog(int) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Gets or sets the maximum queue length for incoming connection indications. If the queue is full, connections are refused. ```APIDOC ## getBacklog() / setBacklog(int) ### Description Gets or sets the maximum queue length for incoming connection indications. If the queue is full, connections are refused. ### Methods ```java public int getBacklog() public void setBacklog(int backlog) ``` ### Parameters (setBacklog) - **backlog** (int) - Required - Maximum queue length; 0 or less = OS default. ``` -------------------------------- ### ServerSap constructor Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/configuration.md Creates a server-side service access point with the specified port, backlog, bind address, server model, and server socket factory. ```APIDOC ## ServerSap(int port, int backlog, InetAddress bindAddr, ServerModel serverModel, ServerSocketFactory serverSocketFactory) ### Description Creates a server-side service access point with the specified port, backlog, bind address, server model, and server socket factory. ### Method Constructor ### Parameters - **port** (int) - Required - Port to listen on; the console server uses 102. - **backlog** (int) - Required - Max pending connection queue length; 0 or less = OS default. - **bindAddr** (InetAddress) - Required - Local bind address; null = all interfaces. - **serverModel** (ServerModel) - Required - The device model. - **serverSocketFactory** (ServerSocketFactory) - Required - Server socket factory (e.g. SSL); null = default. ### Response No return value. ``` -------------------------------- ### BdaQuality.Validity Enum Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/complex-data-attributes.md Enum representing the validity of a quality attribute. Provides a method to get the integer value of the enum constant. ```APIDOC ## BdaQuality.Validity Enum ### Description Enum representing the validity of a quality attribute. Provides a method to get the integer value of the enum constant. ### Enum Constants - **GOOD** (0) - **INVALID** (1) - **RESERVED** (2) - **QUESTIONABLE** (3) ### Methods - `public int getIntValue()` - Returns the integer value of the enum constant. ### Source `BdaQuality.java:211` ``` -------------------------------- ### getResponseTimeout() Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/client-association.md Gets the response timeout used when sending requests to the server. The client waits this amount of time for a response before throwing a ServiceError.TIMEOUT. ```APIDOC ## getResponseTimeout() ### Description Gets the response timeout. The response timeout is used whenever a request is sent to the server. The client will wait for this amount of time for the server's response before throwing a ServiceError.TIMEOUT. Responses received after the timeout will be automatically discarded. ### Method GET ### Endpoint ClientAssociation.getResponseTimeout() ### Parameters None ### Response #### Success Response - **timeout** (int) - The response timeout in milliseconds. #### Response Example ```java int timeout = clientAssociation.getResponseTimeout(); ``` ``` -------------------------------- ### ClientTSap constructors Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Constructors for ClientTSap, with optional SocketFactory. ```java public ClientTSap() { // :37 — SocketFactory.getDefault() public ClientTSap(SocketFactory socketFactory) { // :47 — e.g. SSLSocketFactory for TLS ``` -------------------------------- ### getServicesSupportedCalled() / setServicesSupportedCalled(byte[]) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Gets or sets the services supported called parameter. The setter validates the array length is 11 and throws IllegalArgumentException if not. ```APIDOC ## getServicesSupportedCalled() / setServicesSupportedCalled(byte[]) ### Description Gets or sets the services supported called parameter. The setter validates the array length is 11 and throws IllegalArgumentException if not. ### Method Getter/Setter (Java) ### Endpoint ServerSap.getServicesSupportedCalled() / ServerSap.setServicesSupportedCalled(byte[] services) ### Parameters #### Setter Parameter - **services** (byte[]) - Required - The services supported called array. Must be of length 11. Default: {0xee, 0x1c, 0, 0, 0x04, 0x08, 0, 0, 0x79, 0xef, 0x18}. ### Exceptions - **IllegalArgumentException** - Thrown if the array length is not 11. ### Source ServerSap.java:242 / :252 ``` -------------------------------- ### getProposedMaxServOutstandingCalled() / setProposedMaxServOutstandingCalled(int) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Gets or sets the proposed maximum number of outstanding called services. This is an informational parameter with no effect on server functionality. ```APIDOC ## getProposedMaxServOutstandingCalled() / setProposedMaxServOutstandingCalled(int) ### Description Gets or sets the proposed maximum number of outstanding called services. This is an informational parameter with no effect on server functionality. ### Method Getter/Setter (Java) ### Endpoint ServerSap.getProposedMaxServOutstandingCalled() / ServerSap.setProposedMaxServOutstandingCalled(int) ### Parameters #### Setter Parameter - **value** (int) - Required - The proposed maximum number of outstanding called services. Default: 5. ### Source ServerSap.java:204 / :214 ``` -------------------------------- ### ClientSap() Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/client-sap.md Creates a client SAP with default selectors and transport parameters. Use this constructor to create a default client SAP. ```APIDOC ## ClientSap() ### Description Creates a client SAP with default selectors and transport parameters. ### Constructor `public ClientSap()` ### Default Values - **tSelLocal** (byte[]) - `{0, 0}` - **tSelRemote** (byte[]) - `{0, 1}` - **maxTPDUSizeParam** (int) - `10` (TPDU size = 1024 octets) ### Usage ```java ClientSap sap = new ClientSap(); ``` ``` -------------------------------- ### ClientTSap.ClientTSap() Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Constructs a ClientTSap using the default SocketFactory. ```APIDOC ## ClientTSap.ClientTSap() ### Description Constructs a ClientTSap using the default SocketFactory. ### Method ClientTSap ``` -------------------------------- ### getProposedMaxServOutstandingCalling() / setProposedMaxServOutstandingCalling(int) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Gets or sets the proposed maximum number of outstanding calling services. This is an informational parameter with no effect on server functionality. ```APIDOC ## getProposedMaxServOutstandingCalling() / setProposedMaxServOutstandingCalling(int) ### Description Gets or sets the proposed maximum number of outstanding calling services. This is an informational parameter with no effect on server functionality. ### Method Getter/Setter (Java) ### Endpoint ServerSap.getProposedMaxServOutstandingCalling() / ServerSap.setProposedMaxServOutstandingCalling(int) ### Parameters #### Setter Parameter - **value** (int) - Required - The proposed maximum number of outstanding calling services. Default: 5. ### Source ServerSap.java:185 / :195 ``` -------------------------------- ### getServicesSupportedCalling() / setServicesSupportedCalling(byte[]) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/client-sap.md Gets or sets the 11-byte ServicesSupportedCalling bit-flag array sent to the server. The setter throws IllegalArgumentException if the array length is not 11. ```APIDOC ## getServicesSupportedCalling() / setServicesSupportedCalling(byte[]) ### Description Gets or sets the 11-byte ServicesSupportedCalling bit-flag array sent to the server. The setter throws IllegalArgumentException if the array length is not 11. ### Method - `public byte[] getServicesSupportedCalling()` - `public void setServicesSupportedCalling(byte[] services)` ### Parameters #### Setter Parameter - **services** (byte[]) - Required - 11-byte ServicesSupportedCalling bit-flag array. Default: `{0xee, 0x1c, 0, 0, 0x04, 0x08, 0, 0, 0x79, 0xef, 0x18}`. Sent verbatim; has no effect on the functionality of this client. ### Exceptions - **IllegalArgumentException** - Thrown if the array length is not 11. ``` -------------------------------- ### ServerTSap methods Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Public methods for configuration and lifecycle. Methods marked with RuntimeException if already listening throw when called after startListening(). getMaxTPDUSize has same semantics as ClientTSap. ```java public static int getMaxTPDUSize(int maxTPDUSizeParam) // :96 (same semantics as ClientTSap) ``` ```java public void startListening() throws IOException // :112 ``` ```java public void stopListening() // :126 ``` ```java public void setMaxConnections(int maxConnections) // :139 ``` ```java public void setMessageTimeout(int messageTimeout) // :155 — RuntimeException if already listening ``` ```java public void setMessageFragmentTimeout(int messageFragmentTimeout) // :169 — RuntimeException if already listening ``` ```java public int getMaxTPDUSizeParam() // :182 ``` ```java public void setMaxTPDUSizeParam(int maxTPDUSizeParam) // :194 — RuntimeException if already listening ``` -------------------------------- ### ClientTSap connectTo methods Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Establishes RFC 1006 connection, with optional local address and port. ```java public TConnection connectTo(InetAddress address, int port) throws IOException { // :120 public TConnection connectTo(InetAddress address, int port, InetAddress localAddr, int localPort) throws IOException { // :134 ``` -------------------------------- ### getMaxMmsPduSize() / setMaxMmsPduSize(int) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-sap.md Gets or sets the maximum MMS PDU size. The setter validates the size is within the valid range and throws IllegalArgumentException if out of bounds. ```APIDOC ## getMaxMmsPduSize() / setMaxMmsPduSize(int) ### Description Gets or sets the maximum MMS PDU size. The setter validates the size is within the valid range and throws IllegalArgumentException if out of bounds. ### Method Getter/Setter (Java) ### Endpoint ServerSap.getMaxMmsPduSize() / ServerSap.setMaxMmsPduSize(int size) ### Parameters #### Setter Parameter - **size** (int) - Required - The maximum MMS PDU size. Valid range: 64–65000. Default: 65000. If the client requires a smaller size, the smaller size is accepted. ### Exceptions - **IllegalArgumentException** - Thrown if the size is out of the valid range (64–65000). ### Source ServerSap.java:140 / :152 ``` -------------------------------- ### copy() Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/server-model.md Creates a deep copy of the ServerModel, including all children. Data sets are shared references, not copied. ```APIDOC ## copy() ### Description Creates a deep copy of the ServerModel, including all children. Data sets are shared references, not copied. ### Signature ```java public ServerModel copy() ``` ### Returns - **ServerModel** - A deep copy of this model ### Source `ServerModel.java:62` ``` -------------------------------- ### ByteBufferInputStream.read(byte[], int, int) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Reads up to len bytes into the given byte array starting at offset off. This method implements the bulk read operation. ```APIDOC ## [METHOD] ByteBufferInputStream.read(byte[], int, int) ### Description Reads up to len bytes into the given byte array starting at offset off. ### Method read ### Endpoint ByteBufferInputStream.read(byte[] b, int off, int len) ### Parameters - **b** (byte[]) - Required - Destination buffer - **off** (int) - Required - Offset in the buffer - **len** (int) - Required - Maximum number of bytes to read ### Response Returns an `int` containing the number of bytes read, or -1 if end of stream. ### Exceptions - **IOException** - Thrown if an I/O error occurs. ``` -------------------------------- ### ServerTSap.getMaxTPDUSize / setMaxTPDUSizeParam Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/errors.md Gets or sets the maximum TPDU size for the server TSAP. Throws IllegalArgumentException if the size is outside the valid range of 7 to 16. ```APIDOC ## ServerTSap.getMaxTPDUSize / setMaxTPDUSizeParam ### Description Gets or sets the maximum TPDU size for the server TSAP. Throws IllegalArgumentException if the size is outside the valid range of 7 to 16. ### Method getMaxTPDUSize / setMaxTPDUSizeParam ### Parameters - **maxTPDUSizeParam** (int) - Required - The maximum TPDU size. ### Exceptions - **IllegalArgumentException** - Thrown when size is outside 7–16. Message: "maxTPDUSizeParam is out of bound". ``` -------------------------------- ### toString() Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/data-set.md Returns the original object reference string. ```APIDOC ## toString() ### Description Returns the original object reference string. ### Method ```java public String toString() ``` ### Returns - **String** - The original object reference string. ### Example ```java ObjectReference ref = new ObjectReference("simpleIOGenericIO/LLN0$ST$Ind1"); String str = ref.toString(); // "simpleIOGenericIO/LLN0$ST$Ind1" ``` ``` -------------------------------- ### ClientTSap.getMaxTPDUSize / setMaxTPDUSizeParam Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/errors.md Gets or sets the maximum TPDU size for the client TSAP. Throws IllegalArgumentException if the size is outside the valid range of 7 to 16. ```APIDOC ## ClientTSap.getMaxTPDUSize / setMaxTPDUSizeParam ### Description Gets or sets the maximum TPDU size for the client TSAP. Throws IllegalArgumentException if the size is outside the valid range of 7 to 16. ### Method getMaxTPDUSize / setMaxTPDUSizeParam ### Parameters - **maxTPDUSizeParam** (int) - Required - The maximum TPDU size. ### Exceptions - **IllegalArgumentException** - Thrown when size is outside 7–16. Message: "maxTPDUSizeParam is out of bound". ``` -------------------------------- ### DataSet(String dataSetReference, List members) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/data-set.md Creates a new DataSet with the given reference and members. The data set is deletable by default. The reference must start with '@' or contain a slash. ```APIDOC ## [CONSTRUCTOR] DataSet(String dataSetReference, List members) ### Description Creates a new DataSet with the given reference and members. The data set is deletable by default. ### Parameters - **dataSetReference** (String) - Required - `LD/LN.DataSetName` (persistent) or `@DataSetName` (non-persistent). Must start with `@` or contain a `/`. - **members** (List) - Required - Model nodes that form the data set (must belong to the model). ### Throws - **IllegalArgumentException** - If the reference does not start with `@` or contain a slash. ### Example ```java DataSet dataSet = new DataSet("simpleIOGenericIO/LLN0.myDataSet", members); ``` ``` -------------------------------- ### ServerAcseSap constructors Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Constructors for the server ACSE SAP. ```java public ServerAcseSap(int port, AcseAssociationListener listener, ServerSocketFactory serverSocketFactory) { // :48 public ServerAcseSap(int port, int backlog, InetAddress bindAddr, AcseAssociationListener listener, ServerSocketFactory serverSocketFactory) { // :65 ``` -------------------------------- ### getMaxMmsPduSize() / setMaxMmsPduSize(int size) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/client-sap.md Gets or sets the maximum MMS PDU size in bytes proposed to the server during association. The setter throws IllegalArgumentException if the size is out of the valid range (64–65000). ```APIDOC ## getMaxMmsPduSize() / setMaxMmsPduSize(int size) ### Description Gets or sets the maximum MMS PDU size in bytes proposed to the server during association. The setter throws IllegalArgumentException if the size is out of the valid range (64–65000). ### Method - `public int getMaxMmsPduSize()` - `public void setMaxMmsPduSize(int size)` ### Parameters #### Setter Parameter - **size** (int) - Required - Maximum MMS PDU size in bytes. Valid range: 64–65000. Default: 65000. ### Exceptions - **IllegalArgumentException** - Thrown if `size` is out of range. ### Notes If the server requires a smaller maximum MMS PDU size, the smaller size is accepted. ``` -------------------------------- ### ServerTSap(int port, int backlog, InetAddress bindAddr, TConnectionListener conListener) Source: https://github.com/beanit/iec61850bean/blob/master/_autodocs/api-reference/osi-stack.md Creates a ServerTSap instance with a specified port, backlog, bind address, and connection listener. The port must be between 1 and 65535, otherwise an IllegalArgumentException is thrown. ```APIDOC ## Constructor ### Description Creates a ServerTSap instance with a specified port, backlog, bind address, and connection listener. ### Signature ```java public ServerTSap(int port, int backlog, InetAddress bindAddr, TConnectionListener conListener) ``` ### Parameters - **port** (int) - Required - The port number to listen on. Must be between 1 and 65535. - **backlog** (int) - Required - The maximum number of pending connections. - **bindAddr** (InetAddress) - Required - The local address to bind to. - **conListener** (TConnectionListener) - Required - The listener for connection indications. ### Exceptions - **IllegalArgumentException** - If port is out of the range 1-65535. ```