pull/179/head
Michael Zillgith 6 years ago
commit 4f59099c59

@ -31,8 +31,6 @@
#include "libiec61850_platform_includes.h"
#include <inttypes.h>
struct sClientReport
{
ReportCallbackFunction callback;
@ -462,7 +460,7 @@ iedConnection_handleReport(IedConnection self, MmsValue* value)
matchingReport->timestamp = MmsValue_getBinaryTimeAsUtcMs(timeStampValue);
if (DEBUG_IED_CLIENT)
printf("IED_CLIENT: report has timestamp %" PRIu64 "\n", matchingReport->timestamp);
printf("IED_CLIENT: report has timestamp %lu\n", matchingReport->timestamp);
inclusionIndex++;
}

@ -128,13 +128,13 @@ getState(IsoClientConnection self)
return stateVal;
}
static inline void
static void
setIntState(IsoClientConnection self, eIsoClientInternalState newState)
{
self->intState = newState;
}
static inline eIsoClientInternalState
static eIsoClientInternalState
getIntState(IsoClientConnection self)
{
return self->intState;

@ -48,13 +48,13 @@
static bool
addPayloadToBuffer(CotpConnection* self, uint8_t* buffer, int payloadLength);
static inline uint16_t
static uint16_t
getUint16(uint8_t* buffer)
{
return (buffer[0] * 0x100) + buffer[1];
}
static inline uint8_t
static uint8_t
getUint8(uint8_t* buffer)
{
return buffer[0];
@ -115,7 +115,7 @@ getOptionsLength(CotpConnection* self)
return optionsLength;
}
static inline void
static void
writeStaticConnectResponseHeader(CotpConnection* self, int optionsLength)
{
/* always same size (7) and same position in buffer */
@ -161,7 +161,7 @@ writeDataTpduHeader(CotpConnection* self, int isLastUnit)
self->writeBuffer->size = 7;
}
static inline int
static int
writeToSocket(CotpConnection* self, uint8_t* buf, int size)
{
#if (CONFIG_MMS_SUPPORT_TLS == 1)
@ -659,7 +659,7 @@ CotpConnection_resetPayload(CotpConnection* self)
}
static inline int
static int
readFromSocket(CotpConnection* self, uint8_t* buf, int size)
{
#if (CONFIG_MMS_SUPPORT_TLS == 1)

@ -36,7 +36,7 @@
#include <time.h> /* for ctime_r */
static inline int
static int
bitStringByteSize(const MmsValue* value)
{
int bitSize = value->value.bitString.size;
@ -1492,7 +1492,7 @@ exit_function:
return self;
}
static inline void
static void
setVisibleStringValue(MmsValue* self, const char* string)
{
if (self->value.visibleString.buf != NULL) {

@ -532,8 +532,12 @@ mmsServer_fileUploadTask(MmsServer self, MmsObtainFileTask task)
IsoConnection_sendMessage(task->connection->isoConnection, response, false);
FileSystem_closeFile(task->fileHandle);
deleteFile(MmsServerConnection_getFilesystemBasepath(task->connection), task->destinationFilename);
if (task->fileHandle) {
FileSystem_closeFile(task->fileHandle);
if (task->destinationFilename)
deleteFile(MmsServerConnection_getFilesystemBasepath(task->connection), task->destinationFilename);
}
MmsServer_releaseTransmitBuffer(self);
@ -657,15 +661,16 @@ mmsServer_handleObtainFileRequest(
FileHandle fileHandle = openFile(MmsServerConnection_getFilesystemBasepath(connection),
destinationFilename, true);
task->connection = connection;
task->obtainFileRequestInvokeId = invokeId;
if (fileHandle == NULL) {
task->state = MMS_FILE_UPLOAD_STATE_SEND_OBTAIN_FILE_ERROR_DESTINATION;
}
else {
/* send file open request */
task->lastRequestInvokeId = MmsServerConnection_getNextRequestInvokeId(connection);
task->connection = connection;
task->fileHandle = fileHandle;
task->obtainFileRequestInvokeId = invokeId;
strcpy(task->destinationFilename, destinationFilename);

Loading…
Cancel
Save