diff --git a/config/stack_config.h b/config/stack_config.h index 3e900e11..a72ee180 100644 --- a/config/stack_config.h +++ b/config/stack_config.h @@ -159,7 +159,7 @@ #define CONFIG_DEFAULT_MMS_REVISION "0.9.1" /* MMS virtual file store base path - where file services are looking for files */ -#define CONFIG_VIRTUAL_FILESTORE_BASEPATH "./vmd-filestore/" +#define CONFIG_VIRTUAL_FILESTORE_BASEPATH "/home/root/vmd-filestore/" /* Maximum number of open file per MMS connection (for MMS file read service) */ #define CONFIG_MMS_MAX_NUMBER_OF_OPEN_FILES_PER_CONNECTION 5 diff --git a/examples/iec61850_client_example_files/client_example_files.c b/examples/iec61850_client_example_files/client_example_files.c index 33c6750b..7d369269 100644 --- a/examples/iec61850_client_example_files/client_example_files.c +++ b/examples/iec61850_client_example_files/client_example_files.c @@ -52,6 +52,10 @@ int main(int argc, char** argv) { IedConnection con = IedConnection_create(); + MmsConnection mmsCon = IedConnection_getMmsConnection(con); + + MmsConnection_setLocalDetail(mmsCon, 800); + IedConnection_connect(con, &error, hostname, tcpPort); if (error == IED_ERROR_OK) { diff --git a/src/mms/iso_mms/server/mms_file_service.c b/src/mms/iso_mms/server/mms_file_service.c index 9bf8b72a..582fb7cf 100644 --- a/src/mms/iso_mms/server/mms_file_service.c +++ b/src/mms/iso_mms/server/mms_file_service.c @@ -459,15 +459,15 @@ addFileEntriesToResponse(uint8_t* buffer, int bufPos, int maxBufSize, char* dire if (isDirectory) { bufPos = addFileEntriesToResponse(buffer, bufPos, maxBufSize, directoryName, continueAfterFileName, moreFollows); - - if (*moreFollows == true) - break; } else { bufPos = addFileEntriesToResponse(buffer, bufPos, maxBufSize, directoryName, continueAfterFileName, moreFollows); } + if (*moreFollows == true) + break; + fileName = FileSystem_readDirectory(directory, &isDirectory); } @@ -503,12 +503,13 @@ addFileEntriesToResponse(uint8_t* buffer, int bufPos, int maxBufSize, char* dire if (overallEntrySize > bufferSpaceLeft) { *moreFollows = true; - //break; } + else { - bufPos = BerEncoder_encodeTL(0x30, dirEntrySize, buffer, bufPos); /* SEQUENCE (DirectoryEntry) */ - bufPos = encodeFileSpecification(0xa0, directoryName, buffer, bufPos); /* fileName */ - bufPos = encodeFileAttributes(0xa1, fileSize, gtString, buffer, bufPos); /* file attributes */ + bufPos = BerEncoder_encodeTL(0x30, dirEntrySize, buffer, bufPos); /* SEQUENCE (DirectoryEntry) */ + bufPos = encodeFileSpecification(0xa0, directoryName, buffer, bufPos); /* fileName */ + bufPos = encodeFileAttributes(0xa1, fileSize, gtString, buffer, bufPos); /* file attributes */ + } } else bufPos = -1;