From 8f45ac88c6b14f51a85e4faadf21f0db73dd837b Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 6 May 2016 10:56:44 +0200 Subject: [PATCH] - added functions ControlObjectClient_setInterlockCheck and ControlObjectClient_setSynchroCheck to replace the functions ControlObjectClient_enableInterlockCheck and ControlObjectClient_enableSynchroCheck --- dotnet/IEC61850forCSharp/Control.cs | 32 ++++++++++++++++++++++------ dotnet/example3/Main.cs | 2 +- src/iec61850/client/client_control.c | 13 +++++++++++ src/iec61850/inc/iec61850_client.h | 24 +++++++++++++++++++++ src/vs/libiec61850-wo-goose.def | 2 ++ src/vs/libiec61850.def | 3 ++- 6 files changed, 67 insertions(+), 9 deletions(-) diff --git a/dotnet/IEC61850forCSharp/Control.cs b/dotnet/IEC61850forCSharp/Control.cs index cd425d88..f0faa906 100644 --- a/dotnet/IEC61850forCSharp/Control.cs +++ b/dotnet/IEC61850forCSharp/Control.cs @@ -137,11 +137,11 @@ namespace IEC61850 [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] private static extern void ControlObjectClient_setOrigin(IntPtr self, string orIdent, int orCat); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] - private static extern void ControlObjectClient_enableInterlockCheck(IntPtr self); + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + private static extern void ControlObjectClient_setInterlockCheck(IntPtr self, bool value); - [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] - private static extern void ControlObjectClient_enableSynchroCheck(IntPtr self); + [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] + private static extern void ControlObjectClient_setSynchroCheck(IntPtr self, bool value); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void InternalCommandTerminationHandler(IntPtr parameter,IntPtr controlClient); @@ -373,19 +373,37 @@ namespace IEC61850 /// /// Enables the synchro check for operate commands /// + [Obsolete("use SetSynchroCheck instead")] public void EnableSynchroCheck () { - ControlObjectClient_enableSynchroCheck(controlObject); + ControlObjectClient_setSynchroCheck (controlObject, true); } /// /// Enables the interlock check for operate and select commands /// - public void EnableInterlockCheck () + [Obsolete("use SetInterlockCheck instead")] + public void EnableInterlockCheck () { - ControlObjectClient_enableInterlockCheck(controlObject); + ControlObjectClient_setInterlockCheck (controlObject, true); } + /// + /// Sets the value of the interlock check flag for operate and select commands + /// + public void SetInterlockCheck (bool value) + { + ControlObjectClient_setInterlockCheck (controlObject, value); + } + + /// + /// Sets the value of the synchro check flag for operate command + /// + public void SetSynchroCheck (bool value) + { + ControlObjectClient_setSynchroCheck (controlObject, value); + } + /// /// Gets the last received LastApplError (Additional Cause Diagnostics) value. /// diff --git a/dotnet/example3/Main.cs b/dotnet/example3/Main.cs index 343efc8d..86fe0644 100644 --- a/dotnet/example3/Main.cs +++ b/dotnet/example3/Main.cs @@ -24,7 +24,7 @@ namespace example3 { IsoConnectionParameters parameters = con.GetConnectionParameters(); - parameters.SetRemoteAddresses(1,1, new byte[] {0x00, 0x01, 0x02, 0x03}); + parameters.SetRemoteAddresses(1, new byte[] {0x00, 0x01}, new byte[] {0x00, 0x01, 0x02, 0x03}); con.ConnectTimeout = 10000; diff --git a/src/iec61850/client/client_control.c b/src/iec61850/client/client_control.c index ce2823e0..d638c0a3 100644 --- a/src/iec61850/client/client_control.c +++ b/src/iec61850/client/client_control.c @@ -848,12 +848,25 @@ ControlObjectClient_enableInterlockCheck(ControlObjectClient self) self->interlockCheck = true; } +void +ControlObjectClient_setInterlockCheck(ControlObjectClient self, bool value) +{ + self->interlockCheck = value; +} + + void ControlObjectClient_enableSynchroCheck(ControlObjectClient self) { self->synchroCheck = true; } +void +ControlObjectClient_setSynchroCheck(ControlObjectClient self, bool value) +{ + self->synchroCheck = value; +} + void ControlObjectClient_setLastApplError(ControlObjectClient self, LastApplError lastApplError) { diff --git a/src/iec61850/inc/iec61850_client.h b/src/iec61850/inc/iec61850_client.h index ed5c8911..b5ce446c 100644 --- a/src/iec61850/inc/iec61850_client.h +++ b/src/iec61850/inc/iec61850_client.h @@ -1510,12 +1510,36 @@ ControlObjectClient_setOrigin(ControlObjectClient self, const char* orIdent, int void ControlObjectClient_useConstantT(ControlObjectClient self, bool useConstantT); +/** + * \deprecated use ControlObjectClient_setInterlockCheck instead + */ void ControlObjectClient_enableInterlockCheck(ControlObjectClient self); +/** + * \deprecated use ControlObjectClient_setSynchroCheck instead + */ void ControlObjectClient_enableSynchroCheck(ControlObjectClient self); +/** + * \brief Set the value of the interlock check flag when a control command is sent + * + * \param self the ControlObjectClient instance + * \param value if true the server will perform a interlock check if supported + */ +void +ControlObjectClient_setInterlockCheck(ControlObjectClient self, bool value); + +/** + * \brief Set the value of the synchro check flag when a control command is sent + * + * \param self the ControlObjectClient instance + * \param value if true the server will perform a synchro check if supported + */ +void +ControlObjectClient_setSynchroCheck(ControlObjectClient self, bool value); + /** * \brief Private a callback handler that is invoked when a command termination message is received. diff --git a/src/vs/libiec61850-wo-goose.def b/src/vs/libiec61850-wo-goose.def index 8354e2fa..ceaac212 100644 --- a/src/vs/libiec61850-wo-goose.def +++ b/src/vs/libiec61850-wo-goose.def @@ -523,4 +523,6 @@ EXPORTS MmsValue_getUtcTimeQuality MmsConnection_getMmsConnectionParameters IedServer_updateVisibleStringAttributeValue + ControlObjectClient_setInterlockCheck + ControlObjectClient_setSynchroCheck diff --git a/src/vs/libiec61850.def b/src/vs/libiec61850.def index 7ad6426e..45744181 100644 --- a/src/vs/libiec61850.def +++ b/src/vs/libiec61850.def @@ -600,4 +600,5 @@ EXPORTS MmsValue_getUtcTimeQuality MmsConnection_getMmsConnectionParameters IedServer_updateVisibleStringAttributeValue - + ControlObjectClient_setInterlockCheck + ControlObjectClient_setSynchroCheck