|
|
@ -27,11 +27,16 @@ sigint_handler(int signalId)
|
|
|
|
static CheckHandlerResult
|
|
|
|
static CheckHandlerResult
|
|
|
|
checkHandler(ControlAction action, void* parameter, MmsValue* ctlVal, bool test, bool interlockCheck)
|
|
|
|
checkHandler(ControlAction action, void* parameter, MmsValue* ctlVal, bool test, bool interlockCheck)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("check handler called!\n");
|
|
|
|
if (ControlAction_isSelect(action))
|
|
|
|
|
|
|
|
printf("check handler called by select command!\n");
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
printf("check handler called by operate command!\n");
|
|
|
|
|
|
|
|
|
|
|
|
if (interlockCheck)
|
|
|
|
if (interlockCheck)
|
|
|
|
printf(" with interlock check bit set!\n");
|
|
|
|
printf(" with interlock check bit set!\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf(" ctlNum: %i\n", ControlAction_getCtlNum(action));
|
|
|
|
|
|
|
|
|
|
|
|
if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO1)
|
|
|
|
if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO1)
|
|
|
|
return CONTROL_ACCEPTED;
|
|
|
|
return CONTROL_ACCEPTED;
|
|
|
|
|
|
|
|
|
|
|
@ -55,6 +60,9 @@ controlHandlerForBinaryOutput(ControlAction action, void* parameter, MmsValue* v
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint64_t timestamp = Hal_getTimeInMs();
|
|
|
|
uint64_t timestamp = Hal_getTimeInMs();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("control handler called\n");
|
|
|
|
|
|
|
|
printf(" ctlNum: %i\n", ControlAction_getCtlNum(action));
|
|
|
|
|
|
|
|
|
|
|
|
if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO1) {
|
|
|
|
if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO1) {
|
|
|
|
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_t, timestamp);
|
|
|
|
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_t, timestamp);
|
|
|
|
IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_stVal, value);
|
|
|
|
IedServer_updateAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_stVal, value);
|
|
|
@ -122,7 +130,7 @@ main(int argc, char** argv)
|
|
|
|
|
|
|
|
|
|
|
|
/* this is optional - performs operative checks */
|
|
|
|
/* this is optional - performs operative checks */
|
|
|
|
IedServer_setPerformCheckHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2, checkHandler,
|
|
|
|
IedServer_setPerformCheckHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2, checkHandler,
|
|
|
|
IEDMODEL_GenericIO_GGIO1_SPCSO2);
|
|
|
|
IEDMODEL_GenericIO_GGIO1_SPCSO2);
|
|
|
|
|
|
|
|
|
|
|
|
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3,
|
|
|
|
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3,
|
|
|
|
(ControlHandler) controlHandlerForBinaryOutput,
|
|
|
|
(ControlHandler) controlHandlerForBinaryOutput,
|
|
|
|