- some fixes
This commit is contained in:
parent
da21bb2e76
commit
b8a4e8c7b0
12 changed files with 48 additions and 33 deletions
|
@ -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
|
||||
------------------------
|
||||
- MMS client/server: implemented obtainFile service
|
||||
|
|
|
@ -266,7 +266,6 @@ namespace IEC61850
|
|||
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
|
||||
static extern void MmsValue_delete (IntPtr self);
|
||||
|
||||
|
||||
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
|
||||
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]
|
||||
public enum TriggerOptions {
|
||||
NONE = 0,
|
||||
|
|
|
@ -197,24 +197,6 @@ namespace IEC61850
|
|||
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 {
|
||||
BOOLEAN = 0,
|
||||
INT8 = 1,
|
||||
|
|
|
@ -164,6 +164,9 @@ namespace IEC61850
|
|||
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
|
||||
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 */
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
public MmsDataAccessError GetDataAccessError ()
|
||||
{
|
||||
int errorCode = MmsValue_getDataAccessError (valueReference);
|
||||
|
||||
return (MmsDataAccessError)errorCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the timestamp value as UTC time in s (UNIX time stamp).
|
||||
/// </summary>
|
||||
|
|
|
@ -257,14 +257,14 @@ namespace tests
|
|||
|
||||
iedServer.HandleWriteAccess (opDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) {
|
||||
opDlTmmsValue = value.ToInt32();
|
||||
return MmsDataAccessError.DATA_ACCESS_ERROR_SUCCESS;
|
||||
return MmsDataAccessError.SUCCESS;
|
||||
}, null);
|
||||
|
||||
iedServer.HandleWriteAccess (rsDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) {
|
||||
if (value.ToInt32() > 1000)
|
||||
return MmsDataAccessError.DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID;
|
||||
return MmsDataAccessError.OBJECT_VALUE_INVALID;
|
||||
else
|
||||
return MmsDataAccessError.DATA_ACCESS_ERROR_SUCCESS;
|
||||
return MmsDataAccessError.SUCCESS;
|
||||
}, null);
|
||||
|
||||
iedServer.Start (10002);
|
||||
|
@ -310,7 +310,7 @@ namespace tests
|
|||
IedServer iedServer = new IedServer (iedModel);
|
||||
|
||||
iedServer.HandleWriteAccess (opDlTmms, delegate(IEC61850.Server.DataAttribute dataAttr, MmsValue value, ClientConnection con, object parameter) {
|
||||
return MmsDataAccessError.DATA_ACCESS_ERROR_SUCCESS;
|
||||
return MmsDataAccessError.SUCCESS;
|
||||
}, null);
|
||||
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
<LDevice inst="Inverter">
|
||||
<LN0 lnClass="LLN0" lnType="LLN02" inst="">
|
||||
<DataSet name="dataset1" desc="">
|
||||
<FCDA ldInst="Inverter" lnClass="LLN0" fc="ST" doName="Mod" daName="q" />
|
||||
<FCDA ldInst="Battery" lnClass="LLN0" fc="ST" doName="Mod" daName="q" />
|
||||
<FCDA ldInst="Inverter" lnClass="LLN0" fc="ST" doName="Mod" daName="q" />
|
||||
<FCDA ldInst="Battery" lnClass="LLN0" fc="ST" doName="Mod" daName="q" />
|
||||
<FCDA ldInst="Inverter" lnClass="MMXU" fc="ST" lnInst="1" doName="Mod" daName="q" />
|
||||
<FCDA ldInst="Inverter" lnClass="MMXU" fc="CF" lnInst="1" doName="Mod" daName="ctlModel" />
|
||||
<FCDA ldInst="Inverter" lnClass="MMXU" fc="MX" lnInst="1" doName="TotW" daName="mag" />
|
||||
|
|
|
@ -25,7 +25,7 @@ DA(configRev 0 20 5 0 0);
|
|||
DA(ldNs 0 20 11 0 0);
|
||||
}
|
||||
DS(Events){
|
||||
DE(GGIO1$ST$SPCSO1$stVal);
|
||||
DE(simpleIOGenericIO/GGIO1$ST$SPCSO1$stVal);
|
||||
DE(GGIO1$ST$SPCSO2$stVal);
|
||||
DE(GGIO1$ST$SPCSO3$stVal);
|
||||
DE(GGIO1$ST$SPCSO4$stVal);
|
||||
|
|
|
@ -30,7 +30,6 @@ extern "C" {
|
|||
|
||||
#include "libiec61850_common_api.h"
|
||||
#include "iec61850_common.h"
|
||||
#include "goose_subscriber.h"
|
||||
#include "mms_value.h"
|
||||
#include "mms_client_connection.h"
|
||||
#include "linked_list.h"
|
||||
|
|
|
@ -1242,7 +1242,7 @@ IedServer_setWriteAccessPolicy(IedServer self, FunctionalConstraint fc, AccessPo
|
|||
self->writeAccessPolicies &= ~ALLOW_WRITE_ACCESS_SV;
|
||||
break;
|
||||
case IEC61850_FC_SE:
|
||||
self->writeAccessPolicies &= ALLOW_WRITE_ACCESS_SE;
|
||||
self->writeAccessPolicies &= ~ALLOW_WRITE_ACCESS_SE;
|
||||
break;
|
||||
default: /* ignore - request is invalid */
|
||||
break;
|
||||
|
|
|
@ -242,8 +242,7 @@ ConfigFileParser_createModelFromConfigFile(FileHandle fileHandle)
|
|||
if (matchedItems < 1) goto exit_error;
|
||||
|
||||
/* remove trailing ')' character */
|
||||
int nameLen = strlen(nameString);
|
||||
nameString[nameLen - 1] = 0;
|
||||
strtok(nameString, ")");
|
||||
|
||||
Log_create(nameString, currentLN);
|
||||
}
|
||||
|
|
|
@ -44,9 +44,8 @@ typedef struct {
|
|||
FileHandle fileHandle;
|
||||
} MmsFileReadStateMachine;
|
||||
|
||||
//TODO already defined in public API mms_connection.h
|
||||
typedef void
|
||||
(*MmsFileReadHandler) (void* parameter, int32_t frsmId, uint8_t* buffer, uint32_t bytesReceived);
|
||||
/* include for MmsFileReadHandler definition */
|
||||
#include "mms_client_connection.h"
|
||||
|
||||
bool
|
||||
mmsMsg_parseFileOpenResponse(uint8_t* buffer, int bufPos, int maxBufPos, int32_t* frsmId, uint32_t* fileSize, uint64_t* lastModified);
|
||||
|
|
Loading…
Add table
Reference in a new issue