- changed TimeOfEntry to TimeofEntry for Buffered reporting to deal with "bug" in 8-1 specification

- deal with SE/SG in SCL file -> SE will automatically create SG attribute in data model
- added wildcard "*" support to file service
- fixed problem with filesystem file modification date on embedded linux syste,
This commit is contained in:
Michael Zillgith 2015-08-13 08:08:31 +02:00
parent f024528d85
commit 2e24ecb4eb
9 changed files with 25 additions and 6 deletions

View file

@ -201,7 +201,7 @@ prepareGooseBuffer(GoosePublisher self, CommParameters* parameters, const char*
int bufPos = 12;
#if 1
#if 0
/* Priority tag - IEEE 802.1Q */
self->buffer[bufPos++] = 0x81;
self->buffer[bufPos++] = 0x00;

View file

@ -131,8 +131,8 @@ FileSystem_getFileInfo(char* filename, uint32_t* fileSize, uint64_t* lastModific
return false;
if (lastModificationTimestamp != NULL)
*lastModificationTimestamp = fileStats.st_mtime * 1000;
// does not work on older systems --> *lastModificationTimestamp = fileStats.st_ctim.tv_sec * 1000;
*lastModificationTimestamp = (uint64_t) (fileStats.st_mtime) * 1000LL;
// does not work on older systems --> *lastModificationTimestamp = (uint64_t) (fileStats.st_ctim.tv_sec) * 1000LL;
if (fileSize != NULL)
*fileSize = fileStats.st_size;

View file

@ -611,7 +611,7 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
if (!isBuffered)
goto error_invalid_parameter;
strcpy(itemId + itemIdLen, "$TimeOfEntry");
strcpy(itemId + itemIdLen, "$TimeofEntry");
LinkedList_add(itemIds, copyString(itemId));
LinkedList_add(values, rcb->timeOfEntry);

View file

@ -214,7 +214,7 @@ ReportControl_getRCBValue(ReportControl* rc, char* elementName)
return MmsValue_getElement(rc->rcbValues, 10);
else if (strcmp(elementName, "EntryID") == 0)
return MmsValue_getElement(rc->rcbValues, 11);
else if (strcmp(elementName, "TimeOfEntry") == 0)
else if (strcmp(elementName, "TimeofEntry") == 0)
return MmsValue_getElement(rc->rcbValues, 12);
else if (strcmp(elementName, "ResvTms") == 0)
return MmsValue_getElement(rc->rcbValues, 13);
@ -949,7 +949,7 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
mmsValue->value.structure.components[11] = MmsValue_newOctetString(8, 8);
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
namedVariable->name = copyString("TimeOfEntry");
namedVariable->name = copyString("TimeofEntry");
namedVariable->type = MMS_BINARY_TIME;
namedVariable->typeSpec.binaryTime = 6;
rcb->typeSpec.structure.elements[12] = namedVariable;

View file

@ -532,6 +532,9 @@ createFileDirectoryResponse(uint32_t invokeId, ByteBuffer* response, char* direc
FileSystem_closeDirectory(directory);
}
else {
//TODO check if it is a directory
if (DEBUG_MMS_SERVER)
printf("Error opening directory!\n");
@ -678,6 +681,10 @@ mmsServer_handleFileDirectoryRequest(
case 0xa0: /* filename */
if (!parseFileName(filename, buffer, &bufPos, bufPos + length, invokeId, response))
return;
/* check for wildcard character(*) */
if (strcmp(filename, "*") == 0) filename[0] = 0;
break;
case 0xa1: /* continue-after */

Binary file not shown.

Binary file not shown.

View file

@ -62,6 +62,9 @@ public class DataAttribute implements DataModelNode {
if (this.fc == null)
this.fc = fc;
if (fc != null)
this.fc = fc;
if ((parent != null) && (parent instanceof DataAttribute))
this.triggerOptions = ((DataAttribute) parent).getTriggerOptions();
else

View file

@ -81,7 +81,16 @@ public class DataObject implements DataModelNode {
daDefinitions = ((DataAttributeType) sclType).getSubDataAttributes();
for (DataAttributeDefinition daDefinition : daDefinitions) {
if (daDefinition.getFc() == FunctionalConstraint.SE) {
System.out.println("Add SG DA for corresponding SE DA: ");
this.dataAttributes.add(new DataAttribute(daDefinition, typeDeclarations, FunctionalConstraint.SG, this));
}
this.dataAttributes.add(new DataAttribute(daDefinition, typeDeclarations, null, this));
}
}