From 348273a1c84663bfde2a94db451c387cf2af0200 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Mon, 16 Nov 2015 11:31:14 +0100 Subject: [PATCH] - fixed bug: GOOSE minTime, maxTime are ignored by GOOSE publisher when set by GSEControlBlock_create. Instead default values from stack_config.h are always used --- .../server_example_dynamic.c | 2 ++ src/iec61850/server/mms_mapping/mms_goose.c | 26 +++++++------------ src/sampled_values/sv_subscriber.h | 3 ++- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/examples/server_example_dynamic/server_example_dynamic.c b/examples/server_example_dynamic/server_example_dynamic.c index 49dccbc1..1d01c40a 100644 --- a/examples/server_example_dynamic/server_example_dynamic.c +++ b/examples/server_example_dynamic/server_example_dynamic.c @@ -57,6 +57,8 @@ int main(int argc, char** argv) { ReportControlBlock_create("events01", lln0, "events01", false, NULL, 1, TRG_OPT_DATA_CHANGED, rptOptions, 50, 0); ReportControlBlock_create("events02", lln0, "events02", false, NULL, 1, TRG_OPT_DATA_CHANGED, rptOptions, 50, 0); + GSEControlBlock_create("gse01", lln0, "events01", "events", 1, false, 200, 3000); + /********************* * run server ********************/ diff --git a/src/iec61850/server/mms_mapping/mms_goose.c b/src/iec61850/server/mms_mapping/mms_goose.c index 4df30eba..dafc5188 100644 --- a/src/iec61850/server/mms_mapping/mms_goose.c +++ b/src/iec61850/server/mms_mapping/mms_goose.c @@ -305,24 +305,20 @@ MmsGooseControlBlock_checkAndPublish(MmsGooseControlBlock self, uint64_t current GoosePublisher_publish(self->publisher, self->dataSetValues); if (self->retransmissionsLeft > 0) { - self->nextPublishTime = currentTime + CONFIG_GOOSE_EVENT_RETRANSMISSION_INTERVAL; + self->nextPublishTime = currentTime + self->minTime; if (self->retransmissionsLeft > 1) - GoosePublisher_setTimeAllowedToLive(self->publisher, - CONFIG_GOOSE_EVENT_RETRANSMISSION_INTERVAL * 3); + GoosePublisher_setTimeAllowedToLive(self->publisher, self->minTime * 3); else - GoosePublisher_setTimeAllowedToLive(self->publisher, - CONFIG_GOOSE_STABLE_STATE_TRANSMISSION_INTERVAL * 3); + GoosePublisher_setTimeAllowedToLive(self->publisher, self->maxTime * 3); self->retransmissionsLeft--; } else { - GoosePublisher_setTimeAllowedToLive(self->publisher, - CONFIG_GOOSE_STABLE_STATE_TRANSMISSION_INTERVAL * 3); + GoosePublisher_setTimeAllowedToLive(self->publisher, self->maxTime * 3); - self->nextPublishTime = currentTime + - CONFIG_GOOSE_STABLE_STATE_TRANSMISSION_INTERVAL; + self->nextPublishTime = currentTime + self->maxTime; } #if (CONFIG_MMS_THREADLESS_STACK != 1) @@ -343,18 +339,14 @@ MmsGooseControlBlock_observedObjectChanged(MmsGooseControlBlock self) self->retransmissionsLeft = CONFIG_GOOSE_EVENT_RETRANSMISSION_COUNT; if (self->retransmissionsLeft > 0) { - self->nextPublishTime = currentTime + - CONFIG_GOOSE_EVENT_RETRANSMISSION_INTERVAL; + self->nextPublishTime = currentTime + self->minTime; - GoosePublisher_setTimeAllowedToLive(self->publisher, - CONFIG_GOOSE_EVENT_RETRANSMISSION_INTERVAL * 3); + GoosePublisher_setTimeAllowedToLive(self->publisher, self->minTime * 3); } else { - self->nextPublishTime = currentTime + - CONFIG_GOOSE_STABLE_STATE_TRANSMISSION_INTERVAL; + self->nextPublishTime = currentTime + self->maxTime; - GoosePublisher_setTimeAllowedToLive(self->publisher, - CONFIG_GOOSE_STABLE_STATE_TRANSMISSION_INTERVAL * 3); + GoosePublisher_setTimeAllowedToLive(self->publisher, self->maxTime * 3); } GoosePublisher_publish(self->publisher, self->dataSetValues); diff --git a/src/sampled_values/sv_subscriber.h b/src/sampled_values/sv_subscriber.h index a72075e1..282eb3f4 100644 --- a/src/sampled_values/sv_subscriber.h +++ b/src/sampled_values/sv_subscriber.h @@ -72,7 +72,8 @@ extern "C" { * | BITSTRING | 4 byte | * * The SV subscriber API can be used independent of the IEC 61850 client API. In order to access the SVCB via MMS you - * have to use the IEC 61850 client API. Please see \ref ClientSVControlBlock object in section \ref IEC61850_CLIENT_SV . + * have to use the IEC 61850 client API. Please see \ref ClientSVControlBlock object in section \ref IEC61850_CLIENT_SV. + * */ /**@{*/