Added various dotnet methods required for server configuration (#216)

- Added the ability to set/read URCB buffer size in dotnet.
-  Added IedServer_getNumberOfOpenConnections, ClientConnection_getLocalAddress and server identity methods for dotnet.
Co-authored-by: Andrew Moorcroft <andrew.moorcroft@nortechonline.co.uk>
pull/228/head
andy1547 6 years ago committed by GitHub
parent 29efa333f8
commit ff53028ec4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -837,6 +837,9 @@ namespace IEC61850
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ClientConnection_getPeerAddress(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ClientConnection_getLocalAddress(IntPtr self);
internal IntPtr self;
internal ClientConnection (IntPtr self) {
@ -852,6 +855,16 @@ namespace IEC61850
else
return null;
}
public string GetLocalAddress()
{
IntPtr localAddrPtr = ClientConnection_getLocalAddress(self);
if (localAddrPtr != IntPtr.Zero)
return Marshal.PtrToStringAnsi(localAddrPtr);
else
return null;
}
}
/// <summary>
@ -1065,6 +1078,9 @@ namespace IEC61850
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool IedServer_isRunning(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern int IedServer_getNumberOfOpenConnections(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedServer_lockDataModel(IntPtr self);
@ -1395,6 +1411,15 @@ namespace IEC61850
return IedServer_isRunning(self);
}
/// <summary>
/// Get number of open MMS connections
/// </summary>
/// <returns>the number of open and accepted MMS connections</returns>
public int GetNumberOfOpenConnections()
{
return IedServer_getNumberOfOpenConnections(self);
}
private ControlHandlerInfo GetControlHandlerInfo(DataObject controlObject)
{
ControlHandlerInfo info;

@ -44,6 +44,12 @@ namespace IEC61850.Server
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern int IedServerConfig_getReportBufferSize(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedServerConfig_setReportBufferSizeForURCBs(IntPtr self, int reportBufferSize);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern int IedServerConfig_getReportBufferSizeForURCBs(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedServerConfig_setFileServiceBasePath(IntPtr self, string basepath);
@ -122,6 +128,22 @@ namespace IEC61850.Server
}
}
/// <summary>
/// Gets or sets the size of the report buffer for unbuffered report control blocks
/// </summary>
/// <value>The size of the report buffer.</value>
public int ReportBufferSizeForURCBs
{
get
{
return IedServerConfig_getReportBufferSizeForURCBs(self);
}
set
{
IedServerConfig_setReportBufferSizeForURCBs(self, value);
}
}
/// <summary>
/// Gets or sets the file service base path.
/// </summary>

Loading…
Cancel
Save