- fixed problem with max PDU size for GetFileDirectory service

pull/6/head
Michael Zillgith 10 years ago
parent eab59b8ae8
commit 27a74db4d8

@ -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

@ -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) {

@ -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,13 +503,14 @@ 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 */
}
}
else
bufPos = -1;

Loading…
Cancel
Save