From c7f1504bfc68f358af1a047fc165bd31fdd56881 Mon Sep 17 00:00:00 2001 From: Philipp Jungkamp Date: Fri, 18 Jul 2025 16:06:02 +0200 Subject: [PATCH 1/2] - configure automatic line ending conversion --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..cc9347ea4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto From 1297637dd08023486d50d57cfd74c5e70e767282 Mon Sep 17 00:00:00 2001 From: Philipp Jungkamp Date: Fri, 18 Jul 2025 16:46:30 +0200 Subject: [PATCH 2/2] - normalize line endings to LF --- demos/beaglebone/beagle_demo.icd | 1092 +++++++------- demos/beaglebone/beagle_demo.iid | 1092 +++++++------- dotnet/IEC61850forCSharp/Control.cs | 50 +- dotnet/IEC61850forCSharp/IEC61850.NET.csproj | 102 +- dotnet/IEC61850forCSharp/MmsValue.cs | 78 +- dotnet/IEC61850forCSharp/Reporting.cs | 14 +- dotnet/datasets/DataSetExample.cs | 8 +- dotnet/dotnet.sln | 324 ++-- dotnet/example1/Main.cs | 106 +- dotnet/example1/example1.csproj | 84 +- dotnet/report_new_dataset/Main.cs | 10 +- dotnet/reporting/Settings.cs | 56 +- dotnet/reporting/reporting.csproj | 162 +- dotnet/server1/Program.cs | 22 +- dotnet/tests/Test.cs | 2 +- dotnet/tests/simpleIO_control_tests.scd | 860 +++++------ dotnet/tests/test.icd | 652 ++++---- dotnet/tests/tests.csproj | 92 +- .../simpleIO_direct_control.cid | 718 ++++----- .../simpleIO_direct_control.icd | 614 ++++---- .../mhai_array.cid | 626 ++++---- .../simpleIO_direct_control_goose.cid | 516 +++---- .../simpleIO_control_tests.cid | 664 ++++----- .../cid_example_deadband.cid | 882 +++++------ .../simpleIO_direct_control.cid | 558 +++---- .../simpleIO_direct_control_goose.cid | 550 +++---- .../simpleIO_direct_control.cid | 608 ++++---- .../simpleIO_direct_control.cid | 448 +++--- .../CMakeLists.txt | 42 +- .../server_example_service_tracking.c | 572 +++---- .../simpleIO_ltrk_tests.icd | 1310 ++++++++--------- .../sampleModel_with_dataset.cid | 362 ++--- .../simpleIO_direct_control.cid | 506 +++---- .../complexModel.cid | 694 ++++----- hal/CMakeLists.txt | 474 +++--- hal/thread/macos/thread_macos.c | 298 ++-- .../inc_private/iec61850_common_internal.h | 82 +- .../inc_private/mms_mapping_internal.h | 708 ++++----- src/mms/iso_mms/asn1c/asn_system.h | 244 +-- src/mms/iso_mms/asn1c/xer_encoder.h | 122 +- tools/model_generator/complexModel.icd | 680 ++++----- tools/model_generator/genericIO.icd | 286 ++-- tools/model_generator/inverter3ph.icd | 362 ++--- .../model_generator/inverter_with_report.icd | 540 +++---- tools/model_generator/manifest-dynamic.mf | 4 +- tools/model_generator/manifest-dyncCode.mf | 4 +- tools/model_generator/manifest-modelviewer.mf | 4 +- tools/model_generator/manifest.mf | 4 +- tools/model_generator/sampleModel.icd | 342 ++--- tools/model_generator/sampleModel_errors.icd | 342 ++--- .../sampleModel_with_dataset.icd | 416 +++--- .../simpleIO_direct_control_goose.scd | 504 +++---- 52 files changed, 9946 insertions(+), 9946 deletions(-) diff --git a/demos/beaglebone/beagle_demo.icd b/demos/beaglebone/beagle_demo.icd index 57cdbb999..bcc870d3b 100644 --- a/demos/beaglebone/beagle_demo.icd +++ b/demos/beaglebone/beagle_demo.icd @@ -1,546 +1,546 @@ - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EXT:2015 - - - - - - - - - - - - - - - - - - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - blocked - test - test/blocked - off - - - - Ok - Warning - Alarm - - - - unknown - forward - backward - both - - - - status-only - direct-with-normal-security - - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - - - not-ready - validated - ready - running - - - - Time - WeekDay - WeekOfYear - DayOfMonth - DayOfYear - - - - Hour - Day - Week - Month - Year - - - - reserved - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday - - - - reserved - January - February - March - April - May - June - July - August - September - October - November - December - - - - MS - PER_CYCLE - CYCLE - DAY - WEEK - MONTH - YEAR - EXTERNAL - - -
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXT:2015 + + + + + + + + + + + + + + + + + + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + blocked + test + test/blocked + off + + + + Ok + Warning + Alarm + + + + unknown + forward + backward + both + + + + status-only + direct-with-normal-security + + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + + not-ready + validated + ready + running + + + + Time + WeekDay + WeekOfYear + DayOfMonth + DayOfYear + + + + Hour + Day + Week + Month + Year + + + + reserved + Monday + Tuesday + Wednesday + Thursday + Friday + Saturday + Sunday + + + + reserved + January + February + March + April + May + June + July + August + September + October + November + December + + + + MS + PER_CYCLE + CYCLE + DAY + WEEK + MONTH + YEAR + EXTERNAL + + +
diff --git a/demos/beaglebone/beagle_demo.iid b/demos/beaglebone/beagle_demo.iid index 449274cb9..d895e7921 100644 --- a/demos/beaglebone/beagle_demo.iid +++ b/demos/beaglebone/beagle_demo.iid @@ -1,546 +1,546 @@ - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EXT:2015 - - - - - - - - - - - - - - - - - - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - blocked - test - test/blocked - off - - - - Ok - Warning - Alarm - - - - unknown - forward - backward - both - - - - status-only - direct-with-normal-security - - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - - - not-ready - validated - ready - running - - - - Time - WeekDay - WeekOfYear - DayOfMonth - DayOfYear - - - - Hour - Day - Week - Month - Year - - - - reserved - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday - - - - reserved - January - February - March - April - May - June - July - August - September - October - November - December - - - - MS - PER_CYCLE - CYCLE - DAY - WEEK - MONTH - YEAR - EXTERNAL - - -
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EXT:2015 + + + + + + + + + + + + + + + + + + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + blocked + test + test/blocked + off + + + + Ok + Warning + Alarm + + + + unknown + forward + backward + both + + + + status-only + direct-with-normal-security + + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + + not-ready + validated + ready + running + + + + Time + WeekDay + WeekOfYear + DayOfMonth + DayOfYear + + + + Hour + Day + Week + Month + Year + + + + reserved + Monday + Tuesday + Wednesday + Thursday + Friday + Saturday + Sunday + + + + reserved + January + February + March + April + May + June + July + August + September + October + November + December + + + + MS + PER_CYCLE + CYCLE + DAY + WEEK + MONTH + YEAR + EXTERNAL + + +
diff --git a/dotnet/IEC61850forCSharp/Control.cs b/dotnet/IEC61850forCSharp/Control.cs index 97a3d7673..a158609ad 100644 --- a/dotnet/IEC61850forCSharp/Control.cs +++ b/dotnet/IEC61850forCSharp/Control.cs @@ -33,19 +33,19 @@ namespace Common { /// /// Control model - /// - public enum ControlModel - { - /** status only */ - STATUS_ONLY = 0, - /** direct with normal security */ - DIRECT_NORMAL= 1, - /** select before operate (SBO) with normal security */ - SBO_NORMAL = 2, - /** direct with enhanced security */ - DIRECT_ENHANCED = 3, - /** select before operate (SBO) with enhanced security */ - SBO_ENHANCED = 4 + /// + public enum ControlModel + { + /** status only */ + STATUS_ONLY = 0, + /** direct with normal security */ + DIRECT_NORMAL= 1, + /** select before operate (SBO) with normal security */ + SBO_NORMAL = 2, + /** direct with enhanced security */ + DIRECT_ENHANCED = 3, + /** select before operate (SBO) with enhanced security */ + SBO_ENHANCED = 4 } /// @@ -128,7 +128,7 @@ public class ControlObject : IDisposable [DllImport ("iec61850", CallingConvention = CallingConvention.Cdecl)] private static extern int ControlObjectClient_getLastError (IntPtr self); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] private static extern bool ControlObjectClient_operate(IntPtr self, IntPtr ctlVal, UInt64 operTime); @@ -156,15 +156,15 @@ private static extern UInt32 ControlObjectClient_selectWithValueAsync(IntPtr sel private static extern UInt32 ControlObjectClient_cancelAsync(IntPtr self, out int err, ControlObjectClient_ControlActionHandler handler, IntPtr parameter); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] private static extern bool ControlObjectClient_select(IntPtr self); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] private static extern bool ControlObjectClient_selectWithValue(IntPtr self, IntPtr ctlVal); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] private static extern bool ControlObjectClient_cancel(IntPtr self); @@ -178,8 +178,8 @@ private static extern UInt32 ControlObjectClient_cancelAsync(IntPtr self, out in private static extern void ControlObjectClient_setSynchroCheck(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] - private static extern void ControlObjectClient_setTestMode(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value); - + private static extern void ControlObjectClient_setTestMode(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void InternalCommandTerminationHandler(IntPtr parameter,IntPtr controlClient); @@ -187,8 +187,8 @@ private static extern UInt32 ControlObjectClient_cancelAsync(IntPtr self, out in private static extern void ControlObjectClient_setCommandTerminationHandler(IntPtr self, InternalCommandTerminationHandler handler, IntPtr handlerParameter); - public delegate void CommandTerminationHandler (Object parameter, ControlObject controlObject); - + public delegate void CommandTerminationHandler (Object parameter, ControlObject controlObject); + private IedConnection iedConnection; private IntPtr self; @@ -204,7 +204,7 @@ private void MyCommandTerminationHandler (IntPtr paramter, IntPtr controlClient) private InternalCommandTerminationHandler intCommandTerminationHandler; internal ControlObject (string objectReference, IntPtr connection, IedConnection iedConnection) - { + { this.iedConnection = iedConnection; this.self = ControlObjectClient_create(objectReference, connection); @@ -525,8 +525,8 @@ public UInt32 SelectAsync(ControlActionHandler handler, object parameter) Tuple callbackInfo = Tuple.Create(handler, parameter); - GCHandle handle = GCHandle.Alloc(callbackInfo); - + GCHandle handle = GCHandle.Alloc(callbackInfo); + if (internalOperateHandler == null) internalOperateHandler = new ControlObjectClient_ControlActionHandler(nativeOperateHandler); @@ -775,7 +775,7 @@ public void Dispose() { Dispose (true); } - ~ControlObject() + ~ControlObject() { Dispose (false); } diff --git a/dotnet/IEC61850forCSharp/IEC61850.NET.csproj b/dotnet/IEC61850forCSharp/IEC61850.NET.csproj index 4aa6af869..4a0133626 100644 --- a/dotnet/IEC61850forCSharp/IEC61850.NET.csproj +++ b/dotnet/IEC61850forCSharp/IEC61850.NET.csproj @@ -1,52 +1,52 @@ - - - - Debug - AnyCPU - {C35D624E-5506-4560-8074-1728F1FA1A4D} - Library - iec61850dotnet - iec61850dotnet - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - - - none - true - bin\Release - prompt - 4 - false - - - - - - - - - - - - - - - - - - - - - - - - + + + + Debug + AnyCPU + {C35D624E-5506-4560-8074-1728F1FA1A4D} + Library + iec61850dotnet + iec61850dotnet + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + none + true + bin\Release + prompt + 4 + false + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dotnet/IEC61850forCSharp/MmsValue.cs b/dotnet/IEC61850forCSharp/MmsValue.cs index d262688a9..7428f03ff 100644 --- a/dotnet/IEC61850forCSharp/MmsValue.cs +++ b/dotnet/IEC61850forCSharp/MmsValue.cs @@ -25,7 +25,7 @@ using System.Runtime.InteropServices; using System.Collections.Generic; -using System.Collections; +using System.Collections; using System.Text; namespace IEC61850 @@ -52,10 +52,10 @@ public class MmsValue : IEnumerable, IDisposable [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern void MmsValue_setDouble (IntPtr self, double newFloatValue); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] - static extern bool MmsValue_getBoolean (IntPtr self); - + static extern bool MmsValue_getBoolean (IntPtr self); + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern void MmsValue_setBoolean(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool value); @@ -77,7 +77,7 @@ public class MmsValue : IEnumerable, IDisposable [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern void MmsValue_setBitStringBit(IntPtr self, int bitPos, [MarshalAs(UnmanagedType.I1)] bool value); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool MmsValue_getBitStringBit(IntPtr self, int bitPos); @@ -142,9 +142,9 @@ public class MmsValue : IEnumerable, IDisposable static extern IntPtr MmsValue_newIntegerFromInt64 (Int64 integer); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] - static extern IntPtr MmsValue_newBitString(int bitSize); - - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr MmsValue_newBitString(int bitSize); + + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr MmsValue_newVisibleString(string value); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] @@ -183,7 +183,7 @@ public class MmsValue : IEnumerable, IDisposable [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr MmsValue_getOctetStringBuffer(IntPtr self); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool MmsValue_equals(IntPtr self, IntPtr otherValue); @@ -261,9 +261,9 @@ public MmsValue (long value) /// Create a new instance of type MMS_VISIBLE_STRING. /// /// Value. - public MmsValue (string value) - { - valueReference = MmsValue_newVisibleString(value); + public MmsValue (string value) + { + valueReference = MmsValue_newVisibleString(value); } public void Dispose() @@ -818,8 +818,8 @@ public Int32 ToInt32 () throw new MmsValueException ("Value type is not integer"); return MmsValue_toInt32 (valueReference); - } - + } + /// /// Sets the 32 bit signed integer. /// @@ -833,8 +833,8 @@ public void SetInt32(int value) throw new MmsValueException("Value type is not integer"); MmsValue_setInt32(valueReference, value); - } - + } + /// /// Return the value as 64 bit signed integer. /// @@ -921,24 +921,24 @@ public bool GetBit (int bitPos) return MmsValue_getBitStringBit(valueReference, bitPos); } - private string GetBitStringAsString() - { - if (GetType() != MmsType.MMS_BIT_STRING) - throw new MmsValueException("Value type is not bit string"); - - int size = Size(); - - StringBuilder builder = new StringBuilder(size); - - for (int i = 0; i < size; i++) - { - if (MmsValue_getBitStringBit(valueReference, i)) - builder.Append('1'); - else - builder.Append('0'); - } - - return builder.ToString(); + private string GetBitStringAsString() + { + if (GetType() != MmsType.MMS_BIT_STRING) + throw new MmsValueException("Value type is not bit string"); + + int size = Size(); + + StringBuilder builder = new StringBuilder(size); + + for (int i = 0; i < size; i++) + { + if (MmsValue_getBitStringBit(valueReference, i)) + builder.Append('1'); + else + builder.Append('0'); + } + + return builder.ToString(); } /// @@ -954,8 +954,8 @@ public bool GetBoolean () return MmsValue_getBoolean (valueReference); else throw new MmsValueException ("Value type is not boolean"); - } - + } + /// /// Sets the boolean value of an MMS_BOOLEAN instance /// @@ -969,8 +969,8 @@ public void SetBoolean(bool value) throw new MmsValueException("Value type is not boolean"); MmsValue_setBoolean(valueReference, value); - } - + } + /// /// Gets the float value of an MMS_FLOAT instance /// @@ -1094,7 +1094,7 @@ public override string ToString () return (MsTimeToDateTimeOffset (GetBinaryTimeAsUtcMs ()).ToString ()); case MmsType.MMS_OCTET_STRING: return BitConverter.ToString (getOctetString ()); - case MmsType.MMS_BIT_STRING: + case MmsType.MMS_BIT_STRING: return GetBitStringAsString(); case MmsType.MMS_STRUCTURE: { diff --git a/dotnet/IEC61850forCSharp/Reporting.cs b/dotnet/IEC61850forCSharp/Reporting.cs index 79a5ac55e..4bd058183 100644 --- a/dotnet/IEC61850forCSharp/Reporting.cs +++ b/dotnet/IEC61850forCSharp/Reporting.cs @@ -88,7 +88,7 @@ public enum ReasonForInclusion public class Report { - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool ClientReport_hasTimestamp(IntPtr self); @@ -101,29 +101,29 @@ public class Report [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern int ClientReport_getReasonForInclusion(IntPtr self, int elementIndex); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool ClientReport_hasSeqNum(IntPtr self); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern UInt16 ClientReport_getSeqNum(IntPtr self); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool ClientReport_hasDataSetName(IntPtr self); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool ClientReport_hasReasonForInclusion(IntPtr self); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool ClientReport_hasConfRev(IntPtr self); [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] static extern UInt32 ClientReport_getConfRev(IntPtr self); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool ClientReport_hasBufOvfl(IntPtr self); @@ -131,7 +131,7 @@ public class Report [return: MarshalAs(UnmanagedType.I1)] static extern bool ClientReport_getBufOvfl(IntPtr self); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I1)] static extern bool ClientReport_hasDataReference(IntPtr self); diff --git a/dotnet/datasets/DataSetExample.cs b/dotnet/datasets/DataSetExample.cs index 727e275fa..aa2433ed9 100644 --- a/dotnet/datasets/DataSetExample.cs +++ b/dotnet/datasets/DataSetExample.cs @@ -12,10 +12,10 @@ public static void Main (string[] args) { IedConnection con = new IedConnection (); - string hostname; - - if (args.Length > 0) - hostname = args[0]; + string hostname; + + if (args.Length > 0) + hostname = args[0]; else hostname = "localhost"; diff --git a/dotnet/dotnet.sln b/dotnet/dotnet.sln index ba4aec173..6544e6752 100644 --- a/dotnet/dotnet.sln +++ b/dotnet/dotnet.sln @@ -1,162 +1,162 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.779 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IEC61850.NET", "IEC61850forCSharp\IEC61850.NET.csproj", "{C35D624E-5506-4560-8074-1728F1FA1A4D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example1", "example1\example1.csproj", "{C616A6DF-831E-443C-9310-3F343A6E3D1A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "model_browsing", "model_browsing\model_browsing.csproj", "{59B85486-F48D-4978-BD35-8F5C3A8288D4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "datasets", "datasets\datasets.csproj", "{D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "control", "control\control.csproj", "{C351CFA4-E54E-49A1-86CE-69643535541A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "reporting", "reporting\reporting.csproj", "{9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example2", "example2\example2.csproj", "{2A226B6D-1D1F-4BFE-B8CC-158116F71270}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "authenticate", "authenticate\authenticate.csproj", "{0BECEC77-2315-4B95-AFF9-E6007E644BBF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{FBDFE530-DBEB-474B-BA54-9AB287DD57B3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "files", "files\files.csproj", "{77127456-19B9-4D1A-AEF9-40F8D1C5695E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example3", "example3\example3.csproj", "{5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "report_new_dataset", "report_new_dataset\report_new_dataset.csproj", "{71485F99-2976-45E6-B73D-4946E594C15C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "log_client", "log_client\log_client.csproj", "{14C71267-2F38-460D-AA55-6803EE80AFB4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{0D2F61F1-A173-44E7-BFB0-B698A1D44D12}" - ProjectSection(SolutionItems) = preProject - .nuget\packages.config = .nuget\packages.config - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "server1", "server1\server1.csproj", "{9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tls_client_example", "tls_client_example\tls_client_example.csproj", "{6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "goose_subscriber", "goose_subscriber\goose_subscriber.csproj", "{1285372C-2E62-494A-A661-8D5D3873318C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sv_subscriber", "sv_subscriber\sv_subscriber.csproj", "{44651D2D-3252-4FD5-8B8B-5552DBE1B499}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tls_server_example", "tls_server_example\tls_server_example.csproj", "{B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client_example_setting_groups", "client_example_setting_groups\client_example_setting_groups.csproj", "{0DA95476-B149-450B-AC36-01CEECFC1A43}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client_example_async", "client_example_async\client_example_async.csproj", "{71902641-776A-47D8-9C0E-9ACBBEAC1370}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "server_goose_publisher", "server_goose_publisher\server_goose_publisher.csproj", "{C14BB883-86B8-401C-B3D6-B655F55F3298}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C35D624E-5506-4560-8074-1728F1FA1A4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C35D624E-5506-4560-8074-1728F1FA1A4D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C35D624E-5506-4560-8074-1728F1FA1A4D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C35D624E-5506-4560-8074-1728F1FA1A4D}.Release|Any CPU.Build.0 = Release|Any CPU - {C616A6DF-831E-443C-9310-3F343A6E3D1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C616A6DF-831E-443C-9310-3F343A6E3D1A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C616A6DF-831E-443C-9310-3F343A6E3D1A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C616A6DF-831E-443C-9310-3F343A6E3D1A}.Release|Any CPU.Build.0 = Release|Any CPU - {59B85486-F48D-4978-BD35-8F5C3A8288D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59B85486-F48D-4978-BD35-8F5C3A8288D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59B85486-F48D-4978-BD35-8F5C3A8288D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59B85486-F48D-4978-BD35-8F5C3A8288D4}.Release|Any CPU.Build.0 = Release|Any CPU - {D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}.Release|Any CPU.Build.0 = Release|Any CPU - {C351CFA4-E54E-49A1-86CE-69643535541A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C351CFA4-E54E-49A1-86CE-69643535541A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C351CFA4-E54E-49A1-86CE-69643535541A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C351CFA4-E54E-49A1-86CE-69643535541A}.Release|Any CPU.Build.0 = Release|Any CPU - {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}.Release|Any CPU.Build.0 = Release|Any CPU - {2A226B6D-1D1F-4BFE-B8CC-158116F71270}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2A226B6D-1D1F-4BFE-B8CC-158116F71270}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2A226B6D-1D1F-4BFE-B8CC-158116F71270}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2A226B6D-1D1F-4BFE-B8CC-158116F71270}.Release|Any CPU.Build.0 = Release|Any CPU - {0BECEC77-2315-4B95-AFF9-E6007E644BBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0BECEC77-2315-4B95-AFF9-E6007E644BBF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0BECEC77-2315-4B95-AFF9-E6007E644BBF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0BECEC77-2315-4B95-AFF9-E6007E644BBF}.Release|Any CPU.Build.0 = Release|Any CPU - {FBDFE530-DBEB-474B-BA54-9AB287DD57B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FBDFE530-DBEB-474B-BA54-9AB287DD57B3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBDFE530-DBEB-474B-BA54-9AB287DD57B3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FBDFE530-DBEB-474B-BA54-9AB287DD57B3}.Release|Any CPU.Build.0 = Release|Any CPU - {77127456-19B9-4D1A-AEF9-40F8D1C5695E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77127456-19B9-4D1A-AEF9-40F8D1C5695E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77127456-19B9-4D1A-AEF9-40F8D1C5695E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77127456-19B9-4D1A-AEF9-40F8D1C5695E}.Release|Any CPU.Build.0 = Release|Any CPU - {5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}.Release|Any CPU.Build.0 = Release|Any CPU - {71485F99-2976-45E6-B73D-4946E594C15C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {71485F99-2976-45E6-B73D-4946E594C15C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {71485F99-2976-45E6-B73D-4946E594C15C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {71485F99-2976-45E6-B73D-4946E594C15C}.Release|Any CPU.Build.0 = Release|Any CPU - {14C71267-2F38-460D-AA55-6803EE80AFB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {14C71267-2F38-460D-AA55-6803EE80AFB4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {14C71267-2F38-460D-AA55-6803EE80AFB4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {14C71267-2F38-460D-AA55-6803EE80AFB4}.Release|Any CPU.Build.0 = Release|Any CPU - {9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}.Release|Any CPU.Build.0 = Release|Any CPU - {6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}.Release|Any CPU.Build.0 = Release|Any CPU - {1285372C-2E62-494A-A661-8D5D3873318C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1285372C-2E62-494A-A661-8D5D3873318C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1285372C-2E62-494A-A661-8D5D3873318C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1285372C-2E62-494A-A661-8D5D3873318C}.Release|Any CPU.Build.0 = Release|Any CPU - {44651D2D-3252-4FD5-8B8B-5552DBE1B499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44651D2D-3252-4FD5-8B8B-5552DBE1B499}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44651D2D-3252-4FD5-8B8B-5552DBE1B499}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44651D2D-3252-4FD5-8B8B-5552DBE1B499}.Release|Any CPU.Build.0 = Release|Any CPU - {B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}.Release|Any CPU.Build.0 = Release|Any CPU - {0DA95476-B149-450B-AC36-01CEECFC1A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DA95476-B149-450B-AC36-01CEECFC1A43}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DA95476-B149-450B-AC36-01CEECFC1A43}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DA95476-B149-450B-AC36-01CEECFC1A43}.Release|Any CPU.Build.0 = Release|Any CPU - {71902641-776A-47D8-9C0E-9ACBBEAC1370}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {71902641-776A-47D8-9C0E-9ACBBEAC1370}.Debug|Any CPU.Build.0 = Debug|Any CPU - {71902641-776A-47D8-9C0E-9ACBBEAC1370}.Release|Any CPU.ActiveCfg = Release|Any CPU - {71902641-776A-47D8-9C0E-9ACBBEAC1370}.Release|Any CPU.Build.0 = Release|Any CPU - {C14BB883-86B8-401C-B3D6-B655F55F3298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C14BB883-86B8-401C-B3D6-B655F55F3298}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C14BB883-86B8-401C-B3D6-B655F55F3298}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C14BB883-86B8-401C-B3D6-B655F55F3298}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9F590B86-C80C-4658-83BC-855A87751CEF} - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - Policies = $0 - $0.DotNetNamingPolicy = $1 - $1.DirectoryNamespaceAssociation = None - $1.ResourceNamePolicy = FileFormatDefault - $0.TextStylePolicy = $2 - $2.FileWidth = 120 - $2.TabsToSpaces = False - $2.inheritsSet = VisualStudio - $2.inheritsScope = text/plain - StartupItem = IEC61850forCSharp\IEC61850forCSharp.csproj - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.779 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IEC61850.NET", "IEC61850forCSharp\IEC61850.NET.csproj", "{C35D624E-5506-4560-8074-1728F1FA1A4D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example1", "example1\example1.csproj", "{C616A6DF-831E-443C-9310-3F343A6E3D1A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "model_browsing", "model_browsing\model_browsing.csproj", "{59B85486-F48D-4978-BD35-8F5C3A8288D4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "datasets", "datasets\datasets.csproj", "{D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "control", "control\control.csproj", "{C351CFA4-E54E-49A1-86CE-69643535541A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "reporting", "reporting\reporting.csproj", "{9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example2", "example2\example2.csproj", "{2A226B6D-1D1F-4BFE-B8CC-158116F71270}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "authenticate", "authenticate\authenticate.csproj", "{0BECEC77-2315-4B95-AFF9-E6007E644BBF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{FBDFE530-DBEB-474B-BA54-9AB287DD57B3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "files", "files\files.csproj", "{77127456-19B9-4D1A-AEF9-40F8D1C5695E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example3", "example3\example3.csproj", "{5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "report_new_dataset", "report_new_dataset\report_new_dataset.csproj", "{71485F99-2976-45E6-B73D-4946E594C15C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "log_client", "log_client\log_client.csproj", "{14C71267-2F38-460D-AA55-6803EE80AFB4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{0D2F61F1-A173-44E7-BFB0-B698A1D44D12}" + ProjectSection(SolutionItems) = preProject + .nuget\packages.config = .nuget\packages.config + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "server1", "server1\server1.csproj", "{9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tls_client_example", "tls_client_example\tls_client_example.csproj", "{6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "goose_subscriber", "goose_subscriber\goose_subscriber.csproj", "{1285372C-2E62-494A-A661-8D5D3873318C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sv_subscriber", "sv_subscriber\sv_subscriber.csproj", "{44651D2D-3252-4FD5-8B8B-5552DBE1B499}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tls_server_example", "tls_server_example\tls_server_example.csproj", "{B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client_example_setting_groups", "client_example_setting_groups\client_example_setting_groups.csproj", "{0DA95476-B149-450B-AC36-01CEECFC1A43}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "client_example_async", "client_example_async\client_example_async.csproj", "{71902641-776A-47D8-9C0E-9ACBBEAC1370}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "server_goose_publisher", "server_goose_publisher\server_goose_publisher.csproj", "{C14BB883-86B8-401C-B3D6-B655F55F3298}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C35D624E-5506-4560-8074-1728F1FA1A4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C35D624E-5506-4560-8074-1728F1FA1A4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C35D624E-5506-4560-8074-1728F1FA1A4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C35D624E-5506-4560-8074-1728F1FA1A4D}.Release|Any CPU.Build.0 = Release|Any CPU + {C616A6DF-831E-443C-9310-3F343A6E3D1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C616A6DF-831E-443C-9310-3F343A6E3D1A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C616A6DF-831E-443C-9310-3F343A6E3D1A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C616A6DF-831E-443C-9310-3F343A6E3D1A}.Release|Any CPU.Build.0 = Release|Any CPU + {59B85486-F48D-4978-BD35-8F5C3A8288D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59B85486-F48D-4978-BD35-8F5C3A8288D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59B85486-F48D-4978-BD35-8F5C3A8288D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59B85486-F48D-4978-BD35-8F5C3A8288D4}.Release|Any CPU.Build.0 = Release|Any CPU + {D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5C7DD38-032A-49B6-B74F-FFD9724A8AE4}.Release|Any CPU.Build.0 = Release|Any CPU + {C351CFA4-E54E-49A1-86CE-69643535541A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C351CFA4-E54E-49A1-86CE-69643535541A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C351CFA4-E54E-49A1-86CE-69643535541A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C351CFA4-E54E-49A1-86CE-69643535541A}.Release|Any CPU.Build.0 = Release|Any CPU + {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8}.Release|Any CPU.Build.0 = Release|Any CPU + {2A226B6D-1D1F-4BFE-B8CC-158116F71270}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A226B6D-1D1F-4BFE-B8CC-158116F71270}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A226B6D-1D1F-4BFE-B8CC-158116F71270}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A226B6D-1D1F-4BFE-B8CC-158116F71270}.Release|Any CPU.Build.0 = Release|Any CPU + {0BECEC77-2315-4B95-AFF9-E6007E644BBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0BECEC77-2315-4B95-AFF9-E6007E644BBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0BECEC77-2315-4B95-AFF9-E6007E644BBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0BECEC77-2315-4B95-AFF9-E6007E644BBF}.Release|Any CPU.Build.0 = Release|Any CPU + {FBDFE530-DBEB-474B-BA54-9AB287DD57B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBDFE530-DBEB-474B-BA54-9AB287DD57B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBDFE530-DBEB-474B-BA54-9AB287DD57B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBDFE530-DBEB-474B-BA54-9AB287DD57B3}.Release|Any CPU.Build.0 = Release|Any CPU + {77127456-19B9-4D1A-AEF9-40F8D1C5695E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77127456-19B9-4D1A-AEF9-40F8D1C5695E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77127456-19B9-4D1A-AEF9-40F8D1C5695E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77127456-19B9-4D1A-AEF9-40F8D1C5695E}.Release|Any CPU.Build.0 = Release|Any CPU + {5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E5D0FE0-DF44-48D8-A10E-1FB07D34DEA2}.Release|Any CPU.Build.0 = Release|Any CPU + {71485F99-2976-45E6-B73D-4946E594C15C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71485F99-2976-45E6-B73D-4946E594C15C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71485F99-2976-45E6-B73D-4946E594C15C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71485F99-2976-45E6-B73D-4946E594C15C}.Release|Any CPU.Build.0 = Release|Any CPU + {14C71267-2F38-460D-AA55-6803EE80AFB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14C71267-2F38-460D-AA55-6803EE80AFB4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14C71267-2F38-460D-AA55-6803EE80AFB4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14C71267-2F38-460D-AA55-6803EE80AFB4}.Release|Any CPU.Build.0 = Release|Any CPU + {9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9286D2AB-96ED-4631-AB3C-ED20FF5D6E6C}.Release|Any CPU.Build.0 = Release|Any CPU + {6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6734BF52-2D0D-476B-8EA2-C9C2D1D69B03}.Release|Any CPU.Build.0 = Release|Any CPU + {1285372C-2E62-494A-A661-8D5D3873318C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1285372C-2E62-494A-A661-8D5D3873318C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1285372C-2E62-494A-A661-8D5D3873318C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1285372C-2E62-494A-A661-8D5D3873318C}.Release|Any CPU.Build.0 = Release|Any CPU + {44651D2D-3252-4FD5-8B8B-5552DBE1B499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44651D2D-3252-4FD5-8B8B-5552DBE1B499}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44651D2D-3252-4FD5-8B8B-5552DBE1B499}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44651D2D-3252-4FD5-8B8B-5552DBE1B499}.Release|Any CPU.Build.0 = Release|Any CPU + {B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B63F7A81-1D3A-4F2F-A7C2-D6F77E5BD307}.Release|Any CPU.Build.0 = Release|Any CPU + {0DA95476-B149-450B-AC36-01CEECFC1A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0DA95476-B149-450B-AC36-01CEECFC1A43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0DA95476-B149-450B-AC36-01CEECFC1A43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0DA95476-B149-450B-AC36-01CEECFC1A43}.Release|Any CPU.Build.0 = Release|Any CPU + {71902641-776A-47D8-9C0E-9ACBBEAC1370}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71902641-776A-47D8-9C0E-9ACBBEAC1370}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71902641-776A-47D8-9C0E-9ACBBEAC1370}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71902641-776A-47D8-9C0E-9ACBBEAC1370}.Release|Any CPU.Build.0 = Release|Any CPU + {C14BB883-86B8-401C-B3D6-B655F55F3298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C14BB883-86B8-401C-B3D6-B655F55F3298}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C14BB883-86B8-401C-B3D6-B655F55F3298}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C14BB883-86B8-401C-B3D6-B655F55F3298}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9F590B86-C80C-4658-83BC-855A87751CEF} + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + Policies = $0 + $0.DotNetNamingPolicy = $1 + $1.DirectoryNamespaceAssociation = None + $1.ResourceNamePolicy = FileFormatDefault + $0.TextStylePolicy = $2 + $2.FileWidth = 120 + $2.TabsToSpaces = False + $2.inheritsSet = VisualStudio + $2.inheritsScope = text/plain + StartupItem = IEC61850forCSharp\IEC61850forCSharp.csproj + EndGlobalSection +EndGlobal diff --git a/dotnet/example1/Main.cs b/dotnet/example1/Main.cs index b02b312f4..362f1d410 100644 --- a/dotnet/example1/Main.cs +++ b/dotnet/example1/Main.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; - -using IEC61850.Client; -using IEC61850.Common; + +using IEC61850.Client; +using IEC61850.Common; namespace example1 { @@ -17,24 +17,24 @@ public static void Main (string[] args) if (args.Length > 0) hostname = args[0]; else - hostname = "127.0.0.1"; - - int port = 102; - - if (args.Length > 1) + hostname = "127.0.0.1"; + + int port = 102; + + if (args.Length > 1) port = Int32.Parse(args [1]); Console.WriteLine("Connect to " + hostname); try { - con.Connect(hostname, port); - - List serverDirectory = con.GetServerDirectory(false); - - foreach (string entry in serverDirectory) - { - Console.WriteLine("LD: " + entry); + con.Connect(hostname, port); + + List serverDirectory = con.GetServerDirectory(false); + + foreach (string entry in serverDirectory) + { + Console.WriteLine("LD: " + entry); } @@ -46,38 +46,38 @@ public static void Main (string[] args) } string vendor = con.ReadStringValue ("simpleIOGenericIO/LLN0.NamPlt.vendor", FunctionalConstraint.DC); - Console.WriteLine ("Vendor: " + vendor); - - /* read FCDO */ - MmsValue value = con.ReadValue("simpleIOGenericIO/GGIO1.AnIn1", FunctionalConstraint.MX); - - if (value.GetType() == MmsType.MMS_STRUCTURE) - { - Console.WriteLine("Value is of complex type"); - - for (int i = 0; i < value.Size(); i++) - { - Console.WriteLine(" element: " + value.GetElement(i).GetType()); - if (value.GetElement(i).GetType() == MmsType.MMS_UTC_TIME) - { - Console.WriteLine(" -> " + value.GetElement(i).GetUtcTimeAsDateTimeOffset()); - } - } - } - - DataSet dataSet = con.ReadDataSetValues("simpleIOGenericIO/LLN0.Events", null); - - Console.WriteLine("Read data set " + dataSet.GetReference()); - - /* read multiple variables (WARNING: this is not IEC 61850 standard compliant but might - * be supported by most servers). - */ - MmsConnection mmsConnection = con.GetMmsConnection(); - - MmsValue result = mmsConnection.ReadMultipleVariables("simpleIOGenericIO", new List() { - "GGIO1$ST$Ind1", "GGIO1$ST$Ind1", "GGIO1$ST$Ind1","GGIO1$ST$Ind1" - }); - + Console.WriteLine ("Vendor: " + vendor); + + /* read FCDO */ + MmsValue value = con.ReadValue("simpleIOGenericIO/GGIO1.AnIn1", FunctionalConstraint.MX); + + if (value.GetType() == MmsType.MMS_STRUCTURE) + { + Console.WriteLine("Value is of complex type"); + + for (int i = 0; i < value.Size(); i++) + { + Console.WriteLine(" element: " + value.GetElement(i).GetType()); + if (value.GetElement(i).GetType() == MmsType.MMS_UTC_TIME) + { + Console.WriteLine(" -> " + value.GetElement(i).GetUtcTimeAsDateTimeOffset()); + } + } + } + + DataSet dataSet = con.ReadDataSetValues("simpleIOGenericIO/LLN0.Events", null); + + Console.WriteLine("Read data set " + dataSet.GetReference()); + + /* read multiple variables (WARNING: this is not IEC 61850 standard compliant but might + * be supported by most servers). + */ + MmsConnection mmsConnection = con.GetMmsConnection(); + + MmsValue result = mmsConnection.ReadMultipleVariables("simpleIOGenericIO", new List() { + "GGIO1$ST$Ind1", "GGIO1$ST$Ind1", "GGIO1$ST$Ind1","GGIO1$ST$Ind1" + }); + Console.WriteLine(result.ToString()); con.Abort(); @@ -85,11 +85,11 @@ public static void Main (string[] args) catch (IedConnectionException e) { Console.WriteLine(e.Message); - } - - System.Threading.Thread.Sleep(2000); - - // release all resources - do NOT use the object after this call!! + } + + System.Threading.Thread.Sleep(2000); + + // release all resources - do NOT use the object after this call!! con.Dispose (); } } diff --git a/dotnet/example1/example1.csproj b/dotnet/example1/example1.csproj index 592905b55..362d8cbf3 100644 --- a/dotnet/example1/example1.csproj +++ b/dotnet/example1/example1.csproj @@ -1,43 +1,43 @@ - - - - Debug - AnyCPU - {C616A6DF-831E-443C-9310-3F343A6E3D1A} - Exe - example1 - example1 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - - - none - true - bin\Release - prompt - 4 - true - - - - - - - - - - - - {C35D624E-5506-4560-8074-1728F1FA1A4D} - IEC61850.NET - - + + + + Debug + AnyCPU + {C616A6DF-831E-443C-9310-3F343A6E3D1A} + Exe + example1 + example1 + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + true + + + none + true + bin\Release + prompt + 4 + true + + + + + + + + + + + + {C35D624E-5506-4560-8074-1728F1FA1A4D} + IEC61850.NET + + \ No newline at end of file diff --git a/dotnet/report_new_dataset/Main.cs b/dotnet/report_new_dataset/Main.cs index 916445253..ceb305879 100644 --- a/dotnet/report_new_dataset/Main.cs +++ b/dotnet/report_new_dataset/Main.cs @@ -33,11 +33,11 @@ public static void Main (string[] args) { IedConnection con = new IedConnection (); - string hostname; - - if (args.Length > 0) - hostname = args[0]; - else + string hostname; + + if (args.Length > 0) + hostname = args[0]; + else hostname = "localhost"; Console.WriteLine("Connect to " + hostname); diff --git a/dotnet/reporting/Settings.cs b/dotnet/reporting/Settings.cs index 99fcfeb56..61bc191e1 100644 --- a/dotnet/reporting/Settings.cs +++ b/dotnet/reporting/Settings.cs @@ -1,28 +1,28 @@ -namespace reporting.Properties { - - - // This class allows you to handle specific events on the settings class: - // The SettingChanging event is raised before a setting's value is changed. - // The PropertyChanged event is raised after a setting's value is changed. - // The SettingsLoaded event is raised after the setting values are loaded. - // The SettingsSaving event is raised before the setting values are saved. - internal sealed partial class Settings { - - public Settings() { - // // To add event handlers for saving and changing settings, uncomment the lines below: - // - // this.SettingChanging += this.SettingChangingEventHandler; - // - // this.SettingsSaving += this.SettingsSavingEventHandler; - // - } - - private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { - // Add code to handle the SettingChangingEvent event here. - } - - private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { - // Add code to handle the SettingsSaving event here. - } - } -} +namespace reporting.Properties { + + + // This class allows you to handle specific events on the settings class: + // The SettingChanging event is raised before a setting's value is changed. + // The PropertyChanged event is raised after a setting's value is changed. + // The SettingsLoaded event is raised after the setting values are loaded. + // The SettingsSaving event is raised before the setting values are saved. + internal sealed partial class Settings { + + public Settings() { + // // To add event handlers for saving and changing settings, uncomment the lines below: + // + // this.SettingChanging += this.SettingChangingEventHandler; + // + // this.SettingsSaving += this.SettingsSavingEventHandler; + // + } + + private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) { + // Add code to handle the SettingChangingEvent event here. + } + + private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) { + // Add code to handle the SettingsSaving event here. + } + } +} diff --git a/dotnet/reporting/reporting.csproj b/dotnet/reporting/reporting.csproj index 53a5829e1..dafd4bfab 100644 --- a/dotnet/reporting/reporting.csproj +++ b/dotnet/reporting/reporting.csproj @@ -1,81 +1,81 @@ - - - - Debug - AnyCPU - {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8} - Exe - reporting - reporting - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - true - - - none - true - bin\Release - prompt - 4 - true - - - - - - - - - - - - {C35D624E-5506-4560-8074-1728F1FA1A4D} - IEC61850.NET - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 4.5 - true - - - + + + + Debug + AnyCPU + {9E29B4CE-EE5F-4CA6-85F6-5D1FF8B27BF8} + Exe + reporting + reporting + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + true + true + + + none + true + bin\Release + prompt + 4 + true + + + + + + + + + + + + {C35D624E-5506-4560-8074-1728F1FA1A4D} + IEC61850.NET + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 4.5 + true + + + diff --git a/dotnet/server1/Program.cs b/dotnet/server1/Program.cs index 9a5cc89be..750a869f0 100644 --- a/dotnet/server1/Program.cs +++ b/dotnet/server1/Program.cs @@ -46,12 +46,12 @@ public static void Main(string[] args) }, null); iedServer.SetControlHandler(spcso1, delegate (ControlAction action, object parameter, MmsValue ctlVal, bool test) - { - bool val = ctlVal.GetBoolean(); - - if (val) + { + bool val = ctlVal.GetBoolean(); + + if (val) Console.WriteLine("execute binary control command: on"); - else + else Console.WriteLine("execute binary control command: off"); return ControlHandlerResult.OK; @@ -71,13 +71,13 @@ public static void Main(string[] args) { Console.WriteLine("RCB: " + rcb.Parent.GetObjectReference() + "." + rcb.Name + " event: " + eventType.ToString()); - if (con != null) - { - Console.WriteLine(" caused by client " + con.GetPeerAddress()); + if (con != null) + { + Console.WriteLine(" caused by client " + con.GetPeerAddress()); } - else - { - Console.WriteLine(" client = null"); + else + { + Console.WriteLine(" client = null"); } if (eventType == RCBEventType.ENABLED) diff --git a/dotnet/tests/Test.cs b/dotnet/tests/Test.cs index de3fad632..e61f513dd 100644 --- a/dotnet/tests/Test.cs +++ b/dotnet/tests/Test.cs @@ -470,7 +470,7 @@ public void WriteAccessPolicy() { IedModel iedModel = ConfigFileParser.CreateModelFromConfigFile ("../../model.cfg"); - IEC61850.Server.DataAttribute opDlTmms = (IEC61850.Server.DataAttribute) iedModel.GetModelNodeByShortObjectReference("GenericIO/PDUP1.OpDlTmms.setVal"); + IEC61850.Server.DataAttribute opDlTmms = (IEC61850.Server.DataAttribute) iedModel.GetModelNodeByShortObjectReference("GenericIO/PDUP1.OpDlTmms.setVal"); IEC61850.Server.DataAttribute rsDlTmms = (IEC61850.Server.DataAttribute)iedModel.GetModelNodeByShortObjectReference("GenericIO/PDUP1.RsDlTmms.setVal"); IedServer iedServer = new IedServer (iedModel); diff --git a/dotnet/tests/simpleIO_control_tests.scd b/dotnet/tests/simpleIO_control_tests.scd index 57a242d50..4f9188359 100644 --- a/dotnet/tests/simpleIO_control_tests.scd +++ b/dotnet/tests/simpleIO_control_tests.scd @@ -1,430 +1,430 @@ - - -
-
- - - Station bus - 10 - -
-

10.0.0.2

-

255.255.255.0

-

10.0.0.1

-

0001

-

00000001

-

0001

-
- -
-

1

-

4

-

01-0c-cd-01-00-01

-

1000

-
- 1000 - 3000 -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - direct-with-normal-security - - - - - sbo-with-normal-security - - - - - direct-with-enhanced-security - - - - - sbo-with-enhanced-security - - - - - direct-with-normal-security - - - - - sbo-with-normal-security - - - - - direct-with-enhanced-security - - - - - sbo-with-enhanced-security - - - - - - - 16 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - operate-once - operate-many - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + Station bus + 10 + +
+

10.0.0.2

+

255.255.255.0

+

10.0.0.1

+

0001

+

00000001

+

0001

+
+ +
+

1

+

4

+

01-0c-cd-01-00-01

+

1000

+
+ 1000 + 3000 +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + direct-with-normal-security + + + + + sbo-with-normal-security + + + + + direct-with-enhanced-security + + + + + sbo-with-enhanced-security + + + + + direct-with-normal-security + + + + + sbo-with-normal-security + + + + + direct-with-enhanced-security + + + + + sbo-with-enhanced-security + + + + + + + 16 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + operate-once + operate-many + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +
diff --git a/dotnet/tests/test.icd b/dotnet/tests/test.icd index f7a8e3250..db9e2c45f 100644 --- a/dotnet/tests/test.icd +++ b/dotnet/tests/test.icd @@ -1,326 +1,326 @@ - - -
-
- - - Station bus - - -
-

111

-

4

-

01-0c-cd-01-00-01

-

1000

-
-
- -
-

111

-

4

-

01-0c-cd-01-00-01

-

1000

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - blocked - test - test/blocked - off - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - - - unknown - forward - backward - both - - - - -
+ + +
+
+ + + Station bus + + +
+

111

+

4

+

01-0c-cd-01-00-01

+

1000

+
+
+ +
+

111

+

4

+

01-0c-cd-01-00-01

+

1000

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + blocked + test + test/blocked + off + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + + unknown + forward + backward + both + + + + +
diff --git a/dotnet/tests/tests.csproj b/dotnet/tests/tests.csproj index ecaf4e89b..ea76353c4 100644 --- a/dotnet/tests/tests.csproj +++ b/dotnet/tests/tests.csproj @@ -1,47 +1,47 @@ - - - - Debug - AnyCPU - {FBDFE530-DBEB-474B-BA54-9AB287DD57B3} - Library - tests - tests - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - - - none - true - bin\Release - prompt - 4 - false - - - - - - - - {C35D624E-5506-4560-8074-1728F1FA1A4D} - IEC61850.NET - - - - - - - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - + + + + Debug + AnyCPU + {FBDFE530-DBEB-474B-BA54-9AB287DD57B3} + Library + tests + tests + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + none + true + bin\Release + prompt + 4 + false + + + + + + + + {C35D624E-5506-4560-8074-1728F1FA1A4D} + IEC61850.NET + + + + + + + + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + \ No newline at end of file diff --git a/examples/server_example_basic_io/simpleIO_direct_control.cid b/examples/server_example_basic_io/simpleIO_direct_control.cid index a0228a201..7cc13c716 100644 --- a/examples/server_example_basic_io/simpleIO_direct_control.cid +++ b/examples/server_example_basic_io/simpleIO_direct_control.cid @@ -1,359 +1,359 @@ - - -
-
- - - -
-

0.0.0.0

-

255.255.255.0

-

192.168.2.1

-

1,3,9999,33

-

33

-

00000001

-

0001

-

0001

-

102

-
-
- -
-

192.168.2.9

-

255.255.255.0

-

192.168.2.1

-

1,3,9999,33

-

33

-

00000001

-

0001

-

0001

-

102

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - - - status-only - - - - - on - - - - - ok - - - - - - MZ Automation - - - 1.3.0 - - - libiec61850 server example - - - - - - - ok - - - - - - - on - - - status-only - - - - - on - - - - - ok - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - blocked - test - test/blocked - off - - - - ok - warning - alarm - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - - -
+ + +
+
+ + + +
+

0.0.0.0

+

255.255.255.0

+

192.168.2.1

+

1,3,9999,33

+

33

+

00000001

+

0001

+

0001

+

102

+
+
+ +
+

192.168.2.9

+

255.255.255.0

+

192.168.2.1

+

1,3,9999,33

+

33

+

00000001

+

0001

+

0001

+

102

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + + + status-only + + + + + on + + + + + ok + + + + + + MZ Automation + + + 1.3.0 + + + libiec61850 server example + + + + + + + ok + + + + + + + on + + + status-only + + + + + on + + + + + ok + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + blocked + test + test/blocked + off + + + + ok + warning + alarm + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + +
diff --git a/examples/server_example_basic_io/simpleIO_direct_control.icd b/examples/server_example_basic_io/simpleIO_direct_control.icd index 258e9ae61..b0ac1475d 100644 --- a/examples/server_example_basic_io/simpleIO_direct_control.icd +++ b/examples/server_example_basic_io/simpleIO_direct_control.icd @@ -1,307 +1,307 @@ - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - - - status-only - - - - - on - - - - - ok - - - - - - MZ Automation - - - 1.3.0 - - - libiec61850 server example - - - - - - - ok - - - - - - - on - - - status-only - - - - - on - - - - - ok - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - blocked - test - test/blocked - off - - - - ok - warning - alarm - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - - -
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + + + status-only + + + + + on + + + + + ok + + + + + + MZ Automation + + + 1.3.0 + + + libiec61850 server example + + + + + + + ok + + + + + + + on + + + status-only + + + + + on + + + + + ok + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + blocked + test + test/blocked + off + + + + ok + warning + alarm + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + +
diff --git a/examples/server_example_complex_array/mhai_array.cid b/examples/server_example_complex_array/mhai_array.cid index 067622057..1d347328d 100644 --- a/examples/server_example_complex_array/mhai_array.cid +++ b/examples/server_example_complex_array/mhai_array.cid @@ -1,313 +1,313 @@ - - - -
-
- - - - -
-

0.0.0.0

-

255.255.255.0

-

192.168.2.1

-

1,3,9999,33

-

33

-

00000001

-

0001

-

0001

-

102

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - ok - - - - - - - - on - - - status-only - - - - - on - - - - - ok - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - 16 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - blocked - test - test/blocked - off - - - - ok - warning - alarm - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - - - -
+ + + +
+
+ + + + +
+

0.0.0.0

+

255.255.255.0

+

192.168.2.1

+

1,3,9999,33

+

33

+

00000001

+

0001

+

0001

+

102

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + ok + + + + + + + + on + + + status-only + + + + + on + + + + + ok + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + 16 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + blocked + test + test/blocked + off + + + + ok + warning + alarm + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + + +
diff --git a/examples/server_example_config_file/simpleIO_direct_control_goose.cid b/examples/server_example_config_file/simpleIO_direct_control_goose.cid index 59bcef574..7c05aab14 100644 --- a/examples/server_example_config_file/simpleIO_direct_control_goose.cid +++ b/examples/server_example_config_file/simpleIO_direct_control_goose.cid @@ -1,258 +1,258 @@ - - -
-
- - - - -
-

111

-

4

-

01-0c-cd-01-00-01

-

1000

-
-
- -
-

111

-

4

-

01-0c-cd-01-00-01

-

1000

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + + +
+

111

+

4

+

01-0c-cd-01-00-01

+

1000

+
+
+ +
+

111

+

4

+

01-0c-cd-01-00-01

+

1000

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +
diff --git a/examples/server_example_control/simpleIO_control_tests.cid b/examples/server_example_control/simpleIO_control_tests.cid index d10440523..53fab5837 100644 --- a/examples/server_example_control/simpleIO_control_tests.cid +++ b/examples/server_example_control/simpleIO_control_tests.cid @@ -1,332 +1,332 @@ - - -
-
- - - -
-

0.0.0.0

-

255.255.255.0

-

10.0.0.1

-

0001

-

00000001

-

0001

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - direct-with-normal-security - - - - - sbo-with-normal-security - - - 2000 - - - - - direct-with-enhanced-security - - - - - sbo-with-enhanced-security - - - - - direct-with-normal-security - - - - - sbo-with-normal-security - - - - - direct-with-enhanced-security - - - - - sbo-with-enhanced-security - - - - - direct-with-enhanced-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - operate-once - operate-many - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + +
+

0.0.0.0

+

255.255.255.0

+

10.0.0.1

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + direct-with-normal-security + + + + + sbo-with-normal-security + + + 2000 + + + + + direct-with-enhanced-security + + + + + sbo-with-enhanced-security + + + + + direct-with-normal-security + + + + + sbo-with-normal-security + + + + + direct-with-enhanced-security + + + + + sbo-with-enhanced-security + + + + + direct-with-enhanced-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + operate-once + operate-many + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +
diff --git a/examples/server_example_deadband/cid_example_deadband.cid b/examples/server_example_deadband/cid_example_deadband.cid index e023dc0dc..8f06eeb49 100644 --- a/examples/server_example_deadband/cid_example_deadband.cid +++ b/examples/server_example_deadband/cid_example_deadband.cid @@ -1,442 +1,442 @@ - - -
- - - -
- - - -
-

1,1,1,999,1

-

12

-

00000001

-

0001

-

0001

-

0.0.0.0

-

255.255.255.0

-

0.0.0.0

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - - - - - - - - on - - - - - 10000 - - - 10 - - - 1000 - - - 10 - - - - - 1000 - - - 10 - - - 1000 - - - 10 - - - - - 10000 - - - 1000 - - - - - -5 - - - - - 5 - - - - - - - 1000 - - - 1000 - - - - - -100 - - - - - 100 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - e1 - e2 - e3 - e4 - e5 - - - ExternalAreaClock - LocalAreaClock - GlobalAreaClock - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - operate-once - operate-many - - - none - m - kg - s - A - K - mol - cd - deg - rad - sr - Gy - q - °C - Sv - F - C - S - H - V - ohm - J - N - Hz - lx - Lm - Wb - T - W - Pa - m² - m³ - m/s - m/s² - m³/s - m/m³ - M - kg/m³ - m²/s - W/m K - J/K - ppm - 1/s - rad/s - VA - Watts - VAr - theta - cos(theta) - Vs - V² - As - A² - A²t - VAh - Wh - VArh - V/Hz - - - Yocto - Zepto - Atto - Femto - Pico - Nano - Micro - Milli - Centi - Deci - zeroNoValue - Deca - Hecto - Kilo - Mega - Giga - Tera - Petra - Exa - Zetta - Yotta - - - normal - high - low - high-high - low-low - - - pulse - persistent - - - Ok - Warning - Alarm - - - on - blocked - test - test/blocked - off - - - on - blocked - test - test/blocked - off - - + + +
+ + + +
+ + + +
+

1,1,1,999,1

+

12

+

00000001

+

0001

+

0001

+

0.0.0.0

+

255.255.255.0

+

0.0.0.0

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + + + + + + + + on + + + + + 10000 + + + 10 + + + 1000 + + + 10 + + + + + 1000 + + + 10 + + + 1000 + + + 10 + + + + + 10000 + + + 1000 + + + + + -5 + + + + + 5 + + + + + + + 1000 + + + 1000 + + + + + -100 + + + + + 100 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + e1 + e2 + e3 + e4 + e5 + + + ExternalAreaClock + LocalAreaClock + GlobalAreaClock + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + operate-once + operate-many + + + none + m + kg + s + A + K + mol + cd + deg + rad + sr + Gy + q + °C + Sv + F + C + S + H + V + ohm + J + N + Hz + lx + Lm + Wb + T + W + Pa + m² + m³ + m/s + m/s² + m³/s + m/m³ + M + kg/m³ + m²/s + W/m K + J/K + ppm + 1/s + rad/s + VA + Watts + VAr + theta + cos(theta) + Vs + V² + As + A² + A²t + VAh + Wh + VArh + V/Hz + + + Yocto + Zepto + Atto + Femto + Pico + Nano + Micro + Milli + Centi + Deci + zeroNoValue + Deca + Hecto + Kilo + Mega + Giga + Tera + Petra + Exa + Zetta + Yotta + + + normal + high + low + high-high + low-low + + + pulse + persistent + + + Ok + Warning + Alarm + + + on + blocked + test + test/blocked + off + + + on + blocked + test + test/blocked + off + +
\ No newline at end of file diff --git a/examples/server_example_files/simpleIO_direct_control.cid b/examples/server_example_files/simpleIO_direct_control.cid index 68e961239..7ab586fe8 100644 --- a/examples/server_example_files/simpleIO_direct_control.cid +++ b/examples/server_example_files/simpleIO_direct_control.cid @@ -1,279 +1,279 @@ - - -
-
- - - -
-

10.0.0.2

-

255.255.255.0

-

10.0.0.1

-

0001

-

00000001

-

0001

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - MZ Automation - - - 0.7.3 - - - libiec61850 server example - - - - - - - - status-only - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + +
+

10.0.0.2

+

255.255.255.0

+

10.0.0.1

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + MZ Automation + + + 0.7.3 + + + libiec61850 server example + + + + + + + + status-only + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +
diff --git a/examples/server_example_goose/simpleIO_direct_control_goose.cid b/examples/server_example_goose/simpleIO_direct_control_goose.cid index 1701b9fec..e25303f75 100644 --- a/examples/server_example_goose/simpleIO_direct_control_goose.cid +++ b/examples/server_example_goose/simpleIO_direct_control_goose.cid @@ -1,275 +1,275 @@ - - -
-
- - - -
-

10.0.0.2

-

255.255.255.0

-

10.0.0.1

-

0001

-

00000001

-

0001

-
- -
-

1

-

4

-

01-0c-cd-01-00-01

-

1000

-
- 1000 - 3000 -
- -
-

1

-

4

-

01-0c-cd-01-00-01

-

1000

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + +
+

10.0.0.2

+

255.255.255.0

+

10.0.0.1

+

0001

+

00000001

+

0001

+
+ +
+

1

+

4

+

01-0c-cd-01-00-01

+

1000

+
+ 1000 + 3000 +
+ +
+

1

+

4

+

01-0c-cd-01-00-01

+

1000

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +
diff --git a/examples/server_example_logging/simpleIO_direct_control.cid b/examples/server_example_logging/simpleIO_direct_control.cid index ba4db76e9..08f26061b 100644 --- a/examples/server_example_logging/simpleIO_direct_control.cid +++ b/examples/server_example_logging/simpleIO_direct_control.cid @@ -1,304 +1,304 @@ - - -
-
- - - -
-

10.0.0.2

-

255.255.255.0

-

10.0.0.1

-

0001

-

00000001

-

0001

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - MZ Automation - - - 0.7.3 - - - libiec61850 server example - - - - - - - - status-only - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + +
+

10.0.0.2

+

255.255.255.0

+

10.0.0.1

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + MZ Automation + + + 0.7.3 + + + libiec61850 server example + + + + + + + + status-only + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +
diff --git a/examples/server_example_password_auth/simpleIO_direct_control.cid b/examples/server_example_password_auth/simpleIO_direct_control.cid index fe3714823..458d97594 100644 --- a/examples/server_example_password_auth/simpleIO_direct_control.cid +++ b/examples/server_example_password_auth/simpleIO_direct_control.cid @@ -1,224 +1,224 @@ - - -
-
- - - -
-

10.0.0.2

-

255.255.255.0

-

10.0.0.1

-

0001

-

00000001

-

0001

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + +
+

10.0.0.2

+

255.255.255.0

+

10.0.0.1

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +
diff --git a/examples/server_example_service_tracking/CMakeLists.txt b/examples/server_example_service_tracking/CMakeLists.txt index a11e7d8d5..67c8cc5e4 100644 --- a/examples/server_example_service_tracking/CMakeLists.txt +++ b/examples/server_example_service_tracking/CMakeLists.txt @@ -1,21 +1,21 @@ -include_directories( - . -) - -set(server_example_SRCS - server_example_service_tracking.c - static_model.c -) - -IF(MSVC) -set_source_files_properties(${server_example_SRCS} - PROPERTIES LANGUAGE CXX) -ENDIF(MSVC) - -add_executable(server_example_service_tracking - ${server_example_SRCS} -) - -target_link_libraries(server_example_service_tracking - iec61850 -) +include_directories( + . +) + +set(server_example_SRCS + server_example_service_tracking.c + static_model.c +) + +IF(MSVC) +set_source_files_properties(${server_example_SRCS} + PROPERTIES LANGUAGE CXX) +ENDIF(MSVC) + +add_executable(server_example_service_tracking + ${server_example_SRCS} +) + +target_link_libraries(server_example_service_tracking + iec61850 +) diff --git a/examples/server_example_service_tracking/server_example_service_tracking.c b/examples/server_example_service_tracking/server_example_service_tracking.c index 3d34df198..b2f13f0c5 100644 --- a/examples/server_example_service_tracking/server_example_service_tracking.c +++ b/examples/server_example_service_tracking/server_example_service_tracking.c @@ -1,286 +1,286 @@ -/* - * server_example_service_tracking.c - * - * - How enable and use service tracking - */ - -#include "iec61850_server.h" -#include "hal_thread.h" -#include -#include -#include -#include - -#include "static_model.h" - -static int running = 0; -static IedServer iedServer = NULL; - -void -sigint_handler(int signalId) -{ - running = 0; -} - -typedef struct { - float strVal; - int opDlTmms; - int rsDlTmms; - int rstTms; -} PTOC1Settings; - -static PTOC1Settings ptoc1Settings[] = { - {1.0f, 500, 500, 500}, - {2.0f, 1500, 2500, 750}, - {3.0f, 500, 1500, 750}, - {3.5f, 1250, 1750, 500}, - {3.75f, 1250, 1750, 750} -}; - -static void -loadActiveSgValues (int actSG) -{ - IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_PTOC1_StrVal_setMag_f, ptoc1Settings[actSG - 1].strVal); - IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_PTOC1_OpDlTmms_setVal, ptoc1Settings[actSG - 1].opDlTmms); - IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_PTOC1_RsDlTmms_setVal, ptoc1Settings[actSG - 1].rsDlTmms); - IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_PTOC1_RstTms_setVal, ptoc1Settings[actSG - 1].rstTms); -} - -static void -loadEditSgValues (int editSG) -{ - IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_SE_GenericIO_PTOC1_StrVal_setMag_f, ptoc1Settings[editSG - 1].strVal); - IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_SE_GenericIO_PTOC1_OpDlTmms_setVal, ptoc1Settings[editSG - 1].opDlTmms); - IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_SE_GenericIO_PTOC1_RsDlTmms_setVal, ptoc1Settings[editSG - 1].rsDlTmms); - IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_SE_GenericIO_PTOC1_RstTms_setVal, ptoc1Settings[editSG - 1].rstTms); -} - -static bool -activeSgChangedHandler (void* parameter, SettingGroupControlBlock* sgcb, - uint8_t newActSg, ClientConnection connection) -{ - printf("Switch to setting group %i\n", (int) newActSg); - - loadActiveSgValues(newActSg); - - return true; -} - -static bool -editSgChangedHandler (void* parameter, SettingGroupControlBlock* sgcb, - uint8_t newEditSg, ClientConnection connection) -{ - printf("Set edit setting group to %i\n", (int) newEditSg); - - loadEditSgValues(newEditSg); - - return true; -} - -static void -editSgConfirmedHandler(void* parameter, SettingGroupControlBlock* sgcb, - uint8_t editSg) -{ - printf("Received edit sg confirm for sg %i\n", editSg); - - ptoc1Settings[editSg - 1].strVal = MmsValue_toFloat(IEDMODEL_SE_GenericIO_PTOC1_StrVal_setMag_f->mmsValue); - ptoc1Settings[editSg - 1].opDlTmms = MmsValue_toInt32(IEDMODEL_SE_GenericIO_PTOC1_OpDlTmms_setVal->mmsValue); - ptoc1Settings[editSg - 1].rsDlTmms = MmsValue_toInt32(IEDMODEL_SE_GenericIO_PTOC1_RsDlTmms_setVal->mmsValue); - ptoc1Settings[editSg - 1].rstTms = MmsValue_toInt32(IEDMODEL_SE_GenericIO_PTOC1_RstTms_setVal->mmsValue); - - if (IedServer_getActiveSettingGroup(iedServer, sgcb) == editSg) { - loadActiveSgValues(editSg); - } -} - -static ControlHandlerResult -controlHandlerForBinaryOutput(ControlAction action, void* parameter, MmsValue* value, bool test) -{ - if (test) - return CONTROL_RESULT_FAILED; - - if (MmsValue_getType(value) == MMS_BOOLEAN) { - printf("received binary control command: "); - - if (MmsValue_getBoolean(value)) - printf("on\n"); - else - printf("off\n"); - } - else - return CONTROL_RESULT_FAILED; - - uint64_t timeStamp = Hal_getTimeInMs(); - - if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO1) { - IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_t, timeStamp); - IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_stVal, value); - } - - if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO2) { - IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2_t, timeStamp); - IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2_stVal, value); - } - - if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO3) { - IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3_t, timeStamp); - IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3_stVal, value); - } - - if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO4) { - IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO4_t, timeStamp); - IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO4_stVal, value); - } - - return CONTROL_RESULT_OK; -} - - -static void -connectionHandler (IedServer self, ClientConnection connection, bool connected, void* parameter) -{ - if (connected) - printf("Connection opened\n"); - else - printf("Connection closed\n"); -} - -int -main(int argc, char** argv) -{ - printf("Using libIEC61850 version %s\n", LibIEC61850_getVersionString()); - - /* Create new server configuration object */ - IedServerConfig config = IedServerConfig_create(); - - /* Set buffer size for buffered report control blocks to 200000 bytes */ - IedServerConfig_setReportBufferSize(config, 200000); - - /* Set stack compliance to a specific edition of the standard (WARNING: data model has also to be checked for compliance) */ - IedServerConfig_setEdition(config, IEC_61850_EDITION_2); - - /* Set the base path for the MMS file services */ - IedServerConfig_setFileServiceBasePath(config, "./vmd-filestore/"); - - /* disable MMS file service */ - IedServerConfig_enableFileService(config, false); - - /* TODO enable service tracking feature */ - //IedServerConfig_enableServiceTracking(config, true); - - /* enable dynamic data set service */ - IedServerConfig_enableDynamicDataSetService(config, true); - - /* disable log service */ - IedServerConfig_enableLogService(config, true); - - /* set maximum number of clients */ - IedServerConfig_setMaxMmsConnections(config, 5); - - /* Create a new IEC 61850 server instance */ - iedServer = IedServer_createWithConfig(&iedModel, NULL, config); - - /* configuration object is no longer required */ - IedServerConfig_destroy(config); - - SettingGroupControlBlock* sgcb = LogicalDevice_getSettingGroupControlBlock(IEDMODEL_GenericIO); - - loadActiveSgValues(sgcb->actSG); - - IedServer_setActiveSettingGroupChangedHandler(iedServer, sgcb, activeSgChangedHandler, NULL); - IedServer_setEditSettingGroupChangedHandler(iedServer, sgcb, editSgChangedHandler, NULL); - IedServer_setEditSettingGroupConfirmationHandler(iedServer, sgcb, editSgConfirmedHandler, NULL); - - if (argc > 1) { - char* ethernetIfcID = argv[1]; - - printf("Using GOOSE interface: %s\n", ethernetIfcID); - - /* set GOOSE interface for all GOOSE publishers (GCBs) */ - IedServer_setGooseInterfaceId(iedServer, ethernetIfcID); - } - - /* set the identity values for MMS identify service */ - IedServer_setServerIdentity(iedServer, "MZ", "service_tracking", "1.0.0"); - - /* Install handler for operate command */ - IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1, - (ControlHandler) controlHandlerForBinaryOutput, - IEDMODEL_GenericIO_GGIO1_SPCSO1); - - IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2, - (ControlHandler) controlHandlerForBinaryOutput, - IEDMODEL_GenericIO_GGIO1_SPCSO2); - - IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3, - (ControlHandler) controlHandlerForBinaryOutput, - IEDMODEL_GenericIO_GGIO1_SPCSO3); - - IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO4, - (ControlHandler) controlHandlerForBinaryOutput, - IEDMODEL_GenericIO_GGIO1_SPCSO4); - - IedServer_setConnectionIndicationHandler(iedServer, (IedConnectionIndicationHandler) connectionHandler, NULL); - - /* MMS server will be instructed to start listening for client connections. */ - IedServer_start(iedServer, 102); - - if (!IedServer_isRunning(iedServer)) { - printf("Starting server failed (maybe need root permissions or another server is already using the port)! Exit.\n"); - IedServer_destroy(iedServer); - exit(-1); - } - - running = 1; - - signal(SIGINT, sigint_handler); - - float t = 0.f; - - while (running) { - uint64_t timestamp = Hal_getTimeInMs(); - - t += 0.1f; - - float an1 = sinf(t); - float an2 = sinf(t + 1.f); - float an3 = sinf(t + 2.f); - float an4 = sinf(t + 3.f); - - Timestamp iecTimestamp; - - Timestamp_clearFlags(&iecTimestamp); - Timestamp_setTimeInMilliseconds(&iecTimestamp, timestamp); - Timestamp_setLeapSecondKnown(&iecTimestamp, true); - - /* toggle clock-not-synchronized flag in timestamp */ - if (((int) t % 2) == 0) - Timestamp_setClockNotSynchronized(&iecTimestamp, true); - - IedServer_lockDataModel(iedServer); - - IedServer_updateTimestampAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_t, &iecTimestamp); - IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_mag_f, an1); - - IedServer_updateTimestampAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_t, &iecTimestamp); - IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_mag_f, an2); - - IedServer_updateTimestampAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_t, &iecTimestamp); - IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_mag_f, an3); - - IedServer_updateTimestampAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_t, &iecTimestamp); - IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_mag_f, an4); - - IedServer_unlockDataModel(iedServer); - - Thread_sleep(100); - } - - /* stop MMS server - close TCP server socket and all client sockets */ - IedServer_stop(iedServer); - - /* Cleanup - free all resources */ - IedServer_destroy(iedServer); - - return 0; -} /* main() */ +/* + * server_example_service_tracking.c + * + * - How enable and use service tracking + */ + +#include "iec61850_server.h" +#include "hal_thread.h" +#include +#include +#include +#include + +#include "static_model.h" + +static int running = 0; +static IedServer iedServer = NULL; + +void +sigint_handler(int signalId) +{ + running = 0; +} + +typedef struct { + float strVal; + int opDlTmms; + int rsDlTmms; + int rstTms; +} PTOC1Settings; + +static PTOC1Settings ptoc1Settings[] = { + {1.0f, 500, 500, 500}, + {2.0f, 1500, 2500, 750}, + {3.0f, 500, 1500, 750}, + {3.5f, 1250, 1750, 500}, + {3.75f, 1250, 1750, 750} +}; + +static void +loadActiveSgValues (int actSG) +{ + IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_PTOC1_StrVal_setMag_f, ptoc1Settings[actSG - 1].strVal); + IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_PTOC1_OpDlTmms_setVal, ptoc1Settings[actSG - 1].opDlTmms); + IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_PTOC1_RsDlTmms_setVal, ptoc1Settings[actSG - 1].rsDlTmms); + IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_PTOC1_RstTms_setVal, ptoc1Settings[actSG - 1].rstTms); +} + +static void +loadEditSgValues (int editSG) +{ + IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_SE_GenericIO_PTOC1_StrVal_setMag_f, ptoc1Settings[editSG - 1].strVal); + IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_SE_GenericIO_PTOC1_OpDlTmms_setVal, ptoc1Settings[editSG - 1].opDlTmms); + IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_SE_GenericIO_PTOC1_RsDlTmms_setVal, ptoc1Settings[editSG - 1].rsDlTmms); + IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_SE_GenericIO_PTOC1_RstTms_setVal, ptoc1Settings[editSG - 1].rstTms); +} + +static bool +activeSgChangedHandler (void* parameter, SettingGroupControlBlock* sgcb, + uint8_t newActSg, ClientConnection connection) +{ + printf("Switch to setting group %i\n", (int) newActSg); + + loadActiveSgValues(newActSg); + + return true; +} + +static bool +editSgChangedHandler (void* parameter, SettingGroupControlBlock* sgcb, + uint8_t newEditSg, ClientConnection connection) +{ + printf("Set edit setting group to %i\n", (int) newEditSg); + + loadEditSgValues(newEditSg); + + return true; +} + +static void +editSgConfirmedHandler(void* parameter, SettingGroupControlBlock* sgcb, + uint8_t editSg) +{ + printf("Received edit sg confirm for sg %i\n", editSg); + + ptoc1Settings[editSg - 1].strVal = MmsValue_toFloat(IEDMODEL_SE_GenericIO_PTOC1_StrVal_setMag_f->mmsValue); + ptoc1Settings[editSg - 1].opDlTmms = MmsValue_toInt32(IEDMODEL_SE_GenericIO_PTOC1_OpDlTmms_setVal->mmsValue); + ptoc1Settings[editSg - 1].rsDlTmms = MmsValue_toInt32(IEDMODEL_SE_GenericIO_PTOC1_RsDlTmms_setVal->mmsValue); + ptoc1Settings[editSg - 1].rstTms = MmsValue_toInt32(IEDMODEL_SE_GenericIO_PTOC1_RstTms_setVal->mmsValue); + + if (IedServer_getActiveSettingGroup(iedServer, sgcb) == editSg) { + loadActiveSgValues(editSg); + } +} + +static ControlHandlerResult +controlHandlerForBinaryOutput(ControlAction action, void* parameter, MmsValue* value, bool test) +{ + if (test) + return CONTROL_RESULT_FAILED; + + if (MmsValue_getType(value) == MMS_BOOLEAN) { + printf("received binary control command: "); + + if (MmsValue_getBoolean(value)) + printf("on\n"); + else + printf("off\n"); + } + else + return CONTROL_RESULT_FAILED; + + uint64_t timeStamp = Hal_getTimeInMs(); + + if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO1) { + IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_t, timeStamp); + IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_stVal, value); + } + + if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO2) { + IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2_t, timeStamp); + IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2_stVal, value); + } + + if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO3) { + IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3_t, timeStamp); + IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3_stVal, value); + } + + if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO4) { + IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO4_t, timeStamp); + IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO4_stVal, value); + } + + return CONTROL_RESULT_OK; +} + + +static void +connectionHandler (IedServer self, ClientConnection connection, bool connected, void* parameter) +{ + if (connected) + printf("Connection opened\n"); + else + printf("Connection closed\n"); +} + +int +main(int argc, char** argv) +{ + printf("Using libIEC61850 version %s\n", LibIEC61850_getVersionString()); + + /* Create new server configuration object */ + IedServerConfig config = IedServerConfig_create(); + + /* Set buffer size for buffered report control blocks to 200000 bytes */ + IedServerConfig_setReportBufferSize(config, 200000); + + /* Set stack compliance to a specific edition of the standard (WARNING: data model has also to be checked for compliance) */ + IedServerConfig_setEdition(config, IEC_61850_EDITION_2); + + /* Set the base path for the MMS file services */ + IedServerConfig_setFileServiceBasePath(config, "./vmd-filestore/"); + + /* disable MMS file service */ + IedServerConfig_enableFileService(config, false); + + /* TODO enable service tracking feature */ + //IedServerConfig_enableServiceTracking(config, true); + + /* enable dynamic data set service */ + IedServerConfig_enableDynamicDataSetService(config, true); + + /* disable log service */ + IedServerConfig_enableLogService(config, true); + + /* set maximum number of clients */ + IedServerConfig_setMaxMmsConnections(config, 5); + + /* Create a new IEC 61850 server instance */ + iedServer = IedServer_createWithConfig(&iedModel, NULL, config); + + /* configuration object is no longer required */ + IedServerConfig_destroy(config); + + SettingGroupControlBlock* sgcb = LogicalDevice_getSettingGroupControlBlock(IEDMODEL_GenericIO); + + loadActiveSgValues(sgcb->actSG); + + IedServer_setActiveSettingGroupChangedHandler(iedServer, sgcb, activeSgChangedHandler, NULL); + IedServer_setEditSettingGroupChangedHandler(iedServer, sgcb, editSgChangedHandler, NULL); + IedServer_setEditSettingGroupConfirmationHandler(iedServer, sgcb, editSgConfirmedHandler, NULL); + + if (argc > 1) { + char* ethernetIfcID = argv[1]; + + printf("Using GOOSE interface: %s\n", ethernetIfcID); + + /* set GOOSE interface for all GOOSE publishers (GCBs) */ + IedServer_setGooseInterfaceId(iedServer, ethernetIfcID); + } + + /* set the identity values for MMS identify service */ + IedServer_setServerIdentity(iedServer, "MZ", "service_tracking", "1.0.0"); + + /* Install handler for operate command */ + IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1, + (ControlHandler) controlHandlerForBinaryOutput, + IEDMODEL_GenericIO_GGIO1_SPCSO1); + + IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2, + (ControlHandler) controlHandlerForBinaryOutput, + IEDMODEL_GenericIO_GGIO1_SPCSO2); + + IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3, + (ControlHandler) controlHandlerForBinaryOutput, + IEDMODEL_GenericIO_GGIO1_SPCSO3); + + IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO4, + (ControlHandler) controlHandlerForBinaryOutput, + IEDMODEL_GenericIO_GGIO1_SPCSO4); + + IedServer_setConnectionIndicationHandler(iedServer, (IedConnectionIndicationHandler) connectionHandler, NULL); + + /* MMS server will be instructed to start listening for client connections. */ + IedServer_start(iedServer, 102); + + if (!IedServer_isRunning(iedServer)) { + printf("Starting server failed (maybe need root permissions or another server is already using the port)! Exit.\n"); + IedServer_destroy(iedServer); + exit(-1); + } + + running = 1; + + signal(SIGINT, sigint_handler); + + float t = 0.f; + + while (running) { + uint64_t timestamp = Hal_getTimeInMs(); + + t += 0.1f; + + float an1 = sinf(t); + float an2 = sinf(t + 1.f); + float an3 = sinf(t + 2.f); + float an4 = sinf(t + 3.f); + + Timestamp iecTimestamp; + + Timestamp_clearFlags(&iecTimestamp); + Timestamp_setTimeInMilliseconds(&iecTimestamp, timestamp); + Timestamp_setLeapSecondKnown(&iecTimestamp, true); + + /* toggle clock-not-synchronized flag in timestamp */ + if (((int) t % 2) == 0) + Timestamp_setClockNotSynchronized(&iecTimestamp, true); + + IedServer_lockDataModel(iedServer); + + IedServer_updateTimestampAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_t, &iecTimestamp); + IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_mag_f, an1); + + IedServer_updateTimestampAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_t, &iecTimestamp); + IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_mag_f, an2); + + IedServer_updateTimestampAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_t, &iecTimestamp); + IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_mag_f, an3); + + IedServer_updateTimestampAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_t, &iecTimestamp); + IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_mag_f, an4); + + IedServer_unlockDataModel(iedServer); + + Thread_sleep(100); + } + + /* stop MMS server - close TCP server socket and all client sockets */ + IedServer_stop(iedServer); + + /* Cleanup - free all resources */ + IedServer_destroy(iedServer); + + return 0; +} /* main() */ diff --git a/examples/server_example_service_tracking/simpleIO_ltrk_tests.icd b/examples/server_example_service_tracking/simpleIO_ltrk_tests.icd index 184342480..127c35891 100644 --- a/examples/server_example_service_tracking/simpleIO_ltrk_tests.icd +++ b/examples/server_example_service_tracking/simpleIO_ltrk_tests.icd @@ -1,655 +1,655 @@ - - -
-
- - - Station bus - 10 - -
-

0.0.0.0

-

255.255.255.0

-

192.168.2.1

-

1,3,9999,33

-

33

-

00000001

-

0001

-

0001

-

102

-
- -
-

1

-

4

-

01-0c-cd-01-00-01

-

1000

-
- 1000 - 3000 -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - on - - - status-only - - - - - on - - - - - ok - - - - - MZ Automation - - - 1.3.0 - - - libiec61850 server example - - - - - - - ok - - - - - - - on - - - status-only - - - - - on - - - - - ok - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unknown - Not-supported - Blocked-by-switching-hierarchy - Select-failed - Invalid-position - Position-reached - Parameter-change-in-execution - Step-limit - Blocked-by-Mode - Blocked-by-process - Blocked-by-interlocking - Blocked-by-synchrocheck - Command-already-in-execution - Blocked-by-health - 1-of-n-control - Abortion-by-cancel - Time-limit-over - Abortion-by-trip - Object-not-selected - Object-already-selected - No-access-authority - Ended-with-overshoot - Abortion-due-to-deviation - Abortion-by-communication-loss - Blocked-by-command - None - Inconsistent-parameters - Locked-by-other-client - - - on - blocked - test - test/blocked - off - - - ok - warning - alarm - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - - no-error - instance-not-available - instance-in-use - access-violation - access-not-allowed-in-current-state - parameter-value-inappropriate - parameter-value-inconsistent - class-not-supported - instance-locked-by-other-client - control-must-be-selected - type-conflict - failed-due-to-communications-constraint - failed-due-to-server-constraint - - - Unknown - Associate - Abort - Release - GetServerDirectory - GetLogicalDeviceDirectory - GetAllDataValues - GetDataValues - SetDataValues - GetDataDirectory - GetDataDefinition - GetDataSetValues - SetDataSetValues - CreateDataSet - DeleteDataSet - GetDataSetDirectory - SelectActiveSG - SelectEditSG - SetEditSGValue - ConfirmEditSGValues - GetEditSGValue - GetSGCBValues - Report - GetBRCBValues - SetBRCBValues - GetURCBValues - SetURCBValues - GetLCBValues - SetLCBValues - QueryLogByTime - QueryLogAfter - GetLogStatus - SendGOOSEMessage - GetGoCBValues - SetGoCBValues - GetGoReference - GetGOOSEElementNumber - SendMSVMessage - GetMSVCBValues - SetMSVCBValues - SendUSVMessage - GetUSVCBValues - SetUSVCBValues - Select - SelectWithValue - Cancel - Operate - CommandTermination - TimeActivatedOperate - GetFile - SetFile - DeleteFile - GetFileAttributValues - TimeSynchronisation - InternalChange - - - unknown - forward - backward - both - - -
+ + +
+
+ + + Station bus + 10 + +
+

0.0.0.0

+

255.255.255.0

+

192.168.2.1

+

1,3,9999,33

+

33

+

00000001

+

0001

+

0001

+

102

+
+ +
+

1

+

4

+

01-0c-cd-01-00-01

+

1000

+
+ 1000 + 3000 +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + on + + + status-only + + + + + on + + + + + ok + + + + + MZ Automation + + + 1.3.0 + + + libiec61850 server example + + + + + + + ok + + + + + + + on + + + status-only + + + + + on + + + + + ok + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unknown + Not-supported + Blocked-by-switching-hierarchy + Select-failed + Invalid-position + Position-reached + Parameter-change-in-execution + Step-limit + Blocked-by-Mode + Blocked-by-process + Blocked-by-interlocking + Blocked-by-synchrocheck + Command-already-in-execution + Blocked-by-health + 1-of-n-control + Abortion-by-cancel + Time-limit-over + Abortion-by-trip + Object-not-selected + Object-already-selected + No-access-authority + Ended-with-overshoot + Abortion-due-to-deviation + Abortion-by-communication-loss + Blocked-by-command + None + Inconsistent-parameters + Locked-by-other-client + + + on + blocked + test + test/blocked + off + + + ok + warning + alarm + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + + no-error + instance-not-available + instance-in-use + access-violation + access-not-allowed-in-current-state + parameter-value-inappropriate + parameter-value-inconsistent + class-not-supported + instance-locked-by-other-client + control-must-be-selected + type-conflict + failed-due-to-communications-constraint + failed-due-to-server-constraint + + + Unknown + Associate + Abort + Release + GetServerDirectory + GetLogicalDeviceDirectory + GetAllDataValues + GetDataValues + SetDataValues + GetDataDirectory + GetDataDefinition + GetDataSetValues + SetDataSetValues + CreateDataSet + DeleteDataSet + GetDataSetDirectory + SelectActiveSG + SelectEditSG + SetEditSGValue + ConfirmEditSGValues + GetEditSGValue + GetSGCBValues + Report + GetBRCBValues + SetBRCBValues + GetURCBValues + SetURCBValues + GetLCBValues + SetLCBValues + QueryLogByTime + QueryLogAfter + GetLogStatus + SendGOOSEMessage + GetGoCBValues + SetGoCBValues + GetGoReference + GetGOOSEElementNumber + SendMSVMessage + GetMSVCBValues + SetMSVCBValues + SendUSVMessage + GetUSVCBValues + SetUSVCBValues + Select + SelectWithValue + Cancel + Operate + CommandTermination + TimeActivatedOperate + GetFile + SetFile + DeleteFile + GetFileAttributValues + TimeSynchronisation + InternalChange + + + unknown + forward + backward + both + + +
diff --git a/examples/server_example_simple/sampleModel_with_dataset.cid b/examples/server_example_simple/sampleModel_with_dataset.cid index 65030e248..c59964a4d 100644 --- a/examples/server_example_simple/sampleModel_with_dataset.cid +++ b/examples/server_example_simple/sampleModel_with_dataset.cid @@ -1,181 +1,181 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - status-only - - - - - - - status-only - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + diff --git a/examples/server_example_threadless/simpleIO_direct_control.cid b/examples/server_example_threadless/simpleIO_direct_control.cid index c89a5f107..1138ab89e 100644 --- a/examples/server_example_threadless/simpleIO_direct_control.cid +++ b/examples/server_example_threadless/simpleIO_direct_control.cid @@ -1,253 +1,253 @@ - - -
-
- - - -
-

10.0.0.2

-

255.255.255.0

-

10.0.0.1

-

0001

-

00000001

-

0001

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - MZ Automation - - - 0.7.3 - - - libiec61850 server example - - - - - - - - status-only - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + +
+

10.0.0.2

+

255.255.255.0

+

10.0.0.1

+

0001

+

00000001

+

0001

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + MZ Automation + + + 0.7.3 + + + libiec61850 server example + + + + + + + + status-only + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +
diff --git a/examples/server_example_write_handler/complexModel.cid b/examples/server_example_write_handler/complexModel.cid index 9d5ccea71..f70d0f4f3 100644 --- a/examples/server_example_write_handler/complexModel.cid +++ b/examples/server_example_write_handler/complexModel.cid @@ -1,347 +1,347 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - status-only - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - status-only - - - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - - - rad - sr - m - Gy - q - °C - Sv - F - C - S - H - V - kg - ohm - J - N - Hz - Ix - Lm - Wb - T - W - Pa - s - m² - m³ - m/s - m/s² - m³/s - m/m³ - M - kg/m³ - m²/s - A - W/m K - J/K - ppm - 1/s - rad/s - K - VA - Watts - VAr - theta - cos(theta) - Vs - V² - As - A² - mol - A²t - VAh - Wh - VArh - V/Hz - cd - deg - - - Yocto - Zepto - Atto - Femto - Pico - Nano - Micro - Milli - Centi - Deci - zeroNoValue - Deca - Hecto - Kilo - Mega - Giga - Tera - Petra - Exa - Zetta - Yotta - - - normal - high - low - high-high - low-low - - - + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + + + rad + sr + m + Gy + q + °C + Sv + F + C + S + H + V + kg + ohm + J + N + Hz + Ix + Lm + Wb + T + W + Pa + s + m² + m³ + m/s + m/s² + m³/s + m/m³ + M + kg/m³ + m²/s + A + W/m K + J/K + ppm + 1/s + rad/s + K + VA + Watts + VAr + theta + cos(theta) + Vs + V² + As + A² + mol + A²t + VAh + Wh + VArh + V/Hz + cd + deg + + + Yocto + Zepto + Atto + Femto + Pico + Nano + Micro + Milli + Centi + Deci + zeroNoValue + Deca + Hecto + Kilo + Mega + Giga + Tera + Petra + Exa + Zetta + Yotta + + + normal + high + low + high-high + low-low + + + diff --git a/hal/CMakeLists.txt b/hal/CMakeLists.txt index 7b9f2db94..cabb02f9e 100644 --- a/hal/CMakeLists.txt +++ b/hal/CMakeLists.txt @@ -1,237 +1,237 @@ -cmake_minimum_required(VERSION 3.5.1) - -# automagically detect if we should cross-compile -if(DEFINED ENV{TOOLCHAIN}) - set(CMAKE_C_COMPILER $ENV{TOOLCHAIN}gcc) - set(CMAKE_CXX_COMPILER $ENV{TOOLCHAIN}g++) - set(CMAKE_AR "$ENV{TOOLCHAIN}ar" CACHE FILEPATH "CW archiver" FORCE) -endif() - -project(hal) - -set(LIBHAL_VERSION_MAJOR "2") -set(LIBHAL_VERSION_MINOR "2") -set(LIBHAL_VERSION_PATCH "0") - -# feature checks -include(CheckLibraryExists) -check_library_exists(rt clock_gettime "time.h" CONFIG_SYSTEM_HAS_CLOCK_GETTIME) - -# check if we are on a little or a big endian -include (TestBigEndian) -test_big_endian(PLATFORM_IS_BIGENDIAN) - -if(WIN32) - -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib") -message("Found winpcap -> compile ethernet HAL layer (required for GOOSE/SV support)") -set(WITH_WPCAP 1) -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Include") -else() -message("winpcap not found -> skip ethernet HAL layer (no L2 GOOSE/SV support)") -endif() - -endif(WIN32) - -include_directories( - ${CMAKE_CURRENT_LIST_DIR}/inc -) - -set (libhal_linux_SRCS - ${CMAKE_CURRENT_LIST_DIR}/socket/linux/socket_linux.c - ${CMAKE_CURRENT_LIST_DIR}/ethernet/linux/ethernet_linux.c - ${CMAKE_CURRENT_LIST_DIR}/thread/linux/thread_linux.c - ${CMAKE_CURRENT_LIST_DIR}/filesystem/linux/file_provider_linux.c - ${CMAKE_CURRENT_LIST_DIR}/time/unix/time.c - ${CMAKE_CURRENT_LIST_DIR}/serial/linux/serial_port_linux.c - ${CMAKE_CURRENT_LIST_DIR}/memory/lib_memory.c -) - -set (libhal_windows_SRCS - ${CMAKE_CURRENT_LIST_DIR}/socket/win32/socket_win32.c - ${CMAKE_CURRENT_LIST_DIR}/thread/win32/thread_win32.c - ${CMAKE_CURRENT_LIST_DIR}/filesystem/win32/file_provider_win32.c - ${CMAKE_CURRENT_LIST_DIR}/time/win32/time.c - ${CMAKE_CURRENT_LIST_DIR}/serial/win32/serial_port_win32.c - ${CMAKE_CURRENT_LIST_DIR}/memory/lib_memory.c -) - -if(WITH_WPCAP) -set (libhal_windows_SRCS ${libhal_windows_SRCS} - ${CMAKE_CURRENT_LIST_DIR}/ethernet/win32/ethernet_win32.c -) -endif(WITH_WPCAP) - -set (libhal_bsd_SRCS - ${CMAKE_CURRENT_LIST_DIR}/socket/bsd/socket_bsd.c - ${CMAKE_CURRENT_LIST_DIR}/ethernet/bsd/ethernet_bsd.c - ${CMAKE_CURRENT_LIST_DIR}/thread/bsd/thread_bsd.c - ${CMAKE_CURRENT_LIST_DIR}/filesystem/linux/file_provider_linux.c - ${CMAKE_CURRENT_LIST_DIR}/time/unix/time.c - ${CMAKE_CURRENT_LIST_DIR}/memory/lib_memory.c -) - -set (libhal_macos_SRCS - ${CMAKE_CURRENT_LIST_DIR}/socket/bsd/socket_bsd.c - ${CMAKE_CURRENT_LIST_DIR}/ethernet/bsd/ethernet_bsd.c - ${CMAKE_CURRENT_LIST_DIR}/thread/macos/thread_macos.c - ${CMAKE_CURRENT_LIST_DIR}/filesystem/linux/file_provider_linux.c - ${CMAKE_CURRENT_LIST_DIR}/time/unix/time.c - ${CMAKE_CURRENT_LIST_DIR}/memory/lib_memory.c -) - -IF(WIN32) - -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib") -message("Found winpcap -> can compile with GOOSE support") -set(WITH_WPCAP 1) -endif() - -set (libhal_SRCS - ${libhal_windows_SRCS} -) - -IF(MSVC) -set_source_files_properties(${libhal_SRCS} - PROPERTIES LANGUAGE CXX) -ENDIF() - -ELSEIF(UNIX) -IF(APPLE) -set (libhal_SRCS - ${libhal_macos_SRCS} -) -ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") -set (libhal_SRCS - ${libhal_bsd_SRCS} -) -ELSE() -set (libhal_SRCS - ${libhal_linux_SRCS} -) -ENDIF(APPLE) -ENDIF(WIN32) - -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" ) -#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" ) - -if(WITH_MBEDTLS) -message("Found mbedtls 2.28 -> can compile HAL with TLS 1.2 support") -set(WITH_MBEDTLS 1) -endif(WITH_MBEDTLS) - -if (WITH_MBEDTLS3) -message("Found mbedtls 3.6 -> can compile HAL with TLS 1.3 support") -set(WITH_MBEDTLS3 1) -endif(WITH_MBEDTLS3) - -if(WITH_MBEDTLS) -include_directories( - ${CMAKE_CURRENT_LIST_DIR}/tls/mbedtls - ${MBEDTLS_INCLUDE_DIR} -) - -if(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) -link_directories(${CONFIG_EXTERNAL_MBEDTLS_DYNLIB_PATH}) -else() -file(GLOB tls_SRCS ${CMAKE_CURRENT_LIST_DIR}/../third_party/mbedtls/mbedtls-2.28/library/*.c) -endif(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) - -add_definitions(-DMBEDTLS_CONFIG_FILE="mbedtls_config.h") - -set (libhal_SRCS ${libhal_SRCS} - ${CMAKE_CURRENT_LIST_DIR}/tls/mbedtls/tls_mbedtls.c -) - -IF(MSVC) -set_source_files_properties(${libhal_SRCS} - PROPERTIES LANGUAGE CXX) -ENDIF() - -list (APPEND libhal_SRCS ${tls_SRCS}) - -endif(WITH_MBEDTLS) - -if(WITH_MBEDTLS3) -include_directories( - ${CMAKE_CURRENT_LIST_DIR}/tls/mbedtls3 - ${MBEDTLS_INCLUDE_DIR} -) - -if(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) -link_directories(${CONFIG_EXTERNAL_MBEDTLS_DYNLIB_PATH}) -else() -file(GLOB tls_SRCS ${CMAKE_CURRENT_LIST_DIR}/../third_party/mbedtls/mbedtls-3.6.0/library/*.c) -endif(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) - -add_definitions(-DMBEDTLS_CONFIG_FILE="mbedtls_config.h") - -set (libhal_SRCS ${libhal_SRCS} - ${CMAKE_CURRENT_LIST_DIR}/tls/mbedtls3/tls_mbedtls.c -) - -IF(MSVC) -set_source_files_properties(${libhal_SRCS} - PROPERTIES LANGUAGE CXX) -ENDIF() - -list (APPEND libhal_SRCS ${tls_SRCS}) -endif(WITH_MBEDTLS3) - -add_library (hal STATIC ${libhal_SRCS}) - -add_library (hal-shared STATIC ${libhal_SRCS}) - -target_compile_definitions(hal-shared PRIVATE EXPORT_FUNCTIONS_FOR_DLL) - -SET_TARGET_PROPERTIES(hal-shared PROPERTIES - COMPILE_FLAGS "-fPIC" -) - -IF(UNIX) - IF (CONFIG_SYSTEM_HAS_CLOCK_GETTIME) - target_link_libraries (hal - -lpthread - -lrt - ) - ELSE () - target_link_libraries (hal - -lpthread - ) - ENDIF (CONFIG_SYSTEM_HAS_CLOCK_GETTIME) -ENDIF(UNIX) - -IF(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) - target_link_libraries(hal mbedcrypto mbedx509 mbedtls) -ENDIF(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) - -IF(MINGW) - target_link_libraries(hal ws2_32 iphlpapi) -ENDIF(MINGW) - -IF (MSVC) - target_link_libraries(hal bcrypt) - target_link_libraries(hal-shared bcrypt) -ENDIF() - -iF(WITH_WPCAP) -target_link_libraries(hal - ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib - ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/packet.lib -) -ENDIF(WITH_WPCAP) - -set(BINDIR "bin") -set(LIBDIR "lib") -if(UNIX) - # GNUInstallDirs is required for Debian multiarch - include(GNUInstallDirs) - set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) - set(BINDIR ${CMAKE_INSTALL_BINDIR}) -endif() - -install (TARGETS hal hal-shared - RUNTIME DESTINATION ${BINDIR} COMPONENT Applications - ARCHIVE DESTINATION ${LIBDIR} COMPONENT Libraries - LIBRARY DESTINATION ${LIBDIR} COMPONENT Libraries -) +cmake_minimum_required(VERSION 3.5.1) + +# automagically detect if we should cross-compile +if(DEFINED ENV{TOOLCHAIN}) + set(CMAKE_C_COMPILER $ENV{TOOLCHAIN}gcc) + set(CMAKE_CXX_COMPILER $ENV{TOOLCHAIN}g++) + set(CMAKE_AR "$ENV{TOOLCHAIN}ar" CACHE FILEPATH "CW archiver" FORCE) +endif() + +project(hal) + +set(LIBHAL_VERSION_MAJOR "2") +set(LIBHAL_VERSION_MINOR "2") +set(LIBHAL_VERSION_PATCH "0") + +# feature checks +include(CheckLibraryExists) +check_library_exists(rt clock_gettime "time.h" CONFIG_SYSTEM_HAS_CLOCK_GETTIME) + +# check if we are on a little or a big endian +include (TestBigEndian) +test_big_endian(PLATFORM_IS_BIGENDIAN) + +if(WIN32) + +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib") +message("Found winpcap -> compile ethernet HAL layer (required for GOOSE/SV support)") +set(WITH_WPCAP 1) +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Include") +else() +message("winpcap not found -> skip ethernet HAL layer (no L2 GOOSE/SV support)") +endif() + +endif(WIN32) + +include_directories( + ${CMAKE_CURRENT_LIST_DIR}/inc +) + +set (libhal_linux_SRCS + ${CMAKE_CURRENT_LIST_DIR}/socket/linux/socket_linux.c + ${CMAKE_CURRENT_LIST_DIR}/ethernet/linux/ethernet_linux.c + ${CMAKE_CURRENT_LIST_DIR}/thread/linux/thread_linux.c + ${CMAKE_CURRENT_LIST_DIR}/filesystem/linux/file_provider_linux.c + ${CMAKE_CURRENT_LIST_DIR}/time/unix/time.c + ${CMAKE_CURRENT_LIST_DIR}/serial/linux/serial_port_linux.c + ${CMAKE_CURRENT_LIST_DIR}/memory/lib_memory.c +) + +set (libhal_windows_SRCS + ${CMAKE_CURRENT_LIST_DIR}/socket/win32/socket_win32.c + ${CMAKE_CURRENT_LIST_DIR}/thread/win32/thread_win32.c + ${CMAKE_CURRENT_LIST_DIR}/filesystem/win32/file_provider_win32.c + ${CMAKE_CURRENT_LIST_DIR}/time/win32/time.c + ${CMAKE_CURRENT_LIST_DIR}/serial/win32/serial_port_win32.c + ${CMAKE_CURRENT_LIST_DIR}/memory/lib_memory.c +) + +if(WITH_WPCAP) +set (libhal_windows_SRCS ${libhal_windows_SRCS} + ${CMAKE_CURRENT_LIST_DIR}/ethernet/win32/ethernet_win32.c +) +endif(WITH_WPCAP) + +set (libhal_bsd_SRCS + ${CMAKE_CURRENT_LIST_DIR}/socket/bsd/socket_bsd.c + ${CMAKE_CURRENT_LIST_DIR}/ethernet/bsd/ethernet_bsd.c + ${CMAKE_CURRENT_LIST_DIR}/thread/bsd/thread_bsd.c + ${CMAKE_CURRENT_LIST_DIR}/filesystem/linux/file_provider_linux.c + ${CMAKE_CURRENT_LIST_DIR}/time/unix/time.c + ${CMAKE_CURRENT_LIST_DIR}/memory/lib_memory.c +) + +set (libhal_macos_SRCS + ${CMAKE_CURRENT_LIST_DIR}/socket/bsd/socket_bsd.c + ${CMAKE_CURRENT_LIST_DIR}/ethernet/bsd/ethernet_bsd.c + ${CMAKE_CURRENT_LIST_DIR}/thread/macos/thread_macos.c + ${CMAKE_CURRENT_LIST_DIR}/filesystem/linux/file_provider_linux.c + ${CMAKE_CURRENT_LIST_DIR}/time/unix/time.c + ${CMAKE_CURRENT_LIST_DIR}/memory/lib_memory.c +) + +IF(WIN32) + +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib") +message("Found winpcap -> can compile with GOOSE support") +set(WITH_WPCAP 1) +endif() + +set (libhal_SRCS + ${libhal_windows_SRCS} +) + +IF(MSVC) +set_source_files_properties(${libhal_SRCS} + PROPERTIES LANGUAGE CXX) +ENDIF() + +ELSEIF(UNIX) +IF(APPLE) +set (libhal_SRCS + ${libhal_macos_SRCS} +) +ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") +set (libhal_SRCS + ${libhal_bsd_SRCS} +) +ELSE() +set (libhal_SRCS + ${libhal_linux_SRCS} +) +ENDIF(APPLE) +ENDIF(WIN32) + +#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" ) +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" ) + +if(WITH_MBEDTLS) +message("Found mbedtls 2.28 -> can compile HAL with TLS 1.2 support") +set(WITH_MBEDTLS 1) +endif(WITH_MBEDTLS) + +if (WITH_MBEDTLS3) +message("Found mbedtls 3.6 -> can compile HAL with TLS 1.3 support") +set(WITH_MBEDTLS3 1) +endif(WITH_MBEDTLS3) + +if(WITH_MBEDTLS) +include_directories( + ${CMAKE_CURRENT_LIST_DIR}/tls/mbedtls + ${MBEDTLS_INCLUDE_DIR} +) + +if(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) +link_directories(${CONFIG_EXTERNAL_MBEDTLS_DYNLIB_PATH}) +else() +file(GLOB tls_SRCS ${CMAKE_CURRENT_LIST_DIR}/../third_party/mbedtls/mbedtls-2.28/library/*.c) +endif(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) + +add_definitions(-DMBEDTLS_CONFIG_FILE="mbedtls_config.h") + +set (libhal_SRCS ${libhal_SRCS} + ${CMAKE_CURRENT_LIST_DIR}/tls/mbedtls/tls_mbedtls.c +) + +IF(MSVC) +set_source_files_properties(${libhal_SRCS} + PROPERTIES LANGUAGE CXX) +ENDIF() + +list (APPEND libhal_SRCS ${tls_SRCS}) + +endif(WITH_MBEDTLS) + +if(WITH_MBEDTLS3) +include_directories( + ${CMAKE_CURRENT_LIST_DIR}/tls/mbedtls3 + ${MBEDTLS_INCLUDE_DIR} +) + +if(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) +link_directories(${CONFIG_EXTERNAL_MBEDTLS_DYNLIB_PATH}) +else() +file(GLOB tls_SRCS ${CMAKE_CURRENT_LIST_DIR}/../third_party/mbedtls/mbedtls-3.6.0/library/*.c) +endif(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) + +add_definitions(-DMBEDTLS_CONFIG_FILE="mbedtls_config.h") + +set (libhal_SRCS ${libhal_SRCS} + ${CMAKE_CURRENT_LIST_DIR}/tls/mbedtls3/tls_mbedtls.c +) + +IF(MSVC) +set_source_files_properties(${libhal_SRCS} + PROPERTIES LANGUAGE CXX) +ENDIF() + +list (APPEND libhal_SRCS ${tls_SRCS}) +endif(WITH_MBEDTLS3) + +add_library (hal STATIC ${libhal_SRCS}) + +add_library (hal-shared STATIC ${libhal_SRCS}) + +target_compile_definitions(hal-shared PRIVATE EXPORT_FUNCTIONS_FOR_DLL) + +SET_TARGET_PROPERTIES(hal-shared PROPERTIES + COMPILE_FLAGS "-fPIC" +) + +IF(UNIX) + IF (CONFIG_SYSTEM_HAS_CLOCK_GETTIME) + target_link_libraries (hal + -lpthread + -lrt + ) + ELSE () + target_link_libraries (hal + -lpthread + ) + ENDIF (CONFIG_SYSTEM_HAS_CLOCK_GETTIME) +ENDIF(UNIX) + +IF(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) + target_link_libraries(hal mbedcrypto mbedx509 mbedtls) +ENDIF(CONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB) + +IF(MINGW) + target_link_libraries(hal ws2_32 iphlpapi) +ENDIF(MINGW) + +IF (MSVC) + target_link_libraries(hal bcrypt) + target_link_libraries(hal-shared bcrypt) +ENDIF() + +iF(WITH_WPCAP) +target_link_libraries(hal + ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib + ${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/packet.lib +) +ENDIF(WITH_WPCAP) + +set(BINDIR "bin") +set(LIBDIR "lib") +if(UNIX) + # GNUInstallDirs is required for Debian multiarch + include(GNUInstallDirs) + set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) + set(BINDIR ${CMAKE_INSTALL_BINDIR}) +endif() + +install (TARGETS hal hal-shared + RUNTIME DESTINATION ${BINDIR} COMPONENT Applications + ARCHIVE DESTINATION ${LIBDIR} COMPONENT Libraries + LIBRARY DESTINATION ${LIBDIR} COMPONENT Libraries +) diff --git a/hal/thread/macos/thread_macos.c b/hal/thread/macos/thread_macos.c index 8acbaa846..209d037bc 100644 --- a/hal/thread/macos/thread_macos.c +++ b/hal/thread/macos/thread_macos.c @@ -1,149 +1,149 @@ -/** - * thread_macos.c - * - * Copyright 2013-2021 Michael Zillgith - * - * This file is part of Platform Abstraction Layer (libpal) - * for libiec61850, libmms, and lib60870. - */ - -/* - * NOTE: MacOS needs own thread layer because it doesn't support unnamed semaphores! - * NOTE: named semaphores were replaced by POSIX mutex - */ - -#include -#include -#include -#include -#include -#include "hal_thread.h" -#include "lib_memory.h" - -struct sThread { - ThreadExecutionFunction function; - void* parameter; - pthread_t pthread; - int state; - bool autodestroy; -}; - -typedef struct sSemaphore* mSemaphore; - -struct sSemaphore -{ - pthread_mutex_t mutex; -}; - -/* - * NOTE: initialValue is ignored because semaphore was replaced by mutex - */ -Semaphore -Semaphore_create(int initialValue) -{ - mSemaphore self = NULL; - - self = (mSemaphore) GLOBAL_CALLOC(1, sizeof(struct sSemaphore)); - - if (self) { - pthread_mutex_init(&(self->mutex), NULL); - } - - return (Semaphore)self; -} - -/* lock mutex */ -void -Semaphore_wait(Semaphore self) -{ - mSemaphore mSelf = (mSemaphore) self; - - int retVal = pthread_mutex_lock(&(mSelf->mutex)); - - if (retVal) { - printf("FATAL ERROR: pthread_mutex_lock failed (err=%i)\n", retVal); - exit(-1); - } -} - -/* unlock mutex */ -void -Semaphore_post(Semaphore self) -{ - mSemaphore mSelf = (mSemaphore) self; - - int retVal = pthread_mutex_unlock(&(mSelf->mutex)); - - if (retVal) { - printf("FATAL ERROR: pthread_mutex_unlock failed (err=%i)\n", retVal); - exit(-1); - } -} - -void -Semaphore_destroy(Semaphore self) -{ - if (self) { - mSemaphore mSelf = (mSemaphore) self; - - pthread_mutex_destroy(&(mSelf->mutex)); - - GLOBAL_FREEMEM(mSelf); - } -} - -Thread -Thread_create(ThreadExecutionFunction function, void* parameter, bool autodestroy) -{ - Thread thread = (Thread) GLOBAL_MALLOC(sizeof(struct sThread)); - - if (thread != NULL) { - thread->parameter = parameter; - thread->function = function; - thread->state = 0; - thread->autodestroy = autodestroy; - } - - return thread; -} - -static void* -destroyAutomaticThread(void* parameter) -{ - Thread thread = (Thread) parameter; - - thread->function(thread->parameter); - - GLOBAL_FREEMEM(thread); - - pthread_exit(NULL); -} - -void -Thread_start(Thread thread) -{ - if (thread->autodestroy == true) { - pthread_create(&thread->pthread, NULL, destroyAutomaticThread, thread); - pthread_detach(thread->pthread); - } - else - pthread_create(&thread->pthread, NULL, thread->function, thread->parameter); - - thread->state = 1; -} - -void -Thread_destroy(Thread thread) -{ - if (thread->state == 1) { - pthread_join(thread->pthread, NULL); - } - - GLOBAL_FREEMEM(thread); -} - -void -Thread_sleep(int millies) -{ - usleep(millies * 1000); -} +/** + * thread_macos.c + * + * Copyright 2013-2021 Michael Zillgith + * + * This file is part of Platform Abstraction Layer (libpal) + * for libiec61850, libmms, and lib60870. + */ + +/* + * NOTE: MacOS needs own thread layer because it doesn't support unnamed semaphores! + * NOTE: named semaphores were replaced by POSIX mutex + */ + +#include +#include +#include +#include +#include +#include "hal_thread.h" +#include "lib_memory.h" + +struct sThread { + ThreadExecutionFunction function; + void* parameter; + pthread_t pthread; + int state; + bool autodestroy; +}; + +typedef struct sSemaphore* mSemaphore; + +struct sSemaphore +{ + pthread_mutex_t mutex; +}; + +/* + * NOTE: initialValue is ignored because semaphore was replaced by mutex + */ +Semaphore +Semaphore_create(int initialValue) +{ + mSemaphore self = NULL; + + self = (mSemaphore) GLOBAL_CALLOC(1, sizeof(struct sSemaphore)); + + if (self) { + pthread_mutex_init(&(self->mutex), NULL); + } + + return (Semaphore)self; +} + +/* lock mutex */ +void +Semaphore_wait(Semaphore self) +{ + mSemaphore mSelf = (mSemaphore) self; + + int retVal = pthread_mutex_lock(&(mSelf->mutex)); + + if (retVal) { + printf("FATAL ERROR: pthread_mutex_lock failed (err=%i)\n", retVal); + exit(-1); + } +} + +/* unlock mutex */ +void +Semaphore_post(Semaphore self) +{ + mSemaphore mSelf = (mSemaphore) self; + + int retVal = pthread_mutex_unlock(&(mSelf->mutex)); + + if (retVal) { + printf("FATAL ERROR: pthread_mutex_unlock failed (err=%i)\n", retVal); + exit(-1); + } +} + +void +Semaphore_destroy(Semaphore self) +{ + if (self) { + mSemaphore mSelf = (mSemaphore) self; + + pthread_mutex_destroy(&(mSelf->mutex)); + + GLOBAL_FREEMEM(mSelf); + } +} + +Thread +Thread_create(ThreadExecutionFunction function, void* parameter, bool autodestroy) +{ + Thread thread = (Thread) GLOBAL_MALLOC(sizeof(struct sThread)); + + if (thread != NULL) { + thread->parameter = parameter; + thread->function = function; + thread->state = 0; + thread->autodestroy = autodestroy; + } + + return thread; +} + +static void* +destroyAutomaticThread(void* parameter) +{ + Thread thread = (Thread) parameter; + + thread->function(thread->parameter); + + GLOBAL_FREEMEM(thread); + + pthread_exit(NULL); +} + +void +Thread_start(Thread thread) +{ + if (thread->autodestroy == true) { + pthread_create(&thread->pthread, NULL, destroyAutomaticThread, thread); + pthread_detach(thread->pthread); + } + else + pthread_create(&thread->pthread, NULL, thread->function, thread->parameter); + + thread->state = 1; +} + +void +Thread_destroy(Thread thread) +{ + if (thread->state == 1) { + pthread_join(thread->pthread, NULL); + } + + GLOBAL_FREEMEM(thread); +} + +void +Thread_sleep(int millies) +{ + usleep(millies * 1000); +} diff --git a/src/iec61850/inc_private/iec61850_common_internal.h b/src/iec61850/inc_private/iec61850_common_internal.h index 56926aae7..11df6f51c 100644 --- a/src/iec61850/inc_private/iec61850_common_internal.h +++ b/src/iec61850/inc_private/iec61850_common_internal.h @@ -1,41 +1,41 @@ -/* - * iec61850_common_internal.h - * - * Copyright 2019 Michael Zillgith - * - * This file is part of libIEC61850. - * - * libIEC61850 is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * libIEC61850 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libIEC61850. If not, see . - * - * See COPYING file for the complete license text. - */ - -#ifndef SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ -#define SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ - -#include "iec61850_model.h" - -LIB61850_INTERNAL char* -MmsMapping_getMmsDomainFromObjectReference(const char* objectReference, char* buffer); - -LIB61850_INTERNAL char* -MmsMapping_createMmsVariableNameFromObjectReference(const char* objectReference, FunctionalConstraint fc, char* buffer); - -LIB61850_INTERNAL MmsVariableAccessSpecification* -MmsMapping_ObjectReferenceToVariableAccessSpec(char* objectReference); - -LIB61850_INTERNAL char* -MmsMapping_varAccessSpecToObjectReference(MmsVariableAccessSpecification* varAccessSpec); - -#endif /* SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ */ +/* + * iec61850_common_internal.h + * + * Copyright 2019 Michael Zillgith + * + * This file is part of libIEC61850. + * + * libIEC61850 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libIEC61850 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libIEC61850. If not, see . + * + * See COPYING file for the complete license text. + */ + +#ifndef SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ +#define SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ + +#include "iec61850_model.h" + +LIB61850_INTERNAL char* +MmsMapping_getMmsDomainFromObjectReference(const char* objectReference, char* buffer); + +LIB61850_INTERNAL char* +MmsMapping_createMmsVariableNameFromObjectReference(const char* objectReference, FunctionalConstraint fc, char* buffer); + +LIB61850_INTERNAL MmsVariableAccessSpecification* +MmsMapping_ObjectReferenceToVariableAccessSpec(char* objectReference); + +LIB61850_INTERNAL char* +MmsMapping_varAccessSpecToObjectReference(MmsVariableAccessSpecification* varAccessSpec); + +#endif /* SRC_IEC61850_INC_PRIVATE_IEC61850_COMMON_INTERNAL_H_ */ diff --git a/src/iec61850/inc_private/mms_mapping_internal.h b/src/iec61850/inc_private/mms_mapping_internal.h index 1830b87cb..b33257e2f 100644 --- a/src/iec61850/inc_private/mms_mapping_internal.h +++ b/src/iec61850/inc_private/mms_mapping_internal.h @@ -1,354 +1,354 @@ -/* - * mms_mapping_internal.h - * - * Copyright 2013-2022 Michael Zillgith - * - * This file is part of libIEC61850. - * - * libIEC61850 is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * libIEC61850 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libIEC61850. If not, see . - * - * See COPYING file for the complete license text. - */ - -#ifndef MMS_MAPPING_INTERNAL_H_ -#define MMS_MAPPING_INTERNAL_H_ - -#include "stack_config.h" - -#include "hal_thread.h" -#include "linked_list.h" - -#if (CONFIG_IEC61850_SERVICE_TRACKING == 1) - -typedef int IEC61850_ServiceType; - -#define IEC61850_SERVICE_TYPE_UNKOWN 0 -#define IEC61850_SERVICE_TYPE_ASSOCIATE 1 -#define IEC61850_SERVICE_TYPE_ABORT 2 -#define IEC61850_SERVICE_TYPE_RELEASE 3 -#define IEC61850_SERVICE_TYPE_GET_SERVER_DIRECTORY 4 -#define IEC61850_SERVICE_TYPE_GET_LOGICAL_DEVICE_DIRECTORY 5 -#define IEC61850_SERVICE_TYPE_GET_ALL_DATA_VALUES 6 -#define IEC61850_SERVICE_TYPE_GET_DATA_VALUES 7 -#define IEC61850_SERVICE_TYPE_SET_DATA_VALUES 8 -#define IEC61850_SERVICE_TYPE_GET_DATA_DIRECTORY 9 -#define IEC61850_SERVICE_TYPE_GET_DATA_DEFINITION 10 -#define IEC61850_SERVICE_TYPE_GET_DATA_SET_VALUES 11 -#define IEC61850_SERVICE_TYPE_SET_DATA_SET_VALUES 12 -#define IEC61850_SERVICE_TYPE_CREATE_DATA_SET 13 -#define IEC61850_SERVICE_TYPE_DELETE_DATA_SET 14 -#define IEC61850_SERVICE_TYPE_GET_DATA_SET_DIRECTORY 15 -#define IEC61850_SERVICE_TYPE_SELECT_ACTIVE_SG 16 -#define IEC61850_SERVICE_TYPE_SELECT_EDIT_SG 17 -#define IEC61850_SERVICE_TYPE_SET_EDIT_SG_VALUE 18 -#define IEC61850_SERVICE_TYPE_CONFIRM_EDIT_SG_VALUES 19 -#define IEC61850_SERVICE_TYPE_GET_EDIT_SG_VALUE 20 -#define IEC61850_SERVICE_TYPE_GET_SGCB_VALUES 21 -#define IEC61850_SERVICE_TYPE_REPORT 22 -#define IEC61850_SERVICE_TYPE_GET_BRCB_VALUES 23 -#define IEC61850_SERVICE_TYPE_SET_BRCB_VALUES 24 -#define IEC61850_SERVICE_TYPE_GET_URCB_VALUES 25 -#define IEC61850_SERVICE_TYPE_SET_URCB_VALUES 26 -#define IEC61850_SERVICE_TYPE_GET_LCB_VALUES 27 -#define IEC61850_SERVICE_TYPE_SET_LCB_VALUES 28 -#define IEC61850_SERVICE_TYPE_QUERY_LOG_BY_TIME 29 -#define IEC61850_SERVICE_TYPE_QUERY_LOG_AFTER 30 -#define IEC61850_SERVICE_TYPE_GET_LOG_STATUS 31 -#define IEC61850_SERVICE_TYPE_SEND_GOOSE_MESSAGE 32 -#define IEC61850_SERVICE_TYPE_GET_GOCB_VALUES 33 -#define IEC61850_SERVICE_TYPE_SET_GOCB_VALUES 34 -#define IEC61850_SERVICE_TYPE_GET_GO_REFERENCE 35 -#define IEC61850_SERVICE_TYPE_GET_GOOSE_ELEMENT_NUMBER 36 -#define IEC61850_SERVICE_TYPE_SEND_MSV_MESSAGE 37 -#define IEC61850_SERVICE_TYPE_GET_MSVCB_VALUES 38 -#define IEC61850_SERVICE_TYPE_SET_MSVCB_VALUES 39 -#define IEC61850_SERVICE_TYPE_SEND_USV_MESSAGE 40 -#define IEC61850_SERVICE_TYPE_GET_USVCB_VALUES 41 -#define IEC61850_SERVICE_TYPE_SET_USVCB_VALUES 42 -#define IEC61850_SERVICE_TYPE_SELECT 43 -#define IEC61850_SERVICE_TYPE_SELECT_WITH_VALUES 44 -#define IEC61850_SERVICE_TYPE_CANCEL 45 -#define IEC61850_SERVICE_TYPE_OPERATE 46 -#define IEC61850_SERVICE_TYPE_COMMAND_TERMINATION 47 -#define IEC61850_SERVICE_TYPE_TIME_ACTIVATED_OPERATE 48 -#define IEC61850_SERVICE_TYPE_GET_FILE 49 -#define IEC61850_SERVICE_TYPE_SET_FILE 50 -#define IEC61850_SERVICE_TYPE_DELETE_FILE 51 -#define IEC61850_SERVICE_TYPE_GET_FILE_ATTRIBUTE_VALUES 52 -#define IEC61850_SERVICE_TYPE_TIME_SYNCHRONISATION 53 -#define IEC61850_SERVICE_TYPE_INTERNAL_CHANGE 54 - -typedef int IEC61850_ServiceError; - -#define IEC61850_SERVICE_ERROR_NO_ERROR 0 -#define IEC61850_SERVICE_ERROR_INSTANCE_NOT_AVAILABLE 1 -#define IEC61850_SERVICE_ERROR_INSTANCE_IN_USE 2 -#define IEC61850_SERVICE_ERROR_ACCESS_VIOLATION 3 -#define IEC61850_SERVICE_ERROR_ACCESS_NOT_ALLOWED_IN_CURRENT_STATE 4 -#define IEC61850_SERVICE_ERROR_PARAMETER_VALUE_INAPPROPRIATE 5 -#define IEC61850_SERVICE_ERROR_PARAMETER_VALUE_INCONSISTENT 6 -#define IEC61850_SERVICE_ERROR_CLASS_NOT_SUPPORTED 7 -#define IEC61850_SERVICE_ERROR_INSTANCE_LOCKED_BY_OTHER_CLIENT 8 -#define IEC61850_SERVICE_ERROR_CONTROL_MUST_BE_SELECTED 9 -#define IEC61850_SERVICE_ERROR_TYPE_CONFLICT 10 -#define IEC61850_SERVICE_ERROR_FAILED_DUE_TO_COMMUNICATION_CONSTRAINT 11 -#define IEC61850_SERVICE_ERROR_FAILED_DUE_TO_SERVER_CONSTRAINT 12 - -typedef struct sServiceTrkInstance* ServiceTrkInstance; - -struct sServiceTrkInstance -{ - DataObject* dobj; - DataAttribute* objRef; - DataAttribute* serviceType; - DataAttribute* errorCode; - DataAttribute* originatorID; /* optional */ - DataAttribute* t; -}; - -typedef struct sBrcbTrkInstance* BrcbTrkInstance; - -struct sBrcbTrkInstance -{ - /* inherited from ServiceTrkInstance */ - DataObject* dobj; - DataAttribute* objRef; - DataAttribute* serviceType; - DataAttribute* errorCode; - DataAttribute* originatorID; /* optional */ - DataAttribute* t; - - /* BrcbTrk specific attributes */ - DataAttribute* rptID; - DataAttribute* rptEna; - DataAttribute* datSet; - DataAttribute* confRev; - DataAttribute* optFlds; - DataAttribute* bufTm; - DataAttribute* sqNum; - DataAttribute* trgOps; - DataAttribute* intgPd; - DataAttribute* gi; - DataAttribute* purgeBuf; - DataAttribute* entryID; - DataAttribute* timeOfEntry; - DataAttribute* resvTms; /* optional */ -}; - -typedef struct sUrcbTrkInstance* UrcbTrkInstance; - -struct sUrcbTrkInstance -{ - /* inherited from ServiceTrkInstance */ - DataObject* dobj; - DataAttribute* objRef; - DataAttribute* serviceType; - DataAttribute* errorCode; - DataAttribute* originatorID; /* optional */ - DataAttribute* t; - - /* UrcbTrk specific attributes */ - DataAttribute* rptID; - DataAttribute* rptEna; - DataAttribute* resv; - DataAttribute* datSet; - DataAttribute* confRev; - DataAttribute* optFlds; - DataAttribute* bufTm; - DataAttribute* sqNum; - DataAttribute* trgOps; - DataAttribute* intgPd; - DataAttribute* gi; -}; - -typedef struct sGocbTrkInstance* GocbTrkInstance; - -struct sGocbTrkInstance -{ - /* inherited from ServiceTrkInstance */ - DataObject* dobj; - DataAttribute* objRef; - DataAttribute* serviceType; - DataAttribute* errorCode; - DataAttribute* originatorID; /* optional */ - DataAttribute* t; - - /* GocbTrk specific attributes */ - DataAttribute* goEna; - DataAttribute* goID; - DataAttribute* datSet; - DataAttribute* confRev; - DataAttribute* ndsCom; - DataAttribute* dstAddress; -}; - -typedef struct sControlTrkInstance* ControlTrkInstance; - -struct sControlTrkInstance -{ - /* inherited from ServiceTrkInstance */ - DataObject* dobj; - DataAttribute* objRef; - DataAttribute* serviceType; - DataAttribute* errorCode; - DataAttribute* originatorID; /* optional */ - DataAttribute* t; - - /* CTS specific attributes */ - DataAttribute* ctlVal; - DataAttribute* operTm; /* conditional */ - DataAttribute* origin; - DataAttribute* ctlNum; - DataAttribute* T; - DataAttribute* Test; - DataAttribute* Check; - DataAttribute* respAddCause; -}; - -typedef struct sSgcbTrkInstance* SgcbTrkInstance; - -struct sSgcbTrkInstance -{ - /* inherited from ServiceTrkInstance */ - DataObject* dobj; - DataAttribute* objRef; - DataAttribute* serviceType; - DataAttribute* errorCode; - DataAttribute* originatorID; /* optional */ - DataAttribute* t; - - /* SgcbTrk specific attributes */ - DataAttribute* numOfSG; - DataAttribute* actSG; - DataAttribute* editSG; - DataAttribute* cnfEdit; - DataAttribute* lActTm; -}; - -typedef struct sLocbTrkInstance* LocbTrkInstance; - -struct sLocbTrkInstance -{ - /* inherited from ServiceTrkInstance */ - DataObject* dobj; - DataAttribute* objRef; - DataAttribute* serviceType; - DataAttribute* errorCode; - DataAttribute* originatorID; /* optional */ - DataAttribute* t; - - /* LocbTrk specific attributes */ - DataAttribute* logEna; - DataAttribute* datSet; - DataAttribute* trgOps; - DataAttribute* intgPd; - DataAttribute* logRef; -}; - -#endif /* (CONFIG_IEC61850_SERVICE_TRACKING == 1) */ - -struct sMmsMapping { - IedModel* model; - MmsDevice* mmsDevice; - MmsServer mmsServer; - LinkedList reportControls; - -#if (CONFIG_IEC61850_LOG_SERVICE == 1) - LinkedList logControls; - LinkedList logInstances; -#endif - -#if (CONFIG_INCLUDE_GOOSE_SUPPORT == 1) - bool useIntegratedPublisher; - - LinkedList gseControls; - char* gooseInterfaceId; - - GoCBEventHandler goCbHandler; - void* goCbHandlerParameter; -#endif - -#if (CONFIG_IEC61850_SAMPLED_VALUES_SUPPORT == 1) - LinkedList svControls; - const char* svInterfaceId; -#endif - - LinkedList controlObjects; - uint64_t nextControlTimeout; /* next timeout in one of the control state machines */ - - LinkedList attributeAccessHandlers; - -#if (CONFIG_IEC61850_SUPPORT_USER_READ_ACCESS_CONTROL == 1) - ReadAccessHandler readAccessHandler; - void* readAccessHandlerParameter; -#endif - -#if (CONFIG_IEC61850_SETTING_GROUPS == 1) - bool allowEditSg; - LinkedList settingGroups; -#endif - -#if (CONFIG_MMS_THREADLESS_STACK != 1) - bool reportThreadRunning; - Thread reportWorkerThread; -#endif - -#if (CONFIG_IEC61850_SERVICE_TRACKING == 1) - BrcbTrkInstance brcbTrk; - UrcbTrkInstance urcbTrk; - GocbTrkInstance gocbTrk; - ControlTrkInstance spcTrk; - ControlTrkInstance dpcTrk; - ControlTrkInstance incTrk; - ControlTrkInstance encTrk1; - ControlTrkInstance apcFTrk; - ControlTrkInstance apcIntTrk; - ControlTrkInstance bscTrk; - ControlTrkInstance iscTrk; - ControlTrkInstance bacTrk; - SgcbTrkInstance sgcbTrk; - ServiceTrkInstance genTrk; - LocbTrkInstance locbTrk; -#endif /* (CONFIG_IEC61850_SERVICE_TRACKING == 1) */ - - /* flag indicates if data model is locked --> prevents reports to be sent */ - - bool isModelLocked; - -#if (CONFIG_MMS_THREADLESS_STACK != 1) - Semaphore isModelLockedMutex; -#endif /* (CONFIG_MMS_THREADLESS_STACK != 1) */ - - IedServer iedServer; - - IedConnectionIndicationHandler connectionIndicationHandler; - void* connectionIndicationHandlerParameter; - - IedServer_RCBEventHandler rcbEventHandler; - void* rcbEventHandlerParameter; - - IedServer_DataSetAccessHandler dataSetAccessHandler; - void* dataSetAccessHandlerParameter; - - IedServer_DirectoryAccessHandler directoryAccessHandler; - void* directoryAccessHandlerParameter; - - IedServer_ListObjectsAccessHandler listObjectsAccessHandler; - void* listObjectsAccessHandlerParameter; - - IedServer_ControlBlockAccessHandler controlBlockAccessHandler; - void* controlBlockAccessHandlerParameter; -}; - -#endif /* MMS_MAPPING_INTERNAL_H_ */ +/* + * mms_mapping_internal.h + * + * Copyright 2013-2022 Michael Zillgith + * + * This file is part of libIEC61850. + * + * libIEC61850 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libIEC61850 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libIEC61850. If not, see . + * + * See COPYING file for the complete license text. + */ + +#ifndef MMS_MAPPING_INTERNAL_H_ +#define MMS_MAPPING_INTERNAL_H_ + +#include "stack_config.h" + +#include "hal_thread.h" +#include "linked_list.h" + +#if (CONFIG_IEC61850_SERVICE_TRACKING == 1) + +typedef int IEC61850_ServiceType; + +#define IEC61850_SERVICE_TYPE_UNKOWN 0 +#define IEC61850_SERVICE_TYPE_ASSOCIATE 1 +#define IEC61850_SERVICE_TYPE_ABORT 2 +#define IEC61850_SERVICE_TYPE_RELEASE 3 +#define IEC61850_SERVICE_TYPE_GET_SERVER_DIRECTORY 4 +#define IEC61850_SERVICE_TYPE_GET_LOGICAL_DEVICE_DIRECTORY 5 +#define IEC61850_SERVICE_TYPE_GET_ALL_DATA_VALUES 6 +#define IEC61850_SERVICE_TYPE_GET_DATA_VALUES 7 +#define IEC61850_SERVICE_TYPE_SET_DATA_VALUES 8 +#define IEC61850_SERVICE_TYPE_GET_DATA_DIRECTORY 9 +#define IEC61850_SERVICE_TYPE_GET_DATA_DEFINITION 10 +#define IEC61850_SERVICE_TYPE_GET_DATA_SET_VALUES 11 +#define IEC61850_SERVICE_TYPE_SET_DATA_SET_VALUES 12 +#define IEC61850_SERVICE_TYPE_CREATE_DATA_SET 13 +#define IEC61850_SERVICE_TYPE_DELETE_DATA_SET 14 +#define IEC61850_SERVICE_TYPE_GET_DATA_SET_DIRECTORY 15 +#define IEC61850_SERVICE_TYPE_SELECT_ACTIVE_SG 16 +#define IEC61850_SERVICE_TYPE_SELECT_EDIT_SG 17 +#define IEC61850_SERVICE_TYPE_SET_EDIT_SG_VALUE 18 +#define IEC61850_SERVICE_TYPE_CONFIRM_EDIT_SG_VALUES 19 +#define IEC61850_SERVICE_TYPE_GET_EDIT_SG_VALUE 20 +#define IEC61850_SERVICE_TYPE_GET_SGCB_VALUES 21 +#define IEC61850_SERVICE_TYPE_REPORT 22 +#define IEC61850_SERVICE_TYPE_GET_BRCB_VALUES 23 +#define IEC61850_SERVICE_TYPE_SET_BRCB_VALUES 24 +#define IEC61850_SERVICE_TYPE_GET_URCB_VALUES 25 +#define IEC61850_SERVICE_TYPE_SET_URCB_VALUES 26 +#define IEC61850_SERVICE_TYPE_GET_LCB_VALUES 27 +#define IEC61850_SERVICE_TYPE_SET_LCB_VALUES 28 +#define IEC61850_SERVICE_TYPE_QUERY_LOG_BY_TIME 29 +#define IEC61850_SERVICE_TYPE_QUERY_LOG_AFTER 30 +#define IEC61850_SERVICE_TYPE_GET_LOG_STATUS 31 +#define IEC61850_SERVICE_TYPE_SEND_GOOSE_MESSAGE 32 +#define IEC61850_SERVICE_TYPE_GET_GOCB_VALUES 33 +#define IEC61850_SERVICE_TYPE_SET_GOCB_VALUES 34 +#define IEC61850_SERVICE_TYPE_GET_GO_REFERENCE 35 +#define IEC61850_SERVICE_TYPE_GET_GOOSE_ELEMENT_NUMBER 36 +#define IEC61850_SERVICE_TYPE_SEND_MSV_MESSAGE 37 +#define IEC61850_SERVICE_TYPE_GET_MSVCB_VALUES 38 +#define IEC61850_SERVICE_TYPE_SET_MSVCB_VALUES 39 +#define IEC61850_SERVICE_TYPE_SEND_USV_MESSAGE 40 +#define IEC61850_SERVICE_TYPE_GET_USVCB_VALUES 41 +#define IEC61850_SERVICE_TYPE_SET_USVCB_VALUES 42 +#define IEC61850_SERVICE_TYPE_SELECT 43 +#define IEC61850_SERVICE_TYPE_SELECT_WITH_VALUES 44 +#define IEC61850_SERVICE_TYPE_CANCEL 45 +#define IEC61850_SERVICE_TYPE_OPERATE 46 +#define IEC61850_SERVICE_TYPE_COMMAND_TERMINATION 47 +#define IEC61850_SERVICE_TYPE_TIME_ACTIVATED_OPERATE 48 +#define IEC61850_SERVICE_TYPE_GET_FILE 49 +#define IEC61850_SERVICE_TYPE_SET_FILE 50 +#define IEC61850_SERVICE_TYPE_DELETE_FILE 51 +#define IEC61850_SERVICE_TYPE_GET_FILE_ATTRIBUTE_VALUES 52 +#define IEC61850_SERVICE_TYPE_TIME_SYNCHRONISATION 53 +#define IEC61850_SERVICE_TYPE_INTERNAL_CHANGE 54 + +typedef int IEC61850_ServiceError; + +#define IEC61850_SERVICE_ERROR_NO_ERROR 0 +#define IEC61850_SERVICE_ERROR_INSTANCE_NOT_AVAILABLE 1 +#define IEC61850_SERVICE_ERROR_INSTANCE_IN_USE 2 +#define IEC61850_SERVICE_ERROR_ACCESS_VIOLATION 3 +#define IEC61850_SERVICE_ERROR_ACCESS_NOT_ALLOWED_IN_CURRENT_STATE 4 +#define IEC61850_SERVICE_ERROR_PARAMETER_VALUE_INAPPROPRIATE 5 +#define IEC61850_SERVICE_ERROR_PARAMETER_VALUE_INCONSISTENT 6 +#define IEC61850_SERVICE_ERROR_CLASS_NOT_SUPPORTED 7 +#define IEC61850_SERVICE_ERROR_INSTANCE_LOCKED_BY_OTHER_CLIENT 8 +#define IEC61850_SERVICE_ERROR_CONTROL_MUST_BE_SELECTED 9 +#define IEC61850_SERVICE_ERROR_TYPE_CONFLICT 10 +#define IEC61850_SERVICE_ERROR_FAILED_DUE_TO_COMMUNICATION_CONSTRAINT 11 +#define IEC61850_SERVICE_ERROR_FAILED_DUE_TO_SERVER_CONSTRAINT 12 + +typedef struct sServiceTrkInstance* ServiceTrkInstance; + +struct sServiceTrkInstance +{ + DataObject* dobj; + DataAttribute* objRef; + DataAttribute* serviceType; + DataAttribute* errorCode; + DataAttribute* originatorID; /* optional */ + DataAttribute* t; +}; + +typedef struct sBrcbTrkInstance* BrcbTrkInstance; + +struct sBrcbTrkInstance +{ + /* inherited from ServiceTrkInstance */ + DataObject* dobj; + DataAttribute* objRef; + DataAttribute* serviceType; + DataAttribute* errorCode; + DataAttribute* originatorID; /* optional */ + DataAttribute* t; + + /* BrcbTrk specific attributes */ + DataAttribute* rptID; + DataAttribute* rptEna; + DataAttribute* datSet; + DataAttribute* confRev; + DataAttribute* optFlds; + DataAttribute* bufTm; + DataAttribute* sqNum; + DataAttribute* trgOps; + DataAttribute* intgPd; + DataAttribute* gi; + DataAttribute* purgeBuf; + DataAttribute* entryID; + DataAttribute* timeOfEntry; + DataAttribute* resvTms; /* optional */ +}; + +typedef struct sUrcbTrkInstance* UrcbTrkInstance; + +struct sUrcbTrkInstance +{ + /* inherited from ServiceTrkInstance */ + DataObject* dobj; + DataAttribute* objRef; + DataAttribute* serviceType; + DataAttribute* errorCode; + DataAttribute* originatorID; /* optional */ + DataAttribute* t; + + /* UrcbTrk specific attributes */ + DataAttribute* rptID; + DataAttribute* rptEna; + DataAttribute* resv; + DataAttribute* datSet; + DataAttribute* confRev; + DataAttribute* optFlds; + DataAttribute* bufTm; + DataAttribute* sqNum; + DataAttribute* trgOps; + DataAttribute* intgPd; + DataAttribute* gi; +}; + +typedef struct sGocbTrkInstance* GocbTrkInstance; + +struct sGocbTrkInstance +{ + /* inherited from ServiceTrkInstance */ + DataObject* dobj; + DataAttribute* objRef; + DataAttribute* serviceType; + DataAttribute* errorCode; + DataAttribute* originatorID; /* optional */ + DataAttribute* t; + + /* GocbTrk specific attributes */ + DataAttribute* goEna; + DataAttribute* goID; + DataAttribute* datSet; + DataAttribute* confRev; + DataAttribute* ndsCom; + DataAttribute* dstAddress; +}; + +typedef struct sControlTrkInstance* ControlTrkInstance; + +struct sControlTrkInstance +{ + /* inherited from ServiceTrkInstance */ + DataObject* dobj; + DataAttribute* objRef; + DataAttribute* serviceType; + DataAttribute* errorCode; + DataAttribute* originatorID; /* optional */ + DataAttribute* t; + + /* CTS specific attributes */ + DataAttribute* ctlVal; + DataAttribute* operTm; /* conditional */ + DataAttribute* origin; + DataAttribute* ctlNum; + DataAttribute* T; + DataAttribute* Test; + DataAttribute* Check; + DataAttribute* respAddCause; +}; + +typedef struct sSgcbTrkInstance* SgcbTrkInstance; + +struct sSgcbTrkInstance +{ + /* inherited from ServiceTrkInstance */ + DataObject* dobj; + DataAttribute* objRef; + DataAttribute* serviceType; + DataAttribute* errorCode; + DataAttribute* originatorID; /* optional */ + DataAttribute* t; + + /* SgcbTrk specific attributes */ + DataAttribute* numOfSG; + DataAttribute* actSG; + DataAttribute* editSG; + DataAttribute* cnfEdit; + DataAttribute* lActTm; +}; + +typedef struct sLocbTrkInstance* LocbTrkInstance; + +struct sLocbTrkInstance +{ + /* inherited from ServiceTrkInstance */ + DataObject* dobj; + DataAttribute* objRef; + DataAttribute* serviceType; + DataAttribute* errorCode; + DataAttribute* originatorID; /* optional */ + DataAttribute* t; + + /* LocbTrk specific attributes */ + DataAttribute* logEna; + DataAttribute* datSet; + DataAttribute* trgOps; + DataAttribute* intgPd; + DataAttribute* logRef; +}; + +#endif /* (CONFIG_IEC61850_SERVICE_TRACKING == 1) */ + +struct sMmsMapping { + IedModel* model; + MmsDevice* mmsDevice; + MmsServer mmsServer; + LinkedList reportControls; + +#if (CONFIG_IEC61850_LOG_SERVICE == 1) + LinkedList logControls; + LinkedList logInstances; +#endif + +#if (CONFIG_INCLUDE_GOOSE_SUPPORT == 1) + bool useIntegratedPublisher; + + LinkedList gseControls; + char* gooseInterfaceId; + + GoCBEventHandler goCbHandler; + void* goCbHandlerParameter; +#endif + +#if (CONFIG_IEC61850_SAMPLED_VALUES_SUPPORT == 1) + LinkedList svControls; + const char* svInterfaceId; +#endif + + LinkedList controlObjects; + uint64_t nextControlTimeout; /* next timeout in one of the control state machines */ + + LinkedList attributeAccessHandlers; + +#if (CONFIG_IEC61850_SUPPORT_USER_READ_ACCESS_CONTROL == 1) + ReadAccessHandler readAccessHandler; + void* readAccessHandlerParameter; +#endif + +#if (CONFIG_IEC61850_SETTING_GROUPS == 1) + bool allowEditSg; + LinkedList settingGroups; +#endif + +#if (CONFIG_MMS_THREADLESS_STACK != 1) + bool reportThreadRunning; + Thread reportWorkerThread; +#endif + +#if (CONFIG_IEC61850_SERVICE_TRACKING == 1) + BrcbTrkInstance brcbTrk; + UrcbTrkInstance urcbTrk; + GocbTrkInstance gocbTrk; + ControlTrkInstance spcTrk; + ControlTrkInstance dpcTrk; + ControlTrkInstance incTrk; + ControlTrkInstance encTrk1; + ControlTrkInstance apcFTrk; + ControlTrkInstance apcIntTrk; + ControlTrkInstance bscTrk; + ControlTrkInstance iscTrk; + ControlTrkInstance bacTrk; + SgcbTrkInstance sgcbTrk; + ServiceTrkInstance genTrk; + LocbTrkInstance locbTrk; +#endif /* (CONFIG_IEC61850_SERVICE_TRACKING == 1) */ + + /* flag indicates if data model is locked --> prevents reports to be sent */ + + bool isModelLocked; + +#if (CONFIG_MMS_THREADLESS_STACK != 1) + Semaphore isModelLockedMutex; +#endif /* (CONFIG_MMS_THREADLESS_STACK != 1) */ + + IedServer iedServer; + + IedConnectionIndicationHandler connectionIndicationHandler; + void* connectionIndicationHandlerParameter; + + IedServer_RCBEventHandler rcbEventHandler; + void* rcbEventHandlerParameter; + + IedServer_DataSetAccessHandler dataSetAccessHandler; + void* dataSetAccessHandlerParameter; + + IedServer_DirectoryAccessHandler directoryAccessHandler; + void* directoryAccessHandlerParameter; + + IedServer_ListObjectsAccessHandler listObjectsAccessHandler; + void* listObjectsAccessHandlerParameter; + + IedServer_ControlBlockAccessHandler controlBlockAccessHandler; + void* controlBlockAccessHandlerParameter; +}; + +#endif /* MMS_MAPPING_INTERNAL_H_ */ diff --git a/src/mms/iso_mms/asn1c/asn_system.h b/src/mms/iso_mms/asn1c/asn_system.h index 1292707c0..0cc5539ba 100644 --- a/src/mms/iso_mms/asn1c/asn_system.h +++ b/src/mms/iso_mms/asn1c/asn_system.h @@ -1,122 +1,122 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -/* - * Miscellaneous system-dependent types. - */ -#ifndef _ASN_SYSTEM_H_ -#define _ASN_SYSTEM_H_ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include /* For snprintf(3) */ -#include /* For *alloc(3) */ -#include /* For memcpy(3) */ - -#include "stack_config.h" -#include "libiec61850_platform_includes.h" -#if CONFIG_INCLUDE_PLATFORM_SPECIFIC_HEADERS -#include "libiec61850_platform_specific.h" -#else -#include /* For size_t */ -#endif - -#include /* For va_start */ -#include /* for offsetof and ptrdiff_t */ - - - -#ifdef _WIN32 -#ifndef WIN32 -#define WIN32 -#endif -#endif - -#ifdef WIN32 - -#include -#include -#define snprintf _snprintf -#define vsnprintf _vsnprintf - -#ifdef _MSC_VER /* MSVS.Net */ -#ifndef __cplusplus -#define inline __inline -#endif -#define ssize_t SSIZE_T -#if 0 -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#endif -#define WIN32_LEAN_AND_MEAN -#include -#include -#define isnan _isnan -#define finite _finite -#define copysign _copysign -#define ilogb _logb -#endif /* _MSC_VER */ - -#else /* !WIN32 */ - -#if defined(__vxworks) -#include -#else /* !defined(__vxworks) */ - -#include /* C99 specifies this file */ -/* - * 1. Earlier FreeBSD version didn't have , - * but was present. - * 2. Sun Solaris requires for alloca(3), - * but does not have . - */ -#if (!defined(__FreeBSD__) || !defined(_SYS_INTTYPES_H_)) -#if defined(sun) -#include /* For alloca(3) */ -#include /* for finite(3) */ -#elif defined(__hpux) -#ifdef __GNUC__ -#include /* For alloca(3) */ -#else /* !__GNUC__ */ -#define inline -#endif /* __GNUC__ */ -#else -#include /* SUSv2+ and C99 specify this file, for uintXX_t */ -#endif /* defined(sun) */ -#endif - -#endif /* defined(__vxworks) */ - -#endif /* WIN32 */ - -#if __GNUC__ >= 3 -#ifndef GCC_PRINTFLIKE -#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) -#endif -#else -#ifndef GCC_PRINTFLIKE -#define GCC_PRINTFLIKE(fmt,var) /* nothing */ -#endif -#endif - -#ifndef offsetof /* If not defined by */ -#define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0)) -#endif /* offsetof */ - -#ifndef MIN /* Suitable for comparing primitive types (integers) */ -#if defined(__GNUC__) -#define MIN(a,b) ({ __typeof a _a = a; __typeof b _b = b; \ - ((_a)<(_b)?(_a):(_b)); }) -#else /* !__GNUC__ */ -#define MIN(a,b) ((a)<(b)?(a):(b)) /* Unsafe variant */ -#endif /* __GNUC__ */ -#endif /* MIN */ - -#endif /* _ASN_SYSTEM_H_ */ +/*- + * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +/* + * Miscellaneous system-dependent types. + */ +#ifndef _ASN_SYSTEM_H_ +#define _ASN_SYSTEM_H_ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include /* For snprintf(3) */ +#include /* For *alloc(3) */ +#include /* For memcpy(3) */ + +#include "stack_config.h" +#include "libiec61850_platform_includes.h" +#if CONFIG_INCLUDE_PLATFORM_SPECIFIC_HEADERS +#include "libiec61850_platform_specific.h" +#else +#include /* For size_t */ +#endif + +#include /* For va_start */ +#include /* for offsetof and ptrdiff_t */ + + + +#ifdef _WIN32 +#ifndef WIN32 +#define WIN32 +#endif +#endif + +#ifdef WIN32 + +#include +#include +#define snprintf _snprintf +#define vsnprintf _vsnprintf + +#ifdef _MSC_VER /* MSVS.Net */ +#ifndef __cplusplus +#define inline __inline +#endif +#define ssize_t SSIZE_T +#if 0 +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#endif +#define WIN32_LEAN_AND_MEAN +#include +#include +#define isnan _isnan +#define finite _finite +#define copysign _copysign +#define ilogb _logb +#endif /* _MSC_VER */ + +#else /* !WIN32 */ + +#if defined(__vxworks) +#include +#else /* !defined(__vxworks) */ + +#include /* C99 specifies this file */ +/* + * 1. Earlier FreeBSD version didn't have , + * but was present. + * 2. Sun Solaris requires for alloca(3), + * but does not have . + */ +#if (!defined(__FreeBSD__) || !defined(_SYS_INTTYPES_H_)) +#if defined(sun) +#include /* For alloca(3) */ +#include /* for finite(3) */ +#elif defined(__hpux) +#ifdef __GNUC__ +#include /* For alloca(3) */ +#else /* !__GNUC__ */ +#define inline +#endif /* __GNUC__ */ +#else +#include /* SUSv2+ and C99 specify this file, for uintXX_t */ +#endif /* defined(sun) */ +#endif + +#endif /* defined(__vxworks) */ + +#endif /* WIN32 */ + +#if __GNUC__ >= 3 +#ifndef GCC_PRINTFLIKE +#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) +#endif +#else +#ifndef GCC_PRINTFLIKE +#define GCC_PRINTFLIKE(fmt,var) /* nothing */ +#endif +#endif + +#ifndef offsetof /* If not defined by */ +#define offsetof(s, m) ((ptrdiff_t)&(((s *)0)->m) - (ptrdiff_t)((s *)0)) +#endif /* offsetof */ + +#ifndef MIN /* Suitable for comparing primitive types (integers) */ +#if defined(__GNUC__) +#define MIN(a,b) ({ __typeof a _a = a; __typeof b _b = b; \ + ((_a)<(_b)?(_a):(_b)); }) +#else /* !__GNUC__ */ +#define MIN(a,b) ((a)<(b)?(a):(b)) /* Unsafe variant */ +#endif /* __GNUC__ */ +#endif /* MIN */ + +#endif /* _ASN_SYSTEM_H_ */ diff --git a/src/mms/iso_mms/asn1c/xer_encoder.h b/src/mms/iso_mms/asn1c/xer_encoder.h index 56aafa002..1dc74a09d 100644 --- a/src/mms/iso_mms/asn1c/xer_encoder.h +++ b/src/mms/iso_mms/asn1c/xer_encoder.h @@ -1,61 +1,61 @@ -/*- - * Copyright (c) 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#ifndef _XER_ENCODER_H_ -#define _XER_ENCODER_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct asn_TYPE_descriptor_s; /* Forward declaration */ - -/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ -enum xer_encoder_flags_e { - /* Mode of encoding */ - XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ - XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ -}; - -/* - * The XER encoder of any type. May be invoked by the application. - */ -LIB61850_INTERNAL -asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, - void *app_key /* Arbitrary callback argument */ - ); - -/* - * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) - * output into the chosen file pointer. - * RETURN VALUES: - * 0: The structure is printed. - * -1: Problem printing the structure. - * WARNING: No sensible errno value is returned. - */ -LIB61850_INTERNAL -int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); - -/* - * Type of the generic XER encoder. - */ -typedef asn_enc_rval_t (xer_type_encoder_f)( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ - int ilevel, /* Level of indentation */ - enum xer_encoder_flags_e xer_flags, - asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ - void *app_key /* Arbitrary callback argument */ - ); - -#ifdef __cplusplus -} -#endif - -#endif /* _XER_ENCODER_H_ */ +/*- + * Copyright (c) 2004 Lev Walkin . All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef _XER_ENCODER_H_ +#define _XER_ENCODER_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct asn_TYPE_descriptor_s; /* Forward declaration */ + +/* Flags used by the xer_encode() and (*xer_type_encoder_f), defined below */ +enum xer_encoder_flags_e { + /* Mode of encoding */ + XER_F_BASIC = 0x01, /* BASIC-XER (pretty-printing) */ + XER_F_CANONICAL = 0x02 /* Canonical XER (strict rules) */ +}; + +/* + * The XER encoder of any type. May be invoked by the application. + */ +LIB61850_INTERNAL +asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key /* Arbitrary callback argument */ + ); + +/* + * The variant of the above function which dumps the BASIC-XER (XER_F_BASIC) + * output into the chosen file pointer. + * RETURN VALUES: + * 0: The structure is printed. + * -1: Problem printing the structure. + * WARNING: No sensible errno value is returned. + */ +LIB61850_INTERNAL +int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr); + +/* + * Type of the generic XER encoder. + */ +typedef asn_enc_rval_t (xer_type_encoder_f)( + struct asn_TYPE_descriptor_s *type_descriptor, + void *struct_ptr, /* Structure to be encoded */ + int ilevel, /* Level of indentation */ + enum xer_encoder_flags_e xer_flags, + asn_app_consume_bytes_f *consume_bytes_cb, /* Callback */ + void *app_key /* Arbitrary callback argument */ + ); + +#ifdef __cplusplus +} +#endif + +#endif /* _XER_ENCODER_H_ */ diff --git a/tools/model_generator/complexModel.icd b/tools/model_generator/complexModel.icd index 6a8104045..02d609a65 100644 --- a/tools/model_generator/complexModel.icd +++ b/tools/model_generator/complexModel.icd @@ -1,340 +1,340 @@ - - -
- - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - - - - - - - status-only - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - status-only - - - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - - - rad - sr - m - Gy - q - °C - Sv - F - C - S - H - V - kg - ohm - J - N - Hz - Ix - Lm - Wb - T - W - Pa - s - m² - m³ - m/s - m/s² - m³/s - m/m³ - M - kg/m³ - m²/s - A - W/m K - J/K - ppm - 1/s - rad/s - K - VA - Watts - VAr - theta - cos(theta) - Vs - V² - As - A² - mol - A²t - VAh - Wh - VArh - V/Hz - cd - deg - - - Yocto - Zepto - Atto - Femto - Pico - Nano - Micro - Milli - Centi - Deci - zeroNoValue - Deca - Hecto - Kilo - Mega - Giga - Tera - Petra - Exa - Zetta - Yotta - - - normal - high - low - high-high - low-low - - - + + +
+ + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + + + + + + + status-only + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + + + rad + sr + m + Gy + q + °C + Sv + F + C + S + H + V + kg + ohm + J + N + Hz + Ix + Lm + Wb + T + W + Pa + s + m² + m³ + m/s + m/s² + m³/s + m/m³ + M + kg/m³ + m²/s + A + W/m K + J/K + ppm + 1/s + rad/s + K + VA + Watts + VAr + theta + cos(theta) + Vs + V² + As + A² + mol + A²t + VAh + Wh + VArh + V/Hz + cd + deg + + + Yocto + Zepto + Atto + Femto + Pico + Nano + Micro + Milli + Centi + Deci + zeroNoValue + Deca + Hecto + Kilo + Mega + Giga + Tera + Petra + Exa + Zetta + Yotta + + + normal + high + low + high-high + low-low + + + diff --git a/tools/model_generator/genericIO.icd b/tools/model_generator/genericIO.icd index 79df37129..87a59baa4 100644 --- a/tools/model_generator/genericIO.icd +++ b/tools/model_generator/genericIO.icd @@ -1,143 +1,143 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - status-only - - - - - status-only - - - - - status-only - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + status-only + + + + + status-only + + + + + status-only + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + diff --git a/tools/model_generator/inverter3ph.icd b/tools/model_generator/inverter3ph.icd index a5c951335..bad02dd98 100644 --- a/tools/model_generator/inverter3ph.icd +++ b/tools/model_generator/inverter3ph.icd @@ -1,181 +1,181 @@ - - -
- - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - 3 - - - - - - - status-only - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - + + +
+ + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + 3 + + + + + + + status-only + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + diff --git a/tools/model_generator/inverter_with_report.icd b/tools/model_generator/inverter_with_report.icd index 703c3c609..97f2f5740 100644 --- a/tools/model_generator/inverter_with_report.icd +++ b/tools/model_generator/inverter_with_report.icd @@ -1,270 +1,270 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - MegaSolar - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - - - rad - sr - m - Gy - q - °C - Sv - F - C - S - H - V - kg - ohm - J - N - Hz - Ix - Lm - Wb - T - W - Pa - s - m² - m³ - m/s - m/s² - m³/s - m/m³ - M - kg/m³ - m²/s - A - W/m K - J/K - ppm - 1/s - rad/s - K - VA - Watts - VAr - theta - cos(theta) - Vs - V² - As - A² - mol - A²t - VAh - Wh - VArh - V/Hz - cd - deg - - - Yocto - Zepto - Atto - Femto - Pico - Nano - Micro - Milli - Centi - Deci - zeroNoValue - Deca - Hecto - Kilo - Mega - Giga - Tera - Petra - Exa - Zetta - Yotta - - - normal - high - low - high-high - low-low - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + MegaSolar + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + + + rad + sr + m + Gy + q + °C + Sv + F + C + S + H + V + kg + ohm + J + N + Hz + Ix + Lm + Wb + T + W + Pa + s + m² + m³ + m/s + m/s² + m³/s + m/m³ + M + kg/m³ + m²/s + A + W/m K + J/K + ppm + 1/s + rad/s + K + VA + Watts + VAr + theta + cos(theta) + Vs + V² + As + A² + mol + A²t + VAh + Wh + VArh + V/Hz + cd + deg + + + Yocto + Zepto + Atto + Femto + Pico + Nano + Micro + Milli + Centi + Deci + zeroNoValue + Deca + Hecto + Kilo + Mega + Giga + Tera + Petra + Exa + Zetta + Yotta + + + normal + high + low + high-high + low-low + + + diff --git a/tools/model_generator/manifest-dynamic.mf b/tools/model_generator/manifest-dynamic.mf index 371d3ca0b..1175fc275 100644 --- a/tools/model_generator/manifest-dynamic.mf +++ b/tools/model_generator/manifest-dynamic.mf @@ -1,2 +1,2 @@ -Manifest-Version: 1.0 -Main-Class: com.libiec61850.tools.DynamicModelGenerator +Manifest-Version: 1.0 +Main-Class: com.libiec61850.tools.DynamicModelGenerator diff --git a/tools/model_generator/manifest-dyncCode.mf b/tools/model_generator/manifest-dyncCode.mf index 9fba372e7..55a6f0a01 100644 --- a/tools/model_generator/manifest-dyncCode.mf +++ b/tools/model_generator/manifest-dyncCode.mf @@ -1,2 +1,2 @@ -Manifest-Version: 1.0 -Main-Class: com.libiec61850.tools.DynamicCodeGenerator +Manifest-Version: 1.0 +Main-Class: com.libiec61850.tools.DynamicCodeGenerator diff --git a/tools/model_generator/manifest-modelviewer.mf b/tools/model_generator/manifest-modelviewer.mf index dd837e701..35aa94f9b 100644 --- a/tools/model_generator/manifest-modelviewer.mf +++ b/tools/model_generator/manifest-modelviewer.mf @@ -1,2 +1,2 @@ -Manifest-Version: 1.0 -Main-Class: com.libiec61850.tools.ModelViewer +Manifest-Version: 1.0 +Main-Class: com.libiec61850.tools.ModelViewer diff --git a/tools/model_generator/manifest.mf b/tools/model_generator/manifest.mf index 78ab5c164..071ccd44f 100644 --- a/tools/model_generator/manifest.mf +++ b/tools/model_generator/manifest.mf @@ -1,2 +1,2 @@ -Manifest-Version: 1.0 -Main-Class: com.libiec61850.tools.StaticModelGenerator +Manifest-Version: 1.0 +Main-Class: com.libiec61850.tools.StaticModelGenerator diff --git a/tools/model_generator/sampleModel.icd b/tools/model_generator/sampleModel.icd index 06ec956e2..a2279f833 100644 --- a/tools/model_generator/sampleModel.icd +++ b/tools/model_generator/sampleModel.icd @@ -1,171 +1,171 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - status-only - - - - - - - status-only - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - + + +
+ + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + diff --git a/tools/model_generator/sampleModel_errors.icd b/tools/model_generator/sampleModel_errors.icd index b4bd445aa..a96e7f7a0 100644 --- a/tools/model_generator/sampleModel_errors.icd +++ b/tools/model_generator/sampleModel_errors.icd @@ -1,171 +1,171 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - status-only - - - - - - - status-only - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - + + +
+ + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + diff --git a/tools/model_generator/sampleModel_with_dataset.icd b/tools/model_generator/sampleModel_with_dataset.icd index 50e240976..82df99ec6 100644 --- a/tools/model_generator/sampleModel_with_dataset.icd +++ b/tools/model_generator/sampleModel_with_dataset.icd @@ -1,208 +1,208 @@ - - -
- - - - -
-

1,1,9999,1

-

12

-

00000001

-

0001

-

0001

-

127.0.0.1

-
- -
-

111

-

4

-

01-0c-cd-01-00-01

-

1000

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - - - status-only - - - - - - - status-only - - - - - - - status-only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - + + +
+ + + + +
+

1,1,9999,1

+

12

+

00000001

+

0001

+

0001

+

127.0.0.1

+
+ +
+

111

+

4

+

01-0c-cd-01-00-01

+

1000

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + status-only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + diff --git a/tools/model_generator/simpleIO_direct_control_goose.scd b/tools/model_generator/simpleIO_direct_control_goose.scd index 03017bf88..90e581902 100644 --- a/tools/model_generator/simpleIO_direct_control_goose.scd +++ b/tools/model_generator/simpleIO_direct_control_goose.scd @@ -1,252 +1,252 @@ - - -
-
- - - Station bus - 10 - -
-

10.0.0.2

-

255.255.255.0

-

10.0.0.1

-

0001

-

00000001

-

0001

-
- -
-

111

-

4

-

01-0c-cd-01-00-01

-

1000

-
-
- -
-

111

-

4

-

01-0c-cd-01-00-02

-

1000

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - - - - - - - - status-only - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - direct-with-normal-security - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - status-only - direct-with-normal-security - sbo-with-normal-security - direct-with-enhanced-security - sbo-with-enhanced-security - - - not-supported - bay-control - station-control - remote-control - automatic-bay - automatic-station - automatic-remote - maintenance - process - - -
+ + +
+
+ + + Station bus + 10 + +
+

10.0.0.2

+

255.255.255.0

+

10.0.0.1

+

0001

+

00000001

+

0001

+
+ +
+

111

+

4

+

01-0c-cd-01-00-01

+

1000

+
+
+ +
+

111

+

4

+

01-0c-cd-01-00-02

+

1000

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + + + + + + + + status-only + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + direct-with-normal-security + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + status-only + direct-with-normal-security + sbo-with-normal-security + direct-with-enhanced-security + sbo-with-enhanced-security + + + not-supported + bay-control + station-control + remote-control + automatic-bay + automatic-station + automatic-remote + maintenance + process + + +