- IEC 61850 client: add public header for function ControlObjectClient_createEx to create a client control object without the need to request information from the server

pull/93/head
Michael Zillgith 7 years ago
parent 91c22b3193
commit 618a84d37c

@ -110,7 +110,7 @@ resetLastApplError(ControlObjectClient self)
}
ControlObjectClient
ControlObjectClient_createEx(const char* objectReference, IedConnection connection, uint32_t ctlModel, MmsVariableSpecification* operSpec)
ControlObjectClient_createEx(const char* objectReference, IedConnection connection, ControlModel ctlModel, MmsVariableSpecification* controlObjectSpec)
{
ControlObjectClient self = NULL;
@ -122,8 +122,8 @@ ControlObjectClient_createEx(const char* objectReference, IedConnection connecti
MmsVariableSpecification* ctlVal = NULL;
MmsVariableSpecification* t = NULL;
if (MmsVariableSpecification_getType(operSpec) == MMS_STRUCTURE) {
MmsVariableSpecification* oper = MmsVariableSpecification_getNamedVariableRecursive(operSpec, "Oper");
if (MmsVariableSpecification_getType(controlObjectSpec) == MMS_STRUCTURE) {
MmsVariableSpecification* oper = MmsVariableSpecification_getNamedVariableRecursive(controlObjectSpec, "Oper");
if (oper)
{
@ -151,6 +151,8 @@ ControlObjectClient_createEx(const char* objectReference, IedConnection connecti
t = MmsVariableSpecification_getNamedVariableRecursive(oper, "T");
}
/* TODO Add additional checks dependent on control model */
}
if (hasOper == false) {
@ -173,7 +175,7 @@ ControlObjectClient_createEx(const char* objectReference, IedConnection connecti
self->objectReference = StringUtils_copyString(objectReference);
self->connection = connection;
self->ctlModel = (ControlModel) ctlModel;
self->ctlModel = ctlModel;
self->hasTimeActivatedMode = hasTimeActivatedControl;
self->hasCtlNum = hasCtlNum;
self->ctlVal = MmsValue_newDefaultValue(ctlVal);
@ -199,7 +201,6 @@ ControlObjectClient_createEx(const char* objectReference, IedConnection connecti
iedConnection_addControlClient(connection, self);
exit_function:
MmsVariableSpecification_destroy(operSpec);
return self;
}
@ -239,9 +240,8 @@ ControlObjectClient_create(const char* objectReference, IedConnection connection
goto exit_function;
}
self = ControlObjectClient_createEx(objectReference, connection, ctlModel, ctlVarSpec);
self = ControlObjectClient_createEx(objectReference, connection, (ControlModel) ctlModel, ctlVarSpec);
if (self == NULL)
MmsVariableSpecification_destroy(ctlVarSpec);
exit_function:

@ -68,10 +68,10 @@ typedef struct
ControlAddCause addCause;
} LastApplError;
/** Connection state of the IedConnection instance (either idle, connected or closed) */
/** Connection state of the IedConnection instance - either closed(idle), connecting, connected, or closing) */
typedef enum
{
IED_STATE_CLOSED,
IED_STATE_CLOSED = 0,
IED_STATE_CONNECTING,
IED_STATE_CONNECTED,
IED_STATE_CLOSING
@ -1774,7 +1774,7 @@ typedef struct sControlObjectClient* ControlObjectClient;
/**
* \brief Create a new client control object
*
* A client control object is used to handle all client side aspects of a controllable
* A client control object is used to handle all client side functions of a controllable
* data object. A controllable data object is an instance of a controllable CDC like e.g.
* SPC, DPC, APC, ...
*
@ -1790,6 +1790,21 @@ typedef struct sControlObjectClient* ControlObjectClient;
LIB61850_API ControlObjectClient
ControlObjectClient_create(const char* objectReference, IedConnection connection);
/**
* \brief Create a new client control object - doesn't send requests to the server (doesn't block)
*
* A client control object is used to handle all client side functions of a controllable
* data object. A controllable data object is an instance of a controllable CDC like e.g.
* SPC, DPC, APC, ...
*
* \param objectReference the reference of the controllable data object
* \param connection the connection instance where the control object has to be reached
* \param ctlModel the control model used by the controllable data object
* \param controlObjectSpec specification of the controllable data objects - used to derive required information to handle the control object
*/
LIB61850_API ControlObjectClient
ControlObjectClient_createEx(const char* objectReference, IedConnection connection, ControlModel ctlModel, MmsVariableSpecification* controlObjectSpec);
/**
* \brief Destroy the client control object instance and release all related resources
*

Loading…
Cancel
Save