- some fixes

pull/6/head
Michael Zillgith 9 years ago
parent da21bb2e76
commit b8a4e8c7b0

@ -1,3 +1,8 @@
Changes to version 1.0.1
------------------------
- .NET API: fixed bug in client readValue functions
- .NET API: added MmsValue.GetDataAccessError() method
Changes to version 1.0.0 Changes to version 1.0.0
------------------------ ------------------------
- MMS client/server: implemented obtainFile service - MMS client/server: implemented obtainFile service

@ -266,7 +266,6 @@ namespace IEC61850
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)] [DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
static extern void MmsValue_delete (IntPtr self); static extern void MmsValue_delete (IntPtr self);
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)] [DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
static extern int MmsValue_getDataAccessError(IntPtr self); static extern int MmsValue_getDataAccessError(IntPtr self);

@ -49,6 +49,27 @@ namespace IEC61850
} }
} }
/// <summary>
/// MMS data access error for MmsValue type MMS_DATA_ACCESS_ERROR
/// </summary>
public enum MmsDataAccessError {
NO_RESPONSE = -2, /* for server internal purposes only! */
SUCCESS = -1,
OBJECT_INVALIDATED = 0,
HARDWARE_FAULT = 1,
TEMPORARILY_UNAVAILABLE = 2,
OBJECT_ACCESS_DENIED = 3,
OBJECT_UNDEFINED = 4,
INVALID_ADDRESS = 5,
TYPE_UNSUPPORTED = 6,
TYPE_INCONSISTENT = 7,
OBJECT_ATTRIBUTE_INCONSISTENT = 8,
OBJECT_ACCESS_UNSUPPORTED = 9,
OBJECT_NONE_EXISTENT = 10,
OBJECT_VALUE_INVALID = 11,
UNKNOWN = 12,
}
[Flags] [Flags]
public enum TriggerOptions { public enum TriggerOptions {
NONE = 0, NONE = 0,

@ -197,24 +197,6 @@ namespace IEC61850
ACCESS_POLICY_DENY = 1 ACCESS_POLICY_DENY = 1
} }
public enum MmsDataAccessError {
DATA_ACCESS_ERROR_NO_RESPONSE = -2, /* for server internal purposes only! */
DATA_ACCESS_ERROR_SUCCESS = -1,
DATA_ACCESS_ERROR_OBJECT_INVALIDATED = 0,
DATA_ACCESS_ERROR_HARDWARE_FAULT = 1,
DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE = 2,
DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED = 3,
DATA_ACCESS_ERROR_OBJECT_UNDEFINED = 4,
DATA_ACCESS_ERROR_INVALID_ADDRESS = 5,
DATA_ACCESS_ERROR_TYPE_UNSUPPORTED = 6,
DATA_ACCESS_ERROR_TYPE_INCONSISTENT = 7,
DATA_ACCESS_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT = 8,
DATA_ACCESS_ERROR_OBJECT_ACCESS_UNSUPPORTED = 9,
DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT = 10,
DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID = 11,
DATA_ACCESS_ERROR_UNKNOWN = 12
}
public enum DataAttributeType { public enum DataAttributeType {
BOOLEAN = 0, BOOLEAN = 0,
INT8 = 1, INT8 = 1,

@ -164,6 +164,9 @@ namespace IEC61850
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern ulong MmsValue_getBinaryTimeAsUtcMs (IntPtr self); static extern ulong MmsValue_getBinaryTimeAsUtcMs (IntPtr self);
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
static extern int MmsValue_getDataAccessError(IntPtr self);
internal IntPtr valueReference; /* reference to native MmsValue instance */ internal IntPtr valueReference; /* reference to native MmsValue instance */
private bool responsableForDeletion; /* if .NET wrapper is responsable for the deletion of the native MmsValue instance */ private bool responsableForDeletion; /* if .NET wrapper is responsable for the deletion of the native MmsValue instance */
@ -424,6 +427,14 @@ namespace IEC61850
throw new MmsValueException ("Value is of wrong type"); throw new MmsValueException ("Value is of wrong type");
} }
public MmsDataAccessError GetDataAccessError ()
{
int errorCode = MmsValue_getDataAccessError (valueReference);
return (MmsDataAccessError)errorCode;
}
/// <summary> /// <summary>
/// Gets the timestamp value as UTC time in s (UNIX time stamp). /// Gets the timestamp value as UTC time in s (UNIX time stamp).
/// </summary> /// </summary>

@ -257,14 +257,14 @@ namespace tests
iedServer.HandleWriteAccess (opDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) { iedServer.HandleWriteAccess (opDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) {
opDlTmmsValue = value.ToInt32(); opDlTmmsValue = value.ToInt32();
return MmsDataAccessError.DATA_ACCESS_ERROR_SUCCESS; return MmsDataAccessError.SUCCESS;
}, null); }, null);
iedServer.HandleWriteAccess (rsDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) { iedServer.HandleWriteAccess (rsDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) {
if (value.ToInt32() > 1000) if (value.ToInt32() > 1000)
return MmsDataAccessError.DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID; return MmsDataAccessError.OBJECT_VALUE_INVALID;
else else
return MmsDataAccessError.DATA_ACCESS_ERROR_SUCCESS; return MmsDataAccessError.SUCCESS;
}, null); }, null);
iedServer.Start (10002); iedServer.Start (10002);
@ -310,7 +310,7 @@ namespace tests
IedServer iedServer = new IedServer (iedModel); IedServer iedServer = new IedServer (iedModel);
iedServer.HandleWriteAccess (opDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) { iedServer.HandleWriteAccess (opDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) {
return MmsDataAccessError.DATA_ACCESS_ERROR_SUCCESS; return MmsDataAccessError.SUCCESS;
}, null); }, null);

@ -25,7 +25,7 @@ DA(configRev 0 20 5 0 0);
DA(ldNs 0 20 11 0 0); DA(ldNs 0 20 11 0 0);
} }
DS(Events){ DS(Events){
DE(GGIO1$ST$SPCSO1$stVal); DE(simpleIOGenericIO/GGIO1$ST$SPCSO1$stVal);
DE(GGIO1$ST$SPCSO2$stVal); DE(GGIO1$ST$SPCSO2$stVal);
DE(GGIO1$ST$SPCSO3$stVal); DE(GGIO1$ST$SPCSO3$stVal);
DE(GGIO1$ST$SPCSO4$stVal); DE(GGIO1$ST$SPCSO4$stVal);

@ -30,7 +30,6 @@ extern "C" {
#include "libiec61850_common_api.h" #include "libiec61850_common_api.h"
#include "iec61850_common.h" #include "iec61850_common.h"
#include "goose_subscriber.h"
#include "mms_value.h" #include "mms_value.h"
#include "mms_client_connection.h" #include "mms_client_connection.h"
#include "linked_list.h" #include "linked_list.h"

@ -1242,7 +1242,7 @@ IedServer_setWriteAccessPolicy(IedServer self, FunctionalConstraint fc, AccessPo
self->writeAccessPolicies &= ~ALLOW_WRITE_ACCESS_SV; self->writeAccessPolicies &= ~ALLOW_WRITE_ACCESS_SV;
break; break;
case IEC61850_FC_SE: case IEC61850_FC_SE:
self->writeAccessPolicies &= ALLOW_WRITE_ACCESS_SE; self->writeAccessPolicies &= ~ALLOW_WRITE_ACCESS_SE;
break; break;
default: /* ignore - request is invalid */ default: /* ignore - request is invalid */
break; break;

@ -242,8 +242,7 @@ ConfigFileParser_createModelFromConfigFile(FileHandle fileHandle)
if (matchedItems < 1) goto exit_error; if (matchedItems < 1) goto exit_error;
/* remove trailing ')' character */ /* remove trailing ')' character */
int nameLen = strlen(nameString); strtok(nameString, ")");
nameString[nameLen - 1] = 0;
Log_create(nameString, currentLN); Log_create(nameString, currentLN);
} }

@ -44,9 +44,8 @@ typedef struct {
FileHandle fileHandle; FileHandle fileHandle;
} MmsFileReadStateMachine; } MmsFileReadStateMachine;
//TODO already defined in public API mms_connection.h /* include for MmsFileReadHandler definition */
typedef void #include "mms_client_connection.h"
(*MmsFileReadHandler) (void* parameter, int32_t frsmId, uint8_t* buffer, uint32_t bytesReceived);
bool bool
mmsMsg_parseFileOpenResponse(uint8_t* buffer, int bufPos, int maxBufPos, int32_t* frsmId, uint32_t* fileSize, uint64_t* lastModified); mmsMsg_parseFileOpenResponse(uint8_t* buffer, int bufPos, int maxBufPos, int32_t* frsmId, uint32_t* fileSize, uint64_t* lastModified);

Loading…
Cancel
Save