- .NET API: added function IedServer.IgnoreClientRequests and IedServer.IgnoreReadAccess

pull/515/head
Michael Zillgith 1 year ago
parent 1add5fd7a0
commit 0b57f143b5

@ -557,7 +557,13 @@ namespace IEC61850
public delegate void StateChangedHandler(IedConnection connection, IedConnectionState newState); public delegate void StateChangedHandler(IedConnection connection, IedConnectionState newState);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedConnection_installStateChangedHandler(IntPtr connection, InternalStateChangedHandler handler, IntPtr parameter); static extern void IedConnection_installStateChangedHandler(IntPtr connection, InternalStateChangedHandler handler, IntPtr parameter);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedServer_ignoreReadAccess(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool ignore);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedServer_ignoreClientRequests(IntPtr self, [MarshalAs(UnmanagedType.I1)] bool ignore);
/********************* /*********************
* Async functions * Async functions
@ -1948,6 +1954,24 @@ namespace IEC61850
} }
} }
/// <summary>
/// Ignore all MMS requests from clients (for testing purposes)
/// </summary>
/// <param name="ignore">when true all requests from clients will be ignored</param>
public void IgnoreClientRequests(bool ignore)
{
IedServer_ignoreClientRequests(connection, ignore);
}
/// <summary>
/// Temporarily ignore read requests (for testing purposes)
/// </summary>
/// <param name="ignore">true to ignore read requests, false to handle read requests.</param>
public void IgnoreReadAccess(bool ignore)
{
IedServer_ignoreReadAccess(connection, ignore);
}
/// <summary> /// <summary>
/// Read the values of a data set (GetDataSetValues service). /// Read the values of a data set (GetDataSetValues service).
/// </summary> /// </summary>
@ -2981,6 +3005,19 @@ namespace IEC61850
IED_STATE_CLOSING = 3 IED_STATE_CLOSING = 3
} }
public static class IedClientErrorExtension
{
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr IedClientError_toString(int err);
public static string ToString(this IedClientError err)
{
string stringVal = Marshal.PtrToStringAnsi(IedClientError_toString((int)err));
return stringVal;
}
}
/// <summary> /// <summary>
/// Error codes for client side functions /// Error codes for client side functions
/// </summary> /// </summary>
@ -3066,6 +3103,9 @@ namespace IEC61850
/** Received an invalid response message from the server */ /** Received an invalid response message from the server */
IED_ERROR_MALFORMED_MESSAGE = 34, IED_ERROR_MALFORMED_MESSAGE = 34,
/** Service was not executed because required resource is still in use */
IED_ERROR_OBJECT_CONSTRAINT_CONFLICT = 35,
/** Service not implemented */ /** Service not implemented */
IED_ERROR_SERVICE_NOT_IMPLEMENTED = 98, IED_ERROR_SERVICE_NOT_IMPLEMENTED = 98,

Loading…
Cancel
Save