IEC 61850 server: added function ControlAction_getCtlNum to access ctlNum value inside control handlers

pull/179/head
Michael Zillgith 6 years ago
parent 83f9f1eaa6
commit e4c3875e3e

@ -517,8 +517,11 @@ namespace IEC61850
[DllImport ("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport ("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ControlAction_getOrIdent (IntPtr self, ref int size); static extern IntPtr ControlAction_getOrIdent (IntPtr self, ref int size);
[DllImport ("iec61850", CallingConvention = CallingConvention.Cdecl)] [DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ControlAction_getClientConnection (IntPtr self); static extern IntPtr ControlAction_getClientConnection(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern int ControlAction_getCtlNum(IntPtr self);
private IntPtr self; private IntPtr self;
private IedServer.ControlHandlerInfo info; private IedServer.ControlHandlerInfo info;
@ -569,6 +572,15 @@ namespace IEC61850
return orIdent; return orIdent;
} }
/// <summary>
/// Gets the ctlNum attribute of the control action
/// </summary>
/// <returns>The ctlNum value. Valid values are restricted from 0 to 255, -1 means not present</returns>
public int GetCtlNum()
{
return ControlAction_getCtlNum(self);
}
/// <summary> /// <summary>
/// Gets the control object that is subject to this action /// Gets the control object that is subject to this action
/// </summary> /// </summary>

@ -1164,6 +1164,16 @@ ControlAction_getOrCat(ControlAction self);
LIB61850_API uint8_t* LIB61850_API uint8_t*
ControlAction_getOrIdent(ControlAction self, int* orIdentSize); ControlAction_getOrIdent(ControlAction self, int* orIdentSize);
/**
* \brief Get the ctlNum attribute send by the client
*
* \param self the control action instance
*
* \return the ctlNum value
*/
LIB61850_API int
ControlAction_getCtlNum(ControlAction self);
/** /**
* \brief Gets the client object associated with the client that caused the control action * \brief Gets the client object associated with the client that caused the control action
* *

@ -1734,6 +1734,18 @@ ControlAction_getOrIdent(ControlAction self, int* orIdentSize)
return NULL; return NULL;
} }
int
ControlAction_getCtlNum(ControlAction self)
{
ControlObject* controlObject = (ControlObject*) self;
if (controlObject->ctlNum) {
return MmsValue_toInt32(controlObject->ctlNum);
}
return -1;
}
ClientConnection ClientConnection
ControlAction_getClientConnection(ControlAction self) ControlAction_getClientConnection(ControlAction self)
{ {

Loading…
Cancel
Save