- 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" #define CONFIG_DEFAULT_MMS_REVISION "0.9.1"
/* MMS virtual file store base path - where file services are looking for files */ /* 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) */ /* Maximum number of open file per MMS connection (for MMS file read service) */
#define CONFIG_MMS_MAX_NUMBER_OF_OPEN_FILES_PER_CONNECTION 5 #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(); IedConnection con = IedConnection_create();
MmsConnection mmsCon = IedConnection_getMmsConnection(con);
MmsConnection_setLocalDetail(mmsCon, 800);
IedConnection_connect(con, &error, hostname, tcpPort); IedConnection_connect(con, &error, hostname, tcpPort);
if (error == IED_ERROR_OK) { if (error == IED_ERROR_OK) {

@ -459,15 +459,15 @@ addFileEntriesToResponse(uint8_t* buffer, int bufPos, int maxBufSize, char* dire
if (isDirectory) { if (isDirectory) {
bufPos = addFileEntriesToResponse(buffer, bufPos, maxBufSize, directoryName, continueAfterFileName, moreFollows); bufPos = addFileEntriesToResponse(buffer, bufPos, maxBufSize, directoryName, continueAfterFileName, moreFollows);
if (*moreFollows == true)
break;
} }
else { else {
bufPos = addFileEntriesToResponse(buffer, bufPos, maxBufSize, directoryName, continueAfterFileName, moreFollows); bufPos = addFileEntriesToResponse(buffer, bufPos, maxBufSize, directoryName, continueAfterFileName, moreFollows);
} }
if (*moreFollows == true)
break;
fileName = FileSystem_readDirectory(directory, &isDirectory); fileName = FileSystem_readDirectory(directory, &isDirectory);
} }
@ -503,13 +503,14 @@ addFileEntriesToResponse(uint8_t* buffer, int bufPos, int maxBufSize, char* dire
if (overallEntrySize > bufferSpaceLeft) { if (overallEntrySize > bufferSpaceLeft) {
*moreFollows = true; *moreFollows = true;
//break;
} }
else {
bufPos = BerEncoder_encodeTL(0x30, dirEntrySize, buffer, bufPos); /* SEQUENCE (DirectoryEntry) */ bufPos = BerEncoder_encodeTL(0x30, dirEntrySize, buffer, bufPos); /* SEQUENCE (DirectoryEntry) */
bufPos = encodeFileSpecification(0xa0, directoryName, buffer, bufPos); /* fileName */ bufPos = encodeFileSpecification(0xa0, directoryName, buffer, bufPos); /* fileName */
bufPos = encodeFileAttributes(0xa1, fileSize, gtString, buffer, bufPos); /* file attributes */ bufPos = encodeFileAttributes(0xa1, fileSize, gtString, buffer, bufPos); /* file attributes */
} }
}
else else
bufPos = -1; bufPos = -1;

Loading…
Cancel
Save