|
|
@ -837,6 +837,9 @@ namespace IEC61850
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
static extern IntPtr ClientConnection_getPeerAddress(IntPtr self);
|
|
|
|
static extern IntPtr ClientConnection_getPeerAddress(IntPtr self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
static extern IntPtr ClientConnection_getLocalAddress(IntPtr self);
|
|
|
|
|
|
|
|
|
|
|
|
internal IntPtr self;
|
|
|
|
internal IntPtr self;
|
|
|
|
|
|
|
|
|
|
|
|
internal ClientConnection (IntPtr self) {
|
|
|
|
internal ClientConnection (IntPtr self) {
|
|
|
@ -852,6 +855,16 @@ namespace IEC61850
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string GetLocalAddress()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
IntPtr localAddrPtr = ClientConnection_getLocalAddress(self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (localAddrPtr != IntPtr.Zero)
|
|
|
|
|
|
|
|
return Marshal.PtrToStringAnsi(localAddrPtr);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -1052,6 +1065,18 @@ namespace IEC61850
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
static extern void IedServer_setLocalIpAddress(IntPtr self, string localIpAddress);
|
|
|
|
static extern void IedServer_setLocalIpAddress(IntPtr self, string localIpAddress);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
static extern void MmsServer_setServerIdentity(IntPtr self, string vendorName, string modelName, string revision);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
static extern IntPtr MmsServer_getVendorName(IntPtr self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
static extern IntPtr MmsServer_getModelName(IntPtr self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
static extern IntPtr MmsServer_getRevision(IntPtr self);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
|
|
|
|
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
|
|
|
|
static extern void IedServer_start(IntPtr self, int tcpPort);
|
|
|
|
static extern void IedServer_start(IntPtr self, int tcpPort);
|
|
|
|
|
|
|
|
|
|
|
@ -1065,6 +1090,9 @@ namespace IEC61850
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
|
|
static extern bool IedServer_isRunning(IntPtr self);
|
|
|
|
static extern bool IedServer_isRunning(IntPtr self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
static extern int IedServer_getNumberOfOpenConnections(IntPtr self);
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
static extern void IedServer_lockDataModel(IntPtr self);
|
|
|
|
static extern void IedServer_lockDataModel(IntPtr self);
|
|
|
|
|
|
|
|
|
|
|
@ -1322,6 +1350,59 @@ namespace IEC61850
|
|
|
|
IedServer_setLocalIpAddress (self, localIpAddress);
|
|
|
|
IedServer_setLocalIpAddress (self, localIpAddress);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Sets the values that the server will give as response for an MMS identify request
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="vendorName">Vendor Name for VMD</param>
|
|
|
|
|
|
|
|
/// <param name="modelName">Model name for VMD</param>
|
|
|
|
|
|
|
|
/// <param name="revision">Revision for VMD</param>
|
|
|
|
|
|
|
|
public void SetServerIdentity(string vendorName, string modelName, string revision)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MmsServer_setServerIdentity(self, vendorName, modelName, revision);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets the Vendor Name attributed to the VMD
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns>Vendor Name</returns>
|
|
|
|
|
|
|
|
public string GetVendorName()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
IntPtr vendorNamePtr = MmsServer_getVendorName(self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (vendorNamePtr != IntPtr.Zero)
|
|
|
|
|
|
|
|
return Marshal.PtrToStringAnsi(vendorNamePtr);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets the Model Name attributed to the VMD
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns>Model Name</returns>
|
|
|
|
|
|
|
|
public string GetModelName()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
IntPtr modelNamePtr = MmsServer_getModelName(self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (modelNamePtr != IntPtr.Zero)
|
|
|
|
|
|
|
|
return Marshal.PtrToStringAnsi(modelNamePtr);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Gets the Revision attributed to the VMD
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns>Revision</returns>
|
|
|
|
|
|
|
|
public string GetRevision()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
IntPtr revisionPtr = MmsServer_getRevision(self);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (revisionPtr != IntPtr.Zero)
|
|
|
|
|
|
|
|
return Marshal.PtrToStringAnsi(revisionPtr);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Start MMS server
|
|
|
|
/// Start MMS server
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -1377,6 +1458,15 @@ namespace IEC61850
|
|
|
|
return IedServer_isRunning(self);
|
|
|
|
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)
|
|
|
|
private ControlHandlerInfo GetControlHandlerInfo(DataObject controlObject)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ControlHandlerInfo info;
|
|
|
|
ControlHandlerInfo info;
|
|
|
|