- fixed bug in report timestamp in buffered reporting: was using UTC_TIME instead of BINARY_TIME

pull/6/head
Michael Zillgith 10 years ago
parent f5c5fa7fb4
commit 4c0466c858

@ -18,7 +18,7 @@
#define DEBUG_ISO_SERVER 0 #define DEBUG_ISO_SERVER 0
#define DEBUG_ISO_CLIENT 0 #define DEBUG_ISO_CLIENT 0
#define DEBUG_IED_SERVER 0 #define DEBUG_IED_SERVER 0
#define DEBUG_IED_CLIENT 1 #define DEBUG_IED_CLIENT 0
#define DEBUG_MMS_CLIENT 0 #define DEBUG_MMS_CLIENT 0
#define DEBUG_MMS_SERVER 0 #define DEBUG_MMS_SERVER 0
#define DEBUG_GOOSE_SUBSCRIBER 0 #define DEBUG_GOOSE_SUBSCRIBER 0

@ -372,6 +372,8 @@ namespace IEC61850
IedConnection_setRCBValues (connection, out error, self, parametersMask, singleRequest); IedConnection_setRCBValues (connection, out error, self, parametersMask, singleRequest);
resetSendFlags();
if (error != 0) if (error != 0)
throw new IedConnectionException ("setRCBValues service failed", error); throw new IedConnectionException ("setRCBValues service failed", error);
@ -382,8 +384,6 @@ namespace IEC61850
InstallReportHandler(this.reportHandler, this.reportHandlerParameter); InstallReportHandler(this.reportHandler, this.reportHandlerParameter);
} }
} }
resetSendFlags();
} }
/// <summary> /// <summary>

@ -397,11 +397,15 @@ private_IedConnection_handleReport(IedConnection self, MmsValue* value)
/* has report-timestamp */ /* has report-timestamp */
if (MmsValue_getBitStringBit(optFlds, 2) == true) { if (MmsValue_getBitStringBit(optFlds, 2) == true) {
MmsValue* timeStampValue = MmsValue_getElement(value, inclusionIndex); MmsValue* timeStampValue = MmsValue_getElement(value, inclusionIndex);
if (MmsValue_getType(timeStampValue) == MMS_BINARY_TIME) { if (MmsValue_getType(timeStampValue) == MMS_BINARY_TIME) {
matchingReport->hasTimestamp = true; matchingReport->hasTimestamp = true;
matchingReport->timestamp = MmsValue_getBinaryTimeAsUtcMs(timeStampValue); matchingReport->timestamp = MmsValue_getBinaryTimeAsUtcMs(timeStampValue);
if (DEBUG_IED_CLIENT)
printf("DEBUG_IED_CLIENT: report has timestamp %llu\n", matchingReport->timestamp);
} }
inclusionIndex++; inclusionIndex++;

@ -1178,6 +1178,8 @@ checkReportBufferForEntryID(ReportControl* rc, MmsValue* value)
retVal = true; retVal = true;
break; break;
} }
entry = entry->next;
} }
return retVal; return retVal;
@ -2002,8 +2004,10 @@ sendNextReportEntry(ReportControl* self)
if (timeOfEntry == NULL) goto return_out_of_memory; if (timeOfEntry == NULL) goto return_out_of_memory;
timeOfEntry->deleteValue = 0; timeOfEntry->deleteValue = 0;
timeOfEntry->type = MMS_UTC_TIME; timeOfEntry->type = MMS_BINARY_TIME;
MmsValue_setUtcTimeMs(timeOfEntry, report->timeOfEntry); timeOfEntry->value.binaryTime.size = 6;
MmsValue_setBinaryTime(timeOfEntry, report->timeOfEntry);
if (MemAllocLinkedList_add(reportElements, timeOfEntry) == NULL) if (MemAllocLinkedList_add(reportElements, timeOfEntry) == NULL)
goto return_out_of_memory; goto return_out_of_memory;

Loading…
Cancel
Save