|
|
@ -95,13 +95,15 @@ namespace IEC61850
|
|
|
|
private IntPtr self = IntPtr.Zero;
|
|
|
|
private IntPtr self = IntPtr.Zero;
|
|
|
|
private bool selfDestroy = false;
|
|
|
|
private bool selfDestroy = false;
|
|
|
|
|
|
|
|
|
|
|
|
public MmsConnection() {
|
|
|
|
public MmsConnection()
|
|
|
|
|
|
|
|
{
|
|
|
|
selfDestroy = true;
|
|
|
|
selfDestroy = true;
|
|
|
|
|
|
|
|
|
|
|
|
self = MmsConnection_create();
|
|
|
|
self = MmsConnection_create();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal MmsConnection(IntPtr mmsConnection) {
|
|
|
|
internal MmsConnection(IntPtr mmsConnection)
|
|
|
|
|
|
|
|
{
|
|
|
|
self = mmsConnection;
|
|
|
|
self = mmsConnection;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -125,7 +127,8 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int mmsError;
|
|
|
|
int mmsError;
|
|
|
|
|
|
|
|
|
|
|
|
if (self == IntPtr.Zero) {
|
|
|
|
if (self == IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
throw new IedConnectionException("Pointer is Zero!");
|
|
|
|
throw new IedConnectionException("Pointer is Zero!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -149,7 +152,8 @@ namespace IEC61850
|
|
|
|
/// Sets the local detail (maximum MMS PDU size)
|
|
|
|
/// Sets the local detail (maximum MMS PDU size)
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="localDetail">maximum accepted MMS PDU size in bytes</param>
|
|
|
|
/// <param name="localDetail">maximum accepted MMS PDU size in bytes</param>
|
|
|
|
public void SetLocalDetail(int localDetail) {
|
|
|
|
public void SetLocalDetail(int localDetail)
|
|
|
|
|
|
|
|
{
|
|
|
|
MmsConnection_setLocalDetail(self, localDetail);
|
|
|
|
MmsConnection_setLocalDetail(self, localDetail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -157,7 +161,8 @@ namespace IEC61850
|
|
|
|
/// Gets the local detail (maximum MMS PDU size)
|
|
|
|
/// Gets the local detail (maximum MMS PDU size)
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>maximum accepted MMS PDU size in bytes</returns>
|
|
|
|
/// <returns>maximum accepted MMS PDU size in bytes</returns>
|
|
|
|
public int GetLocalDetail() {
|
|
|
|
public int GetLocalDetail()
|
|
|
|
|
|
|
|
{
|
|
|
|
return MmsConnection_getLocalDetail(self);
|
|
|
|
return MmsConnection_getLocalDetail(self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -171,7 +176,8 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr linkedList = LinkedList_create();
|
|
|
|
IntPtr linkedList = LinkedList_create();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (string variableName in variables) {
|
|
|
|
foreach (string variableName in variables)
|
|
|
|
|
|
|
|
{
|
|
|
|
IntPtr handle = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(variableName);
|
|
|
|
IntPtr handle = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(variableName);
|
|
|
|
|
|
|
|
|
|
|
|
LinkedList_add(linkedList, handle);
|
|
|
|
LinkedList_add(linkedList, handle);
|
|
|
@ -261,7 +267,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
public List<MmsJournalVariable> GetJournalVariables()
|
|
|
|
public List<MmsJournalVariable> GetJournalVariables()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (variables == null) {
|
|
|
|
if (variables == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr linkedList = MmsJournalEntry_getJournalVariables(self);
|
|
|
|
IntPtr linkedList = MmsJournalEntry_getJournalVariables(self);
|
|
|
|
|
|
|
|
|
|
|
@ -269,7 +276,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
variables = new List<MmsJournalVariable>();
|
|
|
|
variables = new List<MmsJournalVariable>();
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
MmsJournalVariable journalVariable = new MmsJournalVariable(LinkedList_getData(element));
|
|
|
|
MmsJournalVariable journalVariable = new MmsJournalVariable(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
|
variables.Add(journalVariable);
|
|
|
|
variables.Add(journalVariable);
|
|
|
@ -304,7 +312,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (self != IntPtr.Zero) {
|
|
|
|
if (self != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
MmsJournalEntry_destroy(self);
|
|
|
|
MmsJournalEntry_destroy(self);
|
|
|
|
self = IntPtr.Zero;
|
|
|
|
self = IntPtr.Zero;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -675,7 +684,8 @@ namespace IEC61850
|
|
|
|
/// so the garbage collector can reclaim the memory that the <see cref="IEC61850.Client.IedConnection"/> was occupying.</remarks>
|
|
|
|
/// so the garbage collector can reclaim the memory that the <see cref="IEC61850.Client.IedConnection"/> was occupying.</remarks>
|
|
|
|
public void Dispose()
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (connection != IntPtr.Zero) {
|
|
|
|
if (connection != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
IedConnection_destroy(connection);
|
|
|
|
IedConnection_destroy(connection);
|
|
|
|
|
|
|
|
|
|
|
@ -722,10 +732,12 @@ namespace IEC61850
|
|
|
|
/// <value>The connect timeout in milliseconds</value>
|
|
|
|
/// <value>The connect timeout in milliseconds</value>
|
|
|
|
public UInt32 ConnectTimeout
|
|
|
|
public UInt32 ConnectTimeout
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get {
|
|
|
|
get
|
|
|
|
|
|
|
|
{
|
|
|
|
return connectTimeout;
|
|
|
|
return connectTimeout;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
set
|
|
|
|
|
|
|
|
{
|
|
|
|
connectTimeout = value;
|
|
|
|
connectTimeout = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -736,10 +748,12 @@ namespace IEC61850
|
|
|
|
/// <value>The maximum allowed size of an MMS PDU.</value>
|
|
|
|
/// <value>The maximum allowed size of an MMS PDU.</value>
|
|
|
|
public int MaxPduSize
|
|
|
|
public int MaxPduSize
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get {
|
|
|
|
get
|
|
|
|
|
|
|
|
{
|
|
|
|
return GetMmsConnection().GetLocalDetail();
|
|
|
|
return GetMmsConnection().GetLocalDetail();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
set
|
|
|
|
|
|
|
|
{
|
|
|
|
GetMmsConnection().SetLocalDetail(value);
|
|
|
|
GetMmsConnection().SetLocalDetail(value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -860,11 +874,13 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
if (fileDirectory == false) {
|
|
|
|
if (fileDirectory == false)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr element = LinkedList_getNext(linkedList);
|
|
|
|
IntPtr element = LinkedList_getNext(linkedList);
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
string ld = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
string ld = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
|
newList.Add(ld);
|
|
|
|
newList.Add(ld);
|
|
|
@ -874,7 +890,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
LinkedList_destroy(linkedList);
|
|
|
|
LinkedList_destroy(linkedList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr element = LinkedList_getNext(linkedList);
|
|
|
|
IntPtr element = LinkedList_getNext(linkedList);
|
|
|
|
|
|
|
|
|
|
|
@ -911,7 +928,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
string ln = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
string ln = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
|
newList.Add(ln);
|
|
|
|
newList.Add(ln);
|
|
|
@ -944,7 +962,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
|
newList.Add(dataObject);
|
|
|
|
newList.Add(dataObject);
|
|
|
@ -973,7 +992,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
|
newList.Add(dataObject);
|
|
|
|
newList.Add(dataObject);
|
|
|
@ -1003,7 +1023,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
|
newList.Add(dataObject);
|
|
|
|
newList.Add(dataObject);
|
|
|
@ -1034,7 +1055,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
|
newList.Add(dataObject);
|
|
|
|
newList.Add(dataObject);
|
|
|
@ -1053,7 +1075,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr element = LinkedList_getNext(linkedList);
|
|
|
|
IntPtr element = LinkedList_getNext(linkedList);
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
MmsJournalEntry journalEntry = new MmsJournalEntry(LinkedList_getData(element));
|
|
|
|
MmsJournalEntry journalEntry = new MmsJournalEntry(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
@ -1182,7 +1205,8 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr mmsValue = readObjectInternal(objectReference, fc);
|
|
|
|
IntPtr mmsValue = readObjectInternal(objectReference, fc);
|
|
|
|
|
|
|
|
|
|
|
|
if (MmsValue_getType(mmsValue) == (int) MmsType.MMS_DATA_ACCESS_ERROR) {
|
|
|
|
if (MmsValue_getType(mmsValue) == (int)MmsType.MMS_DATA_ACCESS_ERROR)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
int dataAccessError = MmsValue_getDataAccessError(mmsValue);
|
|
|
|
int dataAccessError = MmsValue_getDataAccessError(mmsValue);
|
|
|
|
|
|
|
|
|
|
|
@ -1203,7 +1227,8 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
|
|
|
|
|
|
|
|
if (MmsValue_getType (mmsValue) != (int) MmsType.MMS_BOOLEAN) {
|
|
|
|
if (MmsValue_getType(mmsValue) != (int)MmsType.MMS_BOOLEAN)
|
|
|
|
|
|
|
|
{
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
throw new IedConnectionException("Result is not of type boolean (MMS_BOOLEAN)", 0);
|
|
|
|
throw new IedConnectionException("Result is not of type boolean (MMS_BOOLEAN)", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1223,7 +1248,8 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
|
|
|
|
|
|
|
|
if (MmsValue_getType (mmsValue) != (int)MmsType.MMS_FLOAT) {
|
|
|
|
if (MmsValue_getType(mmsValue) != (int)MmsType.MMS_FLOAT)
|
|
|
|
|
|
|
|
{
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
throw new IedConnectionException("Result is not of type float (MMS_FLOAT)", 0);
|
|
|
|
throw new IedConnectionException("Result is not of type float (MMS_FLOAT)", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1243,7 +1269,8 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
|
|
|
|
|
|
|
|
if (!((MmsValue_getType (mmsValue) == (int)MmsType.MMS_VISIBLE_STRING) || (MmsValue_getType (mmsValue) == (int)MmsType.MMS_STRING))) {
|
|
|
|
if (!((MmsValue_getType(mmsValue) == (int)MmsType.MMS_VISIBLE_STRING) || (MmsValue_getType(mmsValue) == (int)MmsType.MMS_STRING)))
|
|
|
|
|
|
|
|
{
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
throw new IedConnectionException("Result is not of type string", 0);
|
|
|
|
throw new IedConnectionException("Result is not of type string", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1265,12 +1292,15 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
|
|
|
|
|
|
|
|
if (MmsValue_getType (mmsValue) == (int)MmsType.MMS_BIT_STRING) {
|
|
|
|
if (MmsValue_getType(mmsValue) == (int)MmsType.MMS_BIT_STRING)
|
|
|
|
|
|
|
|
{
|
|
|
|
int bitStringValue = (int)MmsValue_getBitStringAsInteger(mmsValue);
|
|
|
|
int bitStringValue = (int)MmsValue_getBitStringAsInteger(mmsValue);
|
|
|
|
|
|
|
|
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
return new Quality(bitStringValue);
|
|
|
|
return new Quality(bitStringValue);
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
throw new IedConnectionException("Result is not of type bit string(Quality)", 0);
|
|
|
|
throw new IedConnectionException("Result is not of type bit string(Quality)", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1284,12 +1314,15 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
IntPtr mmsValue = readObjectInternalAndCheckDataAccessError(objectReference, fc);
|
|
|
|
|
|
|
|
|
|
|
|
if (MmsValue_getType (mmsValue) == (int)MmsType.MMS_BIT_STRING) {
|
|
|
|
if (MmsValue_getType(mmsValue) == (int)MmsType.MMS_BIT_STRING)
|
|
|
|
|
|
|
|
{
|
|
|
|
int bitStringValue = (int)MmsValue_getBitStringAsInteger(mmsValue);
|
|
|
|
int bitStringValue = (int)MmsValue_getBitStringAsInteger(mmsValue);
|
|
|
|
|
|
|
|
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
return bitStringValue;
|
|
|
|
return bitStringValue;
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
MmsValue_delete(mmsValue);
|
|
|
|
throw new IedConnectionException("Result is not of type bit string", 0);
|
|
|
|
throw new IedConnectionException("Result is not of type bit string", 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1806,7 +1839,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr valueList = LinkedList_create();
|
|
|
|
IntPtr valueList = LinkedList_create();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (MmsValue mmsValue in values) {
|
|
|
|
foreach (MmsValue mmsValue in values)
|
|
|
|
|
|
|
|
{
|
|
|
|
LinkedList_add(valueList, mmsValue.valueReference);
|
|
|
|
LinkedList_add(valueList, mmsValue.valueReference);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1818,11 +1852,13 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
List<MmsDataAccessError> accessResultList = null;
|
|
|
|
List<MmsDataAccessError> accessResultList = null;
|
|
|
|
|
|
|
|
|
|
|
|
if (accessResults != IntPtr.Zero) {
|
|
|
|
if (accessResults != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr element = LinkedList_getNext(accessResults);
|
|
|
|
IntPtr element = LinkedList_getNext(accessResults);
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
IntPtr elementData = LinkedList_getData(element);
|
|
|
|
IntPtr elementData = LinkedList_getData(element);
|
|
|
|
|
|
|
|
|
|
|
|
MmsValue accessResultValue = new MmsValue(elementData, true);
|
|
|
|
MmsValue accessResultValue = new MmsValue(elementData, true);
|
|
|
@ -1855,7 +1891,8 @@ namespace IEC61850
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IntPtr linkedList = LinkedList_create();
|
|
|
|
IntPtr linkedList = LinkedList_create();
|
|
|
|
|
|
|
|
|
|
|
|
foreach (string dataSetElement in dataSetElements) {
|
|
|
|
foreach (string dataSetElement in dataSetElements)
|
|
|
|
|
|
|
|
{
|
|
|
|
IntPtr handle = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(dataSetElement);
|
|
|
|
IntPtr handle = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(dataSetElement);
|
|
|
|
|
|
|
|
|
|
|
|
LinkedList_add(linkedList, handle);
|
|
|
|
LinkedList_add(linkedList, handle);
|
|
|
@ -1927,7 +1964,8 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
List<string> newList = new List<string>();
|
|
|
|
|
|
|
|
|
|
|
|
while (element != IntPtr.Zero) {
|
|
|
|
while (element != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
string dataObject = Marshal.PtrToStringAnsi(LinkedList_getData(element));
|
|
|
|
|
|
|
|
|
|
|
|
newList.Add(dataObject);
|
|
|
|
newList.Add(dataObject);
|
|
|
@ -2376,32 +2414,40 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
internal void UninstallReportHandler(string objectReference)
|
|
|
|
internal void UninstallReportHandler(string objectReference)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (connection != IntPtr.Zero) {
|
|
|
|
if (connection != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
IedConnection_uninstallReportHandler(connection, objectReference);
|
|
|
|
IedConnection_uninstallReportHandler(connection, objectReference);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal void InstallReportHandler(string objectReference, string reportId, InternalReportHandler internalHandler)
|
|
|
|
internal void InstallReportHandler(string objectReference, string reportId, InternalReportHandler internalHandler)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (connection != IntPtr.Zero) {
|
|
|
|
if (connection != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
IedConnection_installReportHandler(connection, objectReference, reportId, internalHandler, IntPtr.Zero);
|
|
|
|
IedConnection_installReportHandler(connection, objectReference, reportId, internalHandler, IntPtr.Zero);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal void GetRCBValues(out int error, string objectReference, IntPtr updateRcb)
|
|
|
|
internal void GetRCBValues(out int error, string objectReference, IntPtr updateRcb)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (connection != IntPtr.Zero) {
|
|
|
|
if (connection != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
IedConnection_getRCBValues(connection, out error, objectReference, updateRcb);
|
|
|
|
IedConnection_getRCBValues(connection, out error, objectReference, updateRcb);
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
error = 1; /* not connected */
|
|
|
|
error = 1; /* not connected */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal void SetRCBValues(out int error, IntPtr rcb, UInt32 parametersMask, bool singleRequest)
|
|
|
|
internal void SetRCBValues(out int error, IntPtr rcb, UInt32 parametersMask, bool singleRequest)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (connection != IntPtr.Zero) {
|
|
|
|
if (connection != IntPtr.Zero)
|
|
|
|
|
|
|
|
{
|
|
|
|
IedConnection_setRCBValues(connection, out error, rcb, parametersMask, singleRequest);
|
|
|
|
IedConnection_setRCBValues(connection, out error, rcb, parametersMask, singleRequest);
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
error = 1; /* not connected */
|
|
|
|
error = 1; /* not connected */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2486,12 +2532,14 @@ namespace IEC61850
|
|
|
|
|
|
|
|
|
|
|
|
private int errorCode;
|
|
|
|
private int errorCode;
|
|
|
|
|
|
|
|
|
|
|
|
public IedConnectionException (string message, int errorCode) : base(message)
|
|
|
|
public IedConnectionException(string message, int errorCode)
|
|
|
|
|
|
|
|
: base(message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.errorCode = errorCode;
|
|
|
|
this.errorCode = errorCode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IedConnectionException (string message) : base(message)
|
|
|
|
public IedConnectionException(string message)
|
|
|
|
|
|
|
|
: base(message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.errorCode = 0;
|
|
|
|
this.errorCode = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2653,6 +2701,12 @@ namespace IEC61850
|
|
|
|
/** The object is invalidated (returned by server) */
|
|
|
|
/** The object is invalidated (returned by server) */
|
|
|
|
IED_ERROR_OBJECT_INVALIDATED = 33,
|
|
|
|
IED_ERROR_OBJECT_INVALIDATED = 33,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Received an invalid response message from the server */
|
|
|
|
|
|
|
|
IED_ERROR_MALFORMED_MESSAGE = 34,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Service not implemented */
|
|
|
|
|
|
|
|
IED_ERROR_SERVICE_NOT_IMPLEMENTED = 98,
|
|
|
|
|
|
|
|
|
|
|
|
/* unknown error */
|
|
|
|
/* unknown error */
|
|
|
|
IED_ERROR_UNKNOWN = 99
|
|
|
|
IED_ERROR_UNKNOWN = 99
|
|
|
|
}
|
|
|
|
}
|
|
|
|