|
|
@ -122,6 +122,7 @@ ReportControl_create(bool buffered, LogicalNode* parentLN, int reportBufferSize,
|
|
|
|
self->timeOfEntry = NULL;
|
|
|
|
self->timeOfEntry = NULL;
|
|
|
|
self->reservationTimeout = 0;
|
|
|
|
self->reservationTimeout = 0;
|
|
|
|
self->triggerOps = 0;
|
|
|
|
self->triggerOps = 0;
|
|
|
|
|
|
|
|
self->hasOwner = false;
|
|
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_THREADLESS_STACK != 1)
|
|
|
|
#if (CONFIG_MMS_THREADLESS_STACK != 1)
|
|
|
|
self->createNotificationsMutex = Semaphore_create(1);
|
|
|
|
self->createNotificationsMutex = Semaphore_create(1);
|
|
|
@ -941,12 +942,12 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|
|
|
mmsValue->deleteValue = false;
|
|
|
|
mmsValue->deleteValue = false;
|
|
|
|
mmsValue->type = MMS_STRUCTURE;
|
|
|
|
mmsValue->type = MMS_STRUCTURE;
|
|
|
|
|
|
|
|
|
|
|
|
int structSize;
|
|
|
|
int structSize = 11;
|
|
|
|
|
|
|
|
|
|
|
|
if (reportControl->server->edition >= IEC_61850_EDITION_2)
|
|
|
|
if (reportControl->server->edition >= IEC_61850_EDITION_2) {
|
|
|
|
|
|
|
|
if (reportControl->hasOwner)
|
|
|
|
structSize = 12;
|
|
|
|
structSize = 12;
|
|
|
|
else
|
|
|
|
}
|
|
|
|
structSize = 11;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mmsValue->value.structure.size = structSize;
|
|
|
|
mmsValue->value.structure.size = structSize;
|
|
|
|
mmsValue->value.structure.components = (MmsValue**) GLOBAL_CALLOC(structSize, sizeof(MmsValue*));
|
|
|
|
mmsValue->value.structure.components = (MmsValue**) GLOBAL_CALLOC(structSize, sizeof(MmsValue*));
|
|
|
@ -1049,6 +1050,8 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|
|
|
mmsValue->value.structure.components[10] = MmsValue_newBoolean(false);
|
|
|
|
mmsValue->value.structure.components[10] = MmsValue_newBoolean(false);
|
|
|
|
|
|
|
|
|
|
|
|
if (reportControl->server->edition >= IEC_61850_EDITION_2) {
|
|
|
|
if (reportControl->server->edition >= IEC_61850_EDITION_2) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reportControl->hasOwner) {
|
|
|
|
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
|
|
|
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
|
|
|
namedVariable->name = StringUtils_copyString("Owner");
|
|
|
|
namedVariable->name = StringUtils_copyString("Owner");
|
|
|
|
namedVariable->type = MMS_OCTET_STRING;
|
|
|
|
namedVariable->type = MMS_OCTET_STRING;
|
|
|
@ -1066,6 +1069,7 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|
|
|
MmsValue_setOctetString(mmsValue->value.structure.components[11], reportControlBlock->clientReservation + 1, 16);
|
|
|
|
MmsValue_setOctetString(mmsValue->value.structure.components[11], reportControlBlock->clientReservation + 1, 16);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
reportControl->rcbValues = mmsValue;
|
|
|
|
reportControl->rcbValues = mmsValue;
|
|
|
|
|
|
|
|
|
|
|
@ -1094,6 +1098,7 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|
|
|
brcbElementCount++;
|
|
|
|
brcbElementCount++;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reportControl->hasOwner)
|
|
|
|
brcbElementCount++;
|
|
|
|
brcbElementCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1221,6 +1226,9 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|
|
|
int currentIndex = 13;
|
|
|
|
int currentIndex = 13;
|
|
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1)
|
|
|
|
#if (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int resvTmsIndex = currentIndex;
|
|
|
|
|
|
|
|
|
|
|
|
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
|
|
|
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
|
|
|
namedVariable->name = StringUtils_copyString("ResvTms");
|
|
|
|
namedVariable->name = StringUtils_copyString("ResvTms");
|
|
|
|
namedVariable->type = MMS_INTEGER;
|
|
|
|
namedVariable->type = MMS_INTEGER;
|
|
|
@ -1230,6 +1238,7 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|
|
|
currentIndex++;
|
|
|
|
currentIndex++;
|
|
|
|
#endif /* (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1) */
|
|
|
|
#endif /* (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1) */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reportControl->hasOwner) {
|
|
|
|
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
|
|
|
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
|
|
|
namedVariable->name = StringUtils_copyString("Owner");
|
|
|
|
namedVariable->name = StringUtils_copyString("Owner");
|
|
|
|
namedVariable->type = MMS_OCTET_STRING;
|
|
|
|
namedVariable->type = MMS_OCTET_STRING;
|
|
|
@ -1246,9 +1255,10 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|
|
|
reportControl->resvTms = -1;
|
|
|
|
reportControl->resvTms = -1;
|
|
|
|
MmsValue_setOctetString(mmsValue->value.structure.components[currentIndex], reportControlBlock->clientReservation + 1, 16);
|
|
|
|
MmsValue_setOctetString(mmsValue->value.structure.components[currentIndex], reportControlBlock->clientReservation + 1, 16);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1)
|
|
|
|
#if (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1)
|
|
|
|
MmsValue_setInt16(mmsValue->value.structure.components[13], reportControl->resvTms);
|
|
|
|
MmsValue_setInt16(mmsValue->value.structure.components[resvTmsIndex], reportControl->resvTms);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1311,6 +1321,9 @@ Reporting_createMmsBufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|
|
|
ReportControlBlock* reportControlBlock = getRCBForLogicalNodeWithIndex(
|
|
|
|
ReportControlBlock* reportControlBlock = getRCBForLogicalNodeWithIndex(
|
|
|
|
self, logicalNode, currentReport, true);
|
|
|
|
self, logicalNode, currentReport, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reportControlBlock->trgOps & RPT_OPT_HAS_OWNER)
|
|
|
|
|
|
|
|
rc->hasOwner = true;
|
|
|
|
|
|
|
|
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$BR$",
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$BR$",
|
|
|
|
reportControlBlock->name);
|
|
|
|
reportControlBlock->name);
|
|
|
|
|
|
|
|
|
|
|
@ -1348,6 +1361,9 @@ Reporting_createMmsUnbufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|
|
|
ReportControlBlock* reportControlBlock = getRCBForLogicalNodeWithIndex(
|
|
|
|
ReportControlBlock* reportControlBlock = getRCBForLogicalNodeWithIndex(
|
|
|
|
self, logicalNode, currentReport, false);
|
|
|
|
self, logicalNode, currentReport, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reportControlBlock->trgOps & RPT_OPT_HAS_OWNER)
|
|
|
|
|
|
|
|
rc->hasOwner = true;
|
|
|
|
|
|
|
|
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$RP$",
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$RP$",
|
|
|
|
reportControlBlock->name);
|
|
|
|
reportControlBlock->name);
|
|
|
|
|
|
|
|
|
|
|
@ -1393,7 +1409,7 @@ updateOwner(ReportControl* rc, MmsServerConnection connection)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rc->clientConnection = connection;
|
|
|
|
rc->clientConnection = connection;
|
|
|
|
|
|
|
|
|
|
|
|
if (rc->server->edition >= IEC_61850_EDITION_2) {
|
|
|
|
if (rc->server->edition >= IEC_61850_EDITION_2 && rc->hasOwner) {
|
|
|
|
|
|
|
|
|
|
|
|
MmsValue* owner = ReportControl_getRCBValue(rc, "Owner");
|
|
|
|
MmsValue* owner = ReportControl_getRCBValue(rc, "Owner");
|
|
|
|
|
|
|
|
|
|
|
|