Merge branch 'development' of https://github.com/mz-automation/libiec61850 into development

pull/143/head
Michael Zillgith 8 years ago
commit 22d0f32b2f

@ -474,9 +474,9 @@ namespace IEC61850
public IntPtr self = IntPtr.Zero; public IntPtr self = IntPtr.Zero;
public ReportControlBlock(string name, LogicalNode parent, string rptId, bool isBuffered, public ReportControlBlock(string name, LogicalNode parent, string rptId, bool isBuffered,
string dataSetName, uint confRef, byte trgOps, byte options, uint bufTm, uint intgPd) string dataSetName, uint confRev, byte trgOps, byte options, uint bufTm, uint intgPd)
{ {
self = ReportControlBlock_create(name, parent.self, rptId, isBuffered, dataSetName, confRef, trgOps, options, bufTm, intgPd); self = ReportControlBlock_create(name, parent.self, rptId, isBuffered, dataSetName, confRev, trgOps, options, bufTm, intgPd);
} }
} }

@ -430,9 +430,13 @@ namespace IEC61850
public MmsDataAccessError GetDataAccessError () public MmsDataAccessError GetDataAccessError ()
{ {
int errorCode = MmsValue_getDataAccessError (valueReference); if (GetType () == MmsType.MMS_DATA_ACCESS_ERROR) {
int errorCode = MmsValue_getDataAccessError (valueReference);
return (MmsDataAccessError)errorCode; return (MmsDataAccessError)errorCode;
}
else
throw new MmsValueException ("Value is of wrong type");
} }
/// <summary> /// <summary>

@ -90,6 +90,11 @@ namespace IEC61850
self = TLSConfiguration_create (); self = TLSConfiguration_create ();
} }
~TLSConfiguration()
{
Dispose ();
}
internal IntPtr GetNativeInstance() internal IntPtr GetNativeInstance()
{ {
return self; return self;
@ -197,7 +202,12 @@ namespace IEC61850
public void Dispose() public void Dispose()
{ {
TLSConfiguration_destroy (self); lock (self) {
if (self != IntPtr.Zero) {
TLSConfiguration_destroy (self);
self = IntPtr.Zero;
}
}
} }
} }

@ -12,6 +12,7 @@
#include <string.h> #include <string.h>
#include "tls_api.h" #include "tls_api.h"
#include "tls_socket.h"
#include "hal_thread.h" #include "hal_thread.h"
#include "lib_memory.h" #include "lib_memory.h"
#include "linked_list.h" #include "linked_list.h"

@ -16,6 +16,7 @@
#define SRC_TLS_TLS_API_H_ #define SRC_TLS_TLS_API_H_
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

Loading…
Cancel
Save