|
|
@ -40,7 +40,7 @@
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
|
|
/* if not explicitly set by client "ResvTms" will be set to this value */
|
|
|
|
/* 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
|
|
|
|
#ifndef DEBUG_IED_SERVER
|
|
|
|
#define DEBUG_IED_SERVER 0
|
|
|
|
#define DEBUG_IED_SERVER 0
|
|
|
@ -1061,6 +1061,8 @@ Reporting_createMmsBufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$BR$",
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$BR$",
|
|
|
|
reportControlBlock->name);
|
|
|
|
reportControlBlock->name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rc->rcb = reportControlBlock;
|
|
|
|
|
|
|
|
|
|
|
|
namedVariable->typeSpec.structure.elements[currentReport] =
|
|
|
|
namedVariable->typeSpec.structure.elements[currentReport] =
|
|
|
|
createBufferedReportControlBlock(reportControlBlock, rc, self);
|
|
|
|
createBufferedReportControlBlock(reportControlBlock, rc, self);
|
|
|
|
|
|
|
|
|
|
|
@ -1101,6 +1103,8 @@ Reporting_createMmsUnbufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$RP$",
|
|
|
|
rc->name = StringUtils_createString(3, logicalNode->name, "$RP$",
|
|
|
|
reportControlBlock->name);
|
|
|
|
reportControlBlock->name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rc->rcb = reportControlBlock;
|
|
|
|
|
|
|
|
|
|
|
|
namedVariable->typeSpec.structure.elements[currentReport] =
|
|
|
|
namedVariable->typeSpec.structure.elements[currentReport] =
|
|
|
|
createUnbufferedReportControlBlock(reportControlBlock, rc);
|
|
|
|
createUnbufferedReportControlBlock(reportControlBlock, rc);
|
|
|
|
|
|
|
|
|
|
|
@ -1188,8 +1192,19 @@ updateOwner(ReportControl* rc, MmsServerConnection connection)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
uint8_t emptyAddr[1];
|
|
|
|
if (rc->resvTms != -1) {
|
|
|
|
MmsValue_setOctetString(owner, emptyAddr, 0);
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1253,9 +1268,14 @@ static void
|
|
|
|
checkReservationTimeout(ReportControl* rc)
|
|
|
|
checkReservationTimeout(ReportControl* rc)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (rc->enabled == false) {
|
|
|
|
if (rc->enabled == false) {
|
|
|
|
if (rc->resvTms > 0) {
|
|
|
|
if (rc->reservationTimeout > 0) {
|
|
|
|
if (Hal_getTimeInMs() > rc->reservationTimeout) {
|
|
|
|
if (Hal_getTimeInMs() > rc->reservationTimeout) {
|
|
|
|
rc->resvTms = 0;
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
#if (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1)
|
|
|
|
MmsValue* resvTmsVal = ReportControl_getRCBValue(rc, "ResvTms");
|
|
|
|
MmsValue* resvTmsVal = ReportControl_getRCBValue(rc, "ResvTms");
|
|
|
@ -1401,8 +1421,7 @@ Reporting_RCBWriteAccessHandler(MmsMapping* self, ReportControl* rc, char* eleme
|
|
|
|
|
|
|
|
|
|
|
|
if (updateReportDataset(self, rc, NULL, connection)) {
|
|
|
|
if (updateReportDataset(self, rc, NULL, connection)) {
|
|
|
|
|
|
|
|
|
|
|
|
if (rc->resvTms != -1)
|
|
|
|
updateOwner(rc, connection);
|
|
|
|
updateOwner(rc, connection);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MmsValue* rptEna = ReportControl_getRCBValue(rc, "RptEna");
|
|
|
|
MmsValue* rptEna = ReportControl_getRCBValue(rc, "RptEna");
|
|
|
|
|
|
|
|
|
|
|
@ -1703,6 +1722,9 @@ exit_function:
|
|
|
|
|
|
|
|
|
|
|
|
reserveRcb(rc, connection);
|
|
|
|
reserveRcb(rc, connection);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (rc->resvTms == -1) {
|
|
|
|
|
|
|
|
reserveRcb(rc, connection);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ReportControl_unlockNotify(rc);
|
|
|
|
ReportControl_unlockNotify(rc);
|
|
|
|