From e4fcb923a07f06e04d481a41708715bc889ccfa6 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Thu, 29 Oct 2020 06:39:39 +0100 Subject: [PATCH] - fixed problems in control service tracking --- src/iec61850/server/mms_mapping/control.c | 39 +++++++++++++++++-- src/iec61850/server/mms_mapping/mms_mapping.c | 2 +- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/iec61850/server/mms_mapping/control.c b/src/iec61850/server/mms_mapping/control.c index 4928186e..6ed95887 100644 --- a/src/iec61850/server/mms_mapping/control.c +++ b/src/iec61850/server/mms_mapping/control.c @@ -217,6 +217,9 @@ copyControlValuesToTrackingObject(MmsMapping* self, ControlObject* controlObject case CST_INCTRK: trkInst = self->incTrk; break; + case CST_ENCTRK1: + trkInst = self->encTrk1; + break; case CST_APCFTRK: trkInst = self->apcFTrk; break; @@ -340,9 +343,39 @@ updateGenericTrackingObjectValues(MmsMapping* self, ControlObject* controlObject ServiceTrkInstance trkInst = NULL; if (controlObject->ctlVal) { - if (MmsValue_getType(controlObject->ctlVal) == MMS_BOOLEAN) { - // assume SPC (could also be binary controller step position or analog control!!!) - trkInst = (ServiceTrkInstance) self->spcTrk; + switch(controlObject->cdc) + { + case CST_SPCTRK: + trkInst = (ServiceTrkInstance) self->spcTrk; + break; + case CST_DPCTRK: + trkInst = (ServiceTrkInstance) self->dpcTrk; + break; + case CST_INCTRK: + trkInst = (ServiceTrkInstance) self->incTrk; + break; + case CST_ENCTRK1: + trkInst = (ServiceTrkInstance) self->encTrk1; + break; + case CST_APCFTRK: + trkInst = (ServiceTrkInstance) self->apcFTrk; + break; + case CST_APCINTTRK: + trkInst = (ServiceTrkInstance) self->apcIntTrk; + break; + case CST_BSCTRK: + trkInst = (ServiceTrkInstance) self->bscTrk; + break; + case CST_ISCTRK: + trkInst = (ServiceTrkInstance) self->iscTrk; + break; + case CST_BACTRK: + trkInst = (ServiceTrkInstance) self->bacTrk; + break; + default: + if (DEBUG_IED_SERVER) + printf("IED_SERVER: could not determine servicetracking type\n"); + break; } } diff --git a/src/iec61850/server/mms_mapping/mms_mapping.c b/src/iec61850/server/mms_mapping/mms_mapping.c index a893b555..940b661f 100644 --- a/src/iec61850/server/mms_mapping/mms_mapping.c +++ b/src/iec61850/server/mms_mapping/mms_mapping.c @@ -1311,7 +1311,7 @@ checkForServiceTrackingVariables(MmsMapping* self, LogicalNode* logicalNode) if (!strcmp(modelNode->name, "SpcTrk")) actInstance = &self->spcTrk; else if (!strcmp(modelNode->name, "DpcTrk")) - actInstance = &self->spcTrk; + actInstance = &self->dpcTrk; else if (!strcmp(modelNode->name, "IncTrk")) actInstance = &self->incTrk; else if (!strcmp(modelNode->name, "EncTrk1"))