|
|
|
@ -40,7 +40,7 @@
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
/* if not explicitly set by client "ResvTms" will be set to this value */
|
|
|
|
|
#define RESV_TMS_IMPLICIT_VALUE 30
|
|
|
|
|
#define RESV_TMS_IMPLICIT_VALUE 10
|
|
|
|
|
|
|
|
|
|
#ifndef DEBUG_IED_SERVER
|
|
|
|
|
#define DEBUG_IED_SERVER 0
|
|
|
|
@ -1345,6 +1345,8 @@ Reporting_createMmsBufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$BR$",
|
|
|
|
|
reportControlBlock->name);
|
|
|
|
|
|
|
|
|
|
rc->rcb = reportControlBlock;
|
|
|
|
|
|
|
|
|
|
namedVariable->typeSpec.structure.elements[currentReport] =
|
|
|
|
|
createBufferedReportControlBlock(reportControlBlock, rc);
|
|
|
|
|
|
|
|
|
@ -1385,6 +1387,8 @@ Reporting_createMmsUnbufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$RP$",
|
|
|
|
|
reportControlBlock->name);
|
|
|
|
|
|
|
|
|
|
rc->rcb = reportControlBlock;
|
|
|
|
|
|
|
|
|
|
namedVariable->typeSpec.structure.elements[currentReport] =
|
|
|
|
|
createUnbufferedReportControlBlock(reportControlBlock, rc);
|
|
|
|
|
|
|
|
|
@ -1472,9 +1476,20 @@ updateOwner(ReportControl* rc, MmsServerConnection connection)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (rc->resvTms != -1) {
|
|
|
|
|
uint8_t emptyAddr[1];
|
|
|
|
|
MmsValue_setOctetString(owner, emptyAddr, 0);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* Set to pre-configured owner */
|
|
|
|
|
if (rc->rcb->clientReservation[0] == 4) {
|
|
|
|
|
MmsValue_setOctetString(owner, rc->rcb->clientReservation + 1, 4);
|
|
|
|
|
}
|
|
|
|
|
else if (rc->rcb->clientReservation[0] == 6) {
|
|
|
|
|
MmsValue_setOctetString(owner, rc->rcb->clientReservation + 1, 16);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1539,10 +1554,15 @@ static void
|
|
|
|
|
checkReservationTimeout(MmsMapping* self, ReportControl* rc)
|
|
|
|
|
{
|
|
|
|
|
if (rc->enabled == false) {
|
|
|
|
|
if (rc->resvTms > 0) {
|
|
|
|
|
if (rc->reservationTimeout > 0) {
|
|
|
|
|
if (Hal_getTimeInMs() > rc->reservationTimeout) {
|
|
|
|
|
|
|
|
|
|
if (rc->resvTms != -1)
|
|
|
|
|
rc->resvTms = 0;
|
|
|
|
|
|
|
|
|
|
if (DEBUG_IED_SERVER)
|
|
|
|
|
printf("IED_SERVER: reservation timeout expired for %s.%s\n", rc->parentLN->name, rc->name);
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1)
|
|
|
|
|
MmsValue* resvTmsVal = ReportControl_getRCBValue(rc, "ResvTms");
|
|
|
|
|
if (resvTmsVal)
|
|
|
|
@ -1696,7 +1716,6 @@ Reporting_RCBWriteAccessHandler(MmsMapping* self, ReportControl* rc, char* eleme
|
|
|
|
|
|
|
|
|
|
if (updateReportDataset(self, rc, NULL, connection)) {
|
|
|
|
|
|
|
|
|
|
if (rc->resvTms != -1)
|
|
|
|
|
updateOwner(rc, connection);
|
|
|
|
|
|
|
|
|
|
MmsValue* rptEna = ReportControl_getRCBValue(rc, "RptEna");
|
|
|
|
@ -1998,6 +2017,9 @@ exit_function:
|
|
|
|
|
|
|
|
|
|
reserveRcb(rc, connection);
|
|
|
|
|
}
|
|
|
|
|
else if (rc->resvTms == -1) {
|
|
|
|
|
reserveRcb(rc, connection);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_IEC61850_SERVICE_TRACKING == 1)
|
|
|
|
|