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)]
static extern IntPtr ControlAction_getOrIdent (IntPtr self, ref int size);
[DllImport ("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ControlAction_getClientConnection (IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr ControlAction_getClientConnection(IntPtr self);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern int ControlAction_getCtlNum(IntPtr self);
private IntPtr self;
private IedServer.ControlHandlerInfo info;
@ -569,6 +572,15 @@ namespace IEC61850
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>
/// Gets the control object that is subject to this action
/// </summary>

@ -1164,6 +1164,16 @@ ControlAction_getOrCat(ControlAction self);
LIB61850_API uint8_t*
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
*

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

Loading…
Cancel
Save