- some code formatting

pull/93/head
Michael Zillgith 7 years ago
parent 46437cdbe1
commit ed75aa3f46

@ -1,7 +1,7 @@
/* /*
* iso_connection_parameters.h * iso_connection_parameters.h
* *
* Copyright 2013, 2014 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *
@ -37,7 +37,7 @@ extern "C" {
/** /**
* \brief authentication mechanism úsed by AcseAuthenticator * \brief authentication mechanism used by AcseAuthenticator
*/ */
typedef enum typedef enum
{ {
@ -154,7 +154,7 @@ typedef struct sIsoConnectionParameters* IsoConnectionParameters;
* NOTE: This function used internally by the MMS client library. When using the MMS or IEC 61850 API * NOTE: This function used internally by the MMS client library. When using the MMS or IEC 61850 API
* there should be no reason for the user to call this function. * there should be no reason for the user to call this function.
* *
* \return new IsoConnectionParameters * \return new IsoConnectionParameters instance
*/ */
LIB61850_API IsoConnectionParameters LIB61850_API IsoConnectionParameters
IsoConnectionParameters_create(void); IsoConnectionParameters_create(void);

@ -1,7 +1,7 @@
/* /*
* acse.h * acse.h
* *
* Copyright 2013 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *

@ -1,7 +1,7 @@
/* /*
* cotp.h * cotp.h
* *
* Copyright 2013, 2014 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *

@ -1,7 +1,7 @@
/* /*
* ise_session.h * ise_session.h
* *
* Copyright 2013 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *

@ -42,16 +42,6 @@
#define DEBUG_MMS_CLIENT 0 #define DEBUG_MMS_CLIENT 0
#endif #endif
#if 0
typedef enum {
MMS_CON_IDLE,
MMS_CON_WAITING,
MMS_CON_ASSOCIATION_FAILED,
MMS_CON_ASSOCIATED,
MMS_CON_RESPONSE_PENDING
} ConnectionState;
#endif
#define CONCLUDE_STATE_CONNECTION_ACTIVE 0 #define CONCLUDE_STATE_CONNECTION_ACTIVE 0
#define CONCLUDE_STATE_REQUESTED 1 #define CONCLUDE_STATE_REQUESTED 1
#define CONCLUDE_STATE_REJECTED 2 #define CONCLUDE_STATE_REJECTED 2
@ -236,8 +226,7 @@ mmsClient_createGetNamedVariableListAttributesRequestAssociationSpecific(uint32_
ByteBuffer* writeBuffer, const char* listNameId); ByteBuffer* writeBuffer, const char* listNameId);
LIB61850_INTERNAL LinkedList LIB61850_INTERNAL LinkedList
mmsClient_parseGetNamedVariableListAttributesResponse(ByteBuffer* message, uint32_t* invokeId, mmsClient_parseGetNamedVariableListAttributesResponse(ByteBuffer* message, bool* /*OUT*/ deletable);
bool* /*OUT*/ deletable);
LIB61850_INTERNAL int LIB61850_INTERNAL int
mmsClient_createGetVariableAccessAttributesRequest( mmsClient_createGetVariableAccessAttributesRequest(

@ -1,7 +1,7 @@
/* /*
* mms_common_internal.h * mms_common_internal.h
* *
* Copyright 2013, 2014, 2015 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *
@ -77,6 +77,7 @@ LIB61850_INTERNAL FileHandle
mmsMsg_openFile(const char* basepath, char* fileName, bool readWrite); mmsMsg_openFile(const char* basepath, char* fileName, bool readWrite);
#endif /* (MMS_FILE_SERVICE == 1) */ #endif /* (MMS_FILE_SERVICE == 1) */
typedef struct sMmsServiceError typedef struct sMmsServiceError
{ {
int errorClass; int errorClass;

@ -1,7 +1,7 @@
/* /*
* mms_server_internal.h * mms_server_internal.h
* *
* Copyright 2013, 2014 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *

@ -1,7 +1,7 @@
/* /*
* mms_value_cache.h * mms_value_cache.h
* *
* Copyright 2013 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *

@ -96,6 +96,7 @@ handleUnconfirmedMmsPdu(MmsConnection self, ByteBuffer* message)
{ {
int nameSize = int nameSize =
report->variableAccessSpecification.choice.variableListName.choice.vmdspecific.size; report->variableAccessSpecification.choice.variableListName.choice.vmdspecific.size;
uint8_t* buffer = uint8_t* buffer =
report->variableAccessSpecification.choice.variableListName.choice.vmdspecific.buf; report->variableAccessSpecification.choice.variableListName.choice.vmdspecific.buf;
@ -158,7 +159,7 @@ handleUnconfirmedMmsPdu(MmsConnection self, ByteBuffer* message)
self->reportHandler(self->reportHandlerParameter, domainId, variableListName, self->reportHandler(self->reportHandlerParameter, domainId, variableListName,
value, false); value, false);
/* report handler should have deleted the MmsValue! */ /* report handler is responsible to delete the MmsValue object */
if (variableSpecSize != 1) if (variableSpecSize != 1)
MmsValue_setElement(values, i, NULL); MmsValue_setElement(values, i, NULL);
else else
@ -176,7 +177,7 @@ handleUnconfirmedMmsPdu(MmsConnection self, ByteBuffer* message)
report->variableAccessSpecification.choice.listOfVariable.list.array[i] report->variableAccessSpecification.choice.listOfVariable.list.array[i]
->variableSpecification.choice.name.choice.domainspecific.itemId.size; ->variableSpecification.choice.name.choice.domainspecific.itemId.size;
if (domainNameSize < 65 && itemNameSize < 65) { if ((domainNameSize < 65) && (itemNameSize < 65)) {
char domainNameStr[65]; char domainNameStr[65];
char itemNameStr[65]; char itemNameStr[65];
@ -201,7 +202,7 @@ handleUnconfirmedMmsPdu(MmsConnection self, ByteBuffer* message)
self->reportHandler(self->reportHandlerParameter, domainNameStr, itemNameStr, self->reportHandler(self->reportHandlerParameter, domainNameStr, itemNameStr,
value, false); value, false);
/* report handler should have deleted the MmsValue! */ /* report handler is responsible to delete the MmsValue object */
if (variableSpecSize != 1) if (variableSpecSize != 1)
MmsValue_setElement(values, i, NULL); MmsValue_setElement(values, i, NULL);
else else
@ -323,6 +324,10 @@ sendMessage(MmsConnection self, ByteBuffer* message)
} }
#endif /* (CONFIG_MMS_RAW_MESSAGE_LOGGING == 1) */ #endif /* (CONFIG_MMS_RAW_MESSAGE_LOGGING == 1) */
#if (CONFIG_MMS_COLLECT_STATISTICS == 1)
self->statAplMessagesSent++;
#endif
IsoClientConnection_sendMessage(self->isoClient, message); IsoClientConnection_sendMessage(self->isoClient, message);
} }
@ -549,6 +554,7 @@ mmsMsg_parseConfirmedErrorPDU(uint8_t* buffer, int bufPos, int maxBufPos, uint32
tag = buffer[bufPos++]; tag = buffer[bufPos++];
bufPos = BerDecoder_decodeLength(buffer, &length, bufPos, maxBufPos); bufPos = BerDecoder_decodeLength(buffer, &length, bufPos, maxBufPos);
if (bufPos < 0) if (bufPos < 0)
goto exit_error; goto exit_error;
@ -575,7 +581,7 @@ mmsMsg_parseConfirmedErrorPDU(uint8_t* buffer, int bufPos, int maxBufPos, uint32
return bufPos; return bufPos;
exit_error: exit_error:
if (DEBUG_MMS_CLIENT) if (DEBUG_MMS_CLIENT)
printf("MMS_CLIENT: error parsing confirmed error PDU\n"); printf("MMS_CLIENT: error parsing confirmed error PDU\n");
@ -608,6 +614,7 @@ mmsMsg_parseRejectPDU(uint8_t* buffer, int bufPos, int maxBufPos, uint32_t* invo
tag = buffer[bufPos++]; tag = buffer[bufPos++];
bufPos = BerDecoder_decodeLength(buffer, &length, bufPos, maxBufPos); bufPos = BerDecoder_decodeLength(buffer, &length, bufPos, maxBufPos);
if (bufPos < 0) if (bufPos < 0)
goto exit_error; goto exit_error;
@ -717,7 +724,7 @@ handleAsyncResponse(MmsConnection self, ByteBuffer* response, uint32_t bufPos, M
if (response) { if (response) {
bool deletable = false; bool deletable = false;
LinkedList accessSpec = mmsClient_parseGetNamedVariableListAttributesResponse(response, NULL, &deletable); LinkedList accessSpec = mmsClient_parseGetNamedVariableListAttributesResponse(response, &deletable);
if (accessSpec == false) if (accessSpec == false)
err = MMS_ERROR_PARSING_RESPONSE; err = MMS_ERROR_PARSING_RESPONSE;
@ -1061,6 +1068,7 @@ mmsIsoCallback(IsoIndication indication, void* parameter, ByteBuffer* payload)
} }
} }
else if (tag == 0xa2) { /* confirmed error PDU */ else if (tag == 0xa2) { /* confirmed error PDU */
if (DEBUG_MMS_CLIENT) if (DEBUG_MMS_CLIENT)
printf("MMS_CLIENT: Confirmed error PDU!\n"); printf("MMS_CLIENT: Confirmed error PDU!\n");
@ -1098,6 +1106,7 @@ mmsIsoCallback(IsoIndication indication, void* parameter, ByteBuffer* payload)
} }
} }
else if (tag == 0xa4) { /* reject PDU */ else if (tag == 0xa4) { /* reject PDU */
if (DEBUG_MMS_CLIENT) if (DEBUG_MMS_CLIENT)
printf("MMS_CLIENT: reject PDU!\n"); printf("MMS_CLIENT: reject PDU!\n");
@ -1714,11 +1723,15 @@ MmsConnection_abort(MmsConnection self, MmsError* mmsError)
success = true; success = true;
break; break;
} }
else {
Thread_sleep(10);
}
} }
} }
if (success == false) { if (success == false) {
IsoClientConnection_close(self->isoClient);
*mmsError = MMS_ERROR_SERVICE_TIMEOUT; *mmsError = MMS_ERROR_SERVICE_TIMEOUT;
} }
@ -1744,7 +1757,6 @@ concludeHandler(void* parameter, MmsError mmsError, bool success)
Semaphore_post(parameters->sem); Semaphore_post(parameters->sem);
} }
void void
MmsConnection_conclude(MmsConnection self, MmsError* mmsError) MmsConnection_conclude(MmsConnection self, MmsError* mmsError)
{ {
@ -2282,7 +2294,6 @@ exit_function:
return invokeId; return invokeId;
} }
MmsValue* MmsValue*
MmsConnection_readNamedVariableListValues(MmsConnection self, MmsError* mmsError, MmsConnection_readNamedVariableListValues(MmsConnection self, MmsError* mmsError,
const char* domainId, const char* listName, const char* domainId, const char* listName,
@ -2346,14 +2357,12 @@ exit_function:
return invokeId; return invokeId;
} }
MmsValue* MmsValue*
MmsConnection_readNamedVariableListValuesAssociationSpecific( MmsConnection_readNamedVariableListValuesAssociationSpecific(
MmsConnection self, MmsError* mmsError, MmsConnection self, MmsError* mmsError,
const char* listName, const char* listName,
bool specWithResult) bool specWithResult)
{ {
MmsValue* value = NULL; MmsValue* value = NULL;
MmsError err = MMS_ERROR_NONE; MmsError err = MMS_ERROR_NONE;
@ -2638,7 +2647,6 @@ exit_function:
return invokeId; return invokeId;
} }
void void
MmsConnection_defineNamedVariableListAssociationSpecific(MmsConnection self, MmsConnection_defineNamedVariableListAssociationSpecific(MmsConnection self,
MmsError* mmsError, const char* listName, LinkedList variableSpecs) MmsError* mmsError, const char* listName, LinkedList variableSpecs)
@ -2694,7 +2702,6 @@ exit_function:
return invokeId; return invokeId;
} }
bool bool
MmsConnection_deleteNamedVariableList(MmsConnection self, MmsError* mmsError, MmsConnection_deleteNamedVariableList(MmsConnection self, MmsError* mmsError,
const char* domainId, const char* listName) const char* domainId, const char* listName)
@ -4279,14 +4286,13 @@ void
MmsVariableAccessSpecification_destroy(MmsVariableAccessSpecification* self) MmsVariableAccessSpecification_destroy(MmsVariableAccessSpecification* self)
{ {
if (self->domainId != NULL) if (self->domainId != NULL)
GLOBAL_FREEMEM((void* ) self->domainId); GLOBAL_FREEMEM((void*) self->domainId);
if (self->itemId != NULL) if (self->itemId != NULL)
GLOBAL_FREEMEM((void* ) self->itemId); GLOBAL_FREEMEM((void*) self->itemId);
if (self->componentName != NULL) if (self->componentName != NULL)
GLOBAL_FREEMEM((void* ) self->componentName); GLOBAL_FREEMEM((void*) self->componentName);
GLOBAL_FREEMEM(self); GLOBAL_FREEMEM(self);
} }

@ -527,6 +527,7 @@ parseListOfDirectoryEntries(uint8_t* buffer, int bufPos, int maxBufPos, uint32_t
int length; int length;
bufPos = BerDecoder_decodeLength(buffer, &length, bufPos, maxBufPos); bufPos = BerDecoder_decodeLength(buffer, &length, bufPos, maxBufPos);
if (bufPos < 0) return false; if (bufPos < 0) return false;
int endPos = bufPos + length; int endPos = bufPos + length;

@ -1,7 +1,7 @@
/* /*
* mms_client_get_namelist.c * mms_client_get_namelist.c
* *
* Copyright 2013 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *
@ -121,6 +121,7 @@ mmsClient_parseGetNameListResponse(LinkedList* nameList, ByteBuffer* message)
uint8_t tag = buffer[bufPos++]; uint8_t tag = buffer[bufPos++];
if (tag == 0xa2) { if (tag == 0xa2) {
// TODO parse confirmed error PDU
goto exit_error; goto exit_error;
} }
if (tag != 0xa1) goto exit_error; if (tag != 0xa1) goto exit_error;

@ -1,7 +1,7 @@
/* /*
* mms_client_get_var_access.c * mms_client_get_var_access.c
* *
* Copyright 2013 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *
@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with libIEC61850. If not, see <http://www.gnu.org/licenses/>. * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
* *
* See COPYING file for the complete license text. * sSee COPYING file for the complete license text.
*/ */
#include "libiec61850_platform_includes.h" #include "libiec61850_platform_includes.h"

@ -250,7 +250,7 @@ parseNamedVariableAttributes(GetNamedVariableListAttributesResponse_t* response,
} }
LinkedList /* <MmsVariableAccessSpecification*> */ LinkedList /* <MmsVariableAccessSpecification*> */
mmsClient_parseGetNamedVariableListAttributesResponse(ByteBuffer* message, uint32_t* invokeId, bool* /*OUT*/deletable) mmsClient_parseGetNamedVariableListAttributesResponse(ByteBuffer* message, bool* /*OUT*/deletable)
{ {
MmsPdu_t* mmsPdu = 0; MmsPdu_t* mmsPdu = 0;
@ -262,12 +262,6 @@ mmsClient_parseGetNamedVariableListAttributesResponse(ByteBuffer* message, uint3
if (rval.code == RC_OK) { if (rval.code == RC_OK) {
if (mmsPdu->present == MmsPdu_PR_confirmedResponsePdu) { if (mmsPdu->present == MmsPdu_PR_confirmedResponsePdu) {
#if 0
//TODO remove
if (invokeId != NULL)
*invokeId = mmsClient_getInvokeId(&mmsPdu->choice.confirmedResponsePdu);
#endif
if (mmsPdu->choice.confirmedResponsePdu.confirmedServiceResponse.present == if (mmsPdu->choice.confirmedResponsePdu.confirmedServiceResponse.present ==
ConfirmedServiceResponse_PR_getNamedVariableListAttributes) ConfirmedServiceResponse_PR_getNamedVariableListAttributes)
{ {
@ -289,7 +283,7 @@ mmsClient_createDefineNamedVariableListRequest(
ByteBuffer* writeBuffer, ByteBuffer* writeBuffer,
const char* domainId, const char* domainId,
const char* listNameId, const char* listNameId,
LinkedList /*<MmsVariableSpecification*>*/listOfVariables, LinkedList /*<MmsVariableSpecification*>*/ listOfVariables,
bool associationSpecific) bool associationSpecific)
{ {
MmsPdu_t* mmsPdu = mmsClient_createConfirmedRequestPdu(invokeId); MmsPdu_t* mmsPdu = mmsClient_createConfirmedRequestPdu(invokeId);
@ -370,8 +364,7 @@ mmsClient_createDefineNamedVariableListRequest(
alternateAccess->list.array[0]->present = AlternateAccess__Member_PR_unnamed; alternateAccess->list.array[0]->present = AlternateAccess__Member_PR_unnamed;
alternateAccess->list.array[0]->choice.unnamed = (AlternateAccessSelection_t*) GLOBAL_CALLOC(1, sizeof(AlternateAccessSelection_t)); alternateAccess->list.array[0]->choice.unnamed = (AlternateAccessSelection_t*) GLOBAL_CALLOC(1, sizeof(AlternateAccessSelection_t));
alternateAccess->list.array[0]->choice.unnamed->present = alternateAccess->list.array[0]->choice.unnamed->present = AlternateAccessSelection_PR_selectAlternateAccess;
AlternateAccessSelection_PR_selectAlternateAccess;
alternateAccess->list.array[0]->choice.unnamed->choice.selectAlternateAccess.accessSelection.present = alternateAccess->list.array[0]->choice.unnamed->choice.selectAlternateAccess.accessSelection.present =
AlternateAccessSelection__selectAlternateAccess__accessSelection_PR_index; AlternateAccessSelection__selectAlternateAccess__accessSelection_PR_index;

@ -1,7 +1,7 @@
/* /*
* mms_client_read.c * mms_client_read.c
* *
* Copyright 2013 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *

@ -315,7 +315,6 @@ MmsValue*
MmsValue_newBitString(int bitSize) MmsValue_newBitString(int bitSize)
{ {
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue)); MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
;
if (self == NULL) if (self == NULL)
return NULL; return NULL;
@ -524,7 +523,6 @@ MmsValue*
MmsValue_newFloat(float variable) MmsValue_newFloat(float variable)
{ {
MmsValue* self = (MmsValue*) GLOBAL_MALLOC(sizeof(MmsValue)); MmsValue* self = (MmsValue*) GLOBAL_MALLOC(sizeof(MmsValue));
;
if (self == NULL) if (self == NULL)
return NULL; return NULL;
@ -587,7 +585,6 @@ MmsValue*
MmsValue_newIntegerFromInt8(int8_t integer) MmsValue_newIntegerFromInt8(int8_t integer)
{ {
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue)); MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
;
self->type = MMS_INTEGER; self->type = MMS_INTEGER;
self->value.integer = BerInteger_createFromInt32((int32_t) integer); self->value.integer = BerInteger_createFromInt32((int32_t) integer);
@ -599,7 +596,6 @@ MmsValue*
MmsValue_newIntegerFromInt16(int16_t integer) MmsValue_newIntegerFromInt16(int16_t integer)
{ {
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue)); MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
;
self->type = MMS_INTEGER; self->type = MMS_INTEGER;
self->value.integer = BerInteger_createFromInt32((int32_t) integer); self->value.integer = BerInteger_createFromInt32((int32_t) integer);
@ -833,7 +829,6 @@ MmsValue*
MmsValue_newUnsignedFromUint32(uint32_t integer) MmsValue_newUnsignedFromUint32(uint32_t integer)
{ {
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue)); MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
;
if (self == NULL) if (self == NULL)
return NULL; return NULL;
@ -848,7 +843,6 @@ MmsValue*
MmsValue_newIntegerFromInt64(int64_t integer) MmsValue_newIntegerFromInt64(int64_t integer)
{ {
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue)); MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
;
if (self == NULL) if (self == NULL)
return NULL; return NULL;
@ -914,8 +908,6 @@ MmsValue_toFloat(const MmsValue* self)
return val; return val;
} }
} }
else
printf("MmsValue_toFloat: conversion error. Wrong type!\n");
return 0.f; return 0.f;
} }
@ -1081,7 +1073,6 @@ MmsValue_cloneToBuffer(const MmsValue* self, uint8_t* destinationAddress)
return destinationAddress; return destinationAddress;
} }
// create a deep clone
MmsValue* MmsValue*
MmsValue_clone(const MmsValue* self) MmsValue_clone(const MmsValue* self)
{ {
@ -1168,7 +1159,7 @@ MmsValue_clone(const MmsValue* self)
break; break;
} }
exit_function: exit_function:
return newValue; return newValue;
} }
@ -1497,7 +1488,7 @@ MmsValue_newDefaultValue(const MmsVariableSpecification* typeSpec)
if (self != NULL) if (self != NULL)
self->deleteValue = 0; self->deleteValue = 0;
exit_function: exit_function:
return self; return self;
} }
@ -1526,7 +1517,7 @@ setVisibleStringValue(MmsValue* self, const char* string)
self->value.visibleString.buf[0] = 0; self->value.visibleString.buf[0] = 0;
} }
exit_function: exit_function:
return; return;
} }
@ -1559,7 +1550,7 @@ MmsValue_newString(const char* string, MmsType type)
setVisibleStringValue(self, string); setVisibleStringValue(self, string);
} }
exit_function: exit_function:
return self; return self;
} }
@ -1590,7 +1581,7 @@ MmsValue_newStringWithSize(int size, MmsType type)
self->value.visibleString.buf[0] = 0; self->value.visibleString.buf[0] = 0;
exit_function: exit_function:
return self; return self;
} }
@ -1715,8 +1706,7 @@ void
MmsValue_setMmsString(MmsValue* self, const char* string) MmsValue_setMmsString(MmsValue* self, const char* string)
{ {
if (self->type == MMS_STRING) { if (self->type == MMS_STRING) {
assert(self->value.visibleString.buf != NULL); if (self->value.visibleString.buf != NULL);
setVisibleStringValue(self, string); setVisibleStringValue(self, string);
} }
} }
@ -1740,7 +1730,7 @@ MmsValue_newStringFromByteArray(const uint8_t* byteArray, int size, MmsType type
self = NULL; self = NULL;
} }
exit_function: exit_function:
return self; return self;
} }
@ -1760,8 +1750,7 @@ void
MmsValue_setVisibleString(MmsValue* self, const char* string) MmsValue_setVisibleString(MmsValue* self, const char* string)
{ {
if (self->type == MMS_VISIBLE_STRING) { if (self->type == MMS_VISIBLE_STRING) {
assert(self->value.visibleString.buf != NULL); if (self->value.visibleString.buf != NULL);
setVisibleStringValue(self, string); setVisibleStringValue(self, string);
} }
} }
@ -1809,7 +1798,7 @@ MmsValue_newUtcTime(uint32_t timeval)
valueArray[3] = timeArray[3]; valueArray[3] = timeArray[3];
#endif #endif
exit_function: exit_function:
return self; return self;
} }
@ -1856,7 +1845,7 @@ MmsValue_createArray(MmsVariableSpecification* elementType, int size)
} }
} }
exit_function: exit_function:
return self; return self;
} }
@ -1883,7 +1872,7 @@ MmsValue_createEmptyArray(int size)
self->value.structure.components[i] = NULL; self->value.structure.components[i] = NULL;
} }
exit_function: exit_function:
return self; return self;
} }

@ -1,7 +1,7 @@
/* /*
* iso_presentation.c * iso_presentation.c
* *
* Copyright 2013 Michael Zillgith * Copyright 2013-2018 Michael Zillgith
* *
* This file is part of libIEC61850. * This file is part of libIEC61850.
* *

Loading…
Cancel
Save