Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
1,092 changes: 546 additions & 546 deletions demos/beaglebone/beagle_demo.icd

Large diffs are not rendered by default.

1,092 changes: 546 additions & 546 deletions demos/beaglebone/beagle_demo.iid

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions dotnet/IEC61850forCSharp/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ namespace Common {

/// <summary>
/// Control model
/// </summary>
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
/// </summary>
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
}

/// <summary>
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand All @@ -178,17 +178,17 @@ 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);

[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
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;

Expand All @@ -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);
Expand Down Expand Up @@ -525,8 +525,8 @@ public UInt32 SelectAsync(ControlActionHandler handler, object parameter)

Tuple<ControlActionHandler, object> callbackInfo = Tuple.Create(handler, parameter);

GCHandle handle = GCHandle.Alloc(callbackInfo);
GCHandle handle = GCHandle.Alloc(callbackInfo);

if (internalOperateHandler == null)
internalOperateHandler = new ControlObjectClient_ControlActionHandler(nativeOperateHandler);

Expand Down Expand Up @@ -775,7 +775,7 @@ public void Dispose() {
Dispose (true);
}

~ControlObject()
~ControlObject()
{
Dispose (false);
}
Expand Down
102 changes: 51 additions & 51 deletions dotnet/IEC61850forCSharp/IEC61850.NET.csproj
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C35D624E-5506-4560-8074-1728F1FA1A4D}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>iec61850dotnet</RootNamespace>
<AssemblyName>iec61850dotnet</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="MmsValue.cs" />
<Compile Include="DataSet.cs" />
<Compile Include="ReportControlBlock.cs" />
<Compile Include="IEC61850ClientAPI.cs" />
<Compile Include="Reporting.cs" />
<Compile Include="Control.cs" />
<Compile Include="IsoConnectionParameters.cs" />
<Compile Include="MmsVariableSpecification.cs" />
<Compile Include="IEC61850ServerAPI.cs" />
<Compile Include="IEC61850CommonAPI.cs" />
<Compile Include="TLS.cs" />
<Compile Include="SampledValuesControlBlock.cs" />
<Compile Include="GooseControlBlock.cs" />
<Compile Include="GooseSubscriber.cs" />
<Compile Include="SampledValuesSubscriber.cs" />
<Compile Include="IedServerConfig.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C35D624E-5506-4560-8074-1728F1FA1A4D}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>iec61850dotnet</RootNamespace>
<AssemblyName>iec61850dotnet</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="MmsValue.cs" />
<Compile Include="DataSet.cs" />
<Compile Include="ReportControlBlock.cs" />
<Compile Include="IEC61850ClientAPI.cs" />
<Compile Include="Reporting.cs" />
<Compile Include="Control.cs" />
<Compile Include="IsoConnectionParameters.cs" />
<Compile Include="MmsVariableSpecification.cs" />
<Compile Include="IEC61850ServerAPI.cs" />
<Compile Include="IEC61850CommonAPI.cs" />
<Compile Include="TLS.cs" />
<Compile Include="SampledValuesControlBlock.cs" />
<Compile Include="GooseControlBlock.cs" />
<Compile Include="GooseSubscriber.cs" />
<Compile Include="SampledValuesSubscriber.cs" />
<Compile Include="IedServerConfig.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
78 changes: 39 additions & 39 deletions dotnet/IEC61850forCSharp/MmsValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
using System.Runtime.InteropServices;
using System.Collections.Generic;

using System.Collections;
using System.Collections;
using System.Text;

namespace IEC61850
Expand All @@ -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);

Expand All @@ -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);

Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -261,9 +261,9 @@ public MmsValue (long value)
/// Create a new <see cref="IEC61850.Common.MmsValue"/> instance of type MMS_VISIBLE_STRING.
/// </summary>
/// <param name="value">Value.</param>
public MmsValue (string value)
{
valueReference = MmsValue_newVisibleString(value);
public MmsValue (string value)
{
valueReference = MmsValue_newVisibleString(value);
}

public void Dispose()
Expand Down Expand Up @@ -818,8 +818,8 @@ public Int32 ToInt32 ()
throw new MmsValueException ("Value type is not integer");

return MmsValue_toInt32 (valueReference);
}
}

/// <summary>
/// Sets the 32 bit signed integer.
/// </summary>
Expand All @@ -833,8 +833,8 @@ public void SetInt32(int value)
throw new MmsValueException("Value type is not integer");

MmsValue_setInt32(valueReference, value);
}
}

/// <summary>
/// Return the value as 64 bit signed integer.
/// </summary>
Expand Down Expand Up @@ -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();
}

/// <summary>
Expand All @@ -954,8 +954,8 @@ public bool GetBoolean ()
return MmsValue_getBoolean (valueReference);
else
throw new MmsValueException ("Value type is not boolean");
}
}

/// <summary>
/// Sets the boolean value of an MMS_BOOLEAN instance
/// </summary>
Expand All @@ -969,8 +969,8 @@ public void SetBoolean(bool value)
throw new MmsValueException("Value type is not boolean");

MmsValue_setBoolean(valueReference, value);
}
}

/// <summary>
/// Gets the float value of an MMS_FLOAT instance
/// </summary>
Expand Down Expand Up @@ -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:
{
Expand Down
Loading