From 842331322a646eb3a34209eb393c2b83f07d5b95 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 29 Apr 2016 16:35:31 +0200 Subject: [PATCH] - removed mms_access_result.h --- CHANGELOG | 1 + src/doxygen.config | 2 +- src/mms/inc_private/mms_access_result.h | 29 ------------------- src/mms/inc_private/mms_common_internal.h | 4 --- src/mms/iso_mms/server/mms_access_result.c | 24 ++++++++------- .../iso_mms/server/mms_information_report.c | 1 - src/mms/iso_mms/server/mms_read_service.c | 2 -- src/vs/libiec61850-wo-goose.def | 2 ++ src/vs/libiec61850.def | 5 ++-- 9 files changed, 20 insertions(+), 50 deletions(-) delete mode 100644 src/mms/inc_private/mms_access_result.h diff --git a/CHANGELOG b/CHANGELOG index 280c5def..ba7c406e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ Changes to version 0.9.1 ------------------------ +- added functions MmsValue_encodeMmsData, MmsValue_decodeMmsData to serialize/deserialize MmsValue objects to BER encoded MMS Data - changed signature of IedConnection_deleteDataSet, MmsConnection_deleteAssociationSpecificNamedVariableList, MmsConnection_deleteNamedVariableList. added boolean return value to indicate if data set/named variable list has been deleted. Changes to version 0.9.0.2 diff --git a/src/doxygen.config b/src/doxygen.config index 18664637..31522e54 100644 --- a/src/doxygen.config +++ b/src/doxygen.config @@ -20,7 +20,7 @@ PROJECT_NAME = "libIEC61850" PROJECT_NUMBER = 0.9.1 -PROJECT_BRIEF = "Open-source IEC 61850 MMS/GOOSE server and client library" +PROJECT_BRIEF = "Open-source IEC 61850 MMS/GOOSE/SV server and client library" # With the PROJECT_LOGO tag one can specify an logo or icon that is # included in the documentation. The maximum height of the logo should not diff --git a/src/mms/inc_private/mms_access_result.h b/src/mms/inc_private/mms_access_result.h deleted file mode 100644 index 3fbcbeb9..00000000 --- a/src/mms/inc_private/mms_access_result.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * mms_access_result.h - * - * Copyright 2013 Michael Zillgith - * - * This file is part of libIEC61850. - * - * libIEC61850 is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * libIEC61850 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with libIEC61850. If not, see . - * - * See COPYING file for the complete license text. - */ - -#ifndef MMS_ACCESS_RESULT_H_ -#define MMS_ACCESS_RESULT_H_ - -#include "mms_value.h" - -#endif /* MMS_ACCESS_RESULT_H_ */ diff --git a/src/mms/inc_private/mms_common_internal.h b/src/mms/inc_private/mms_common_internal.h index 3d493873..f895e601 100644 --- a/src/mms/inc_private/mms_common_internal.h +++ b/src/mms/inc_private/mms_common_internal.h @@ -26,12 +26,8 @@ #include "mms_value.h" #include "MmsPdu.h" -#include "mms_access_result.h" #include "conversions.h" - - - MmsValue* mmsMsg_parseDataElement(Data_t* dataElement); diff --git a/src/mms/iso_mms/server/mms_access_result.c b/src/mms/iso_mms/server/mms_access_result.c index 38bf4362..0fe13d16 100644 --- a/src/mms/iso_mms/server/mms_access_result.c +++ b/src/mms/iso_mms/server/mms_access_result.c @@ -22,7 +22,6 @@ */ #include "libiec61850_platform_includes.h" -#include "mms_access_result.h" #include "mms_server_internal.h" #include "mms_value_internal.h" @@ -148,8 +147,8 @@ exit_with_error: return -1; } -static MmsValue* -decodeData(uint8_t* buffer, int bufPos, int bufferLength) +MmsValue* +MmsValue_decodeMmsData(uint8_t* buffer, int bufPos, int bufferLength) { int dataEndBufPos = bufPos + bufferLength; @@ -188,7 +187,7 @@ decodeData(uint8_t* buffer, int bufPos, int bufferLength) if (newBufPos == -1) goto exit_with_error; - MmsValue* elementValue = decodeData(buffer, bufPos, dataLength); + MmsValue* elementValue = MmsValue_decodeMmsData(buffer, bufPos, dataLength); if (elementValue == NULL) goto exit_with_error; @@ -204,6 +203,11 @@ decodeData(uint8_t* buffer, int bufPos, int bufferLength) break; + case 0x80: /* MMS_DATA_ACCESS_ERROR */ + value = MmsValue_newDataAccessError((MmsDataAccessError) BerDecoder_decodeUint32(buffer, dataLength, bufPos)); + + break; + case 0x83: /* MMS_BOOLEAN */ value = MmsValue_newBoolean(BerDecoder_decodeBoolean(buffer, bufPos)); @@ -257,6 +261,12 @@ decodeData(uint8_t* buffer, int bufPos, int bufferLength) break; + case 0x90: /* MMS_STRING */ + value = MmsValue_newVisibleStringFromByteArray(buffer + bufPos, dataLength); + value->type = MMS_STRING; + + break; + case 0x91: /* MMS_UTC_TIME */ if (dataLength == 8) { value = MmsValue_newUtcTime(0); @@ -281,12 +291,6 @@ exit_with_error: return NULL; } -MmsValue* -MmsValue_decodeMmsData(uint8_t* buffer, int bufPos, int bufferLength) -{ - return decodeData(buffer, bufPos, bufferLength); -} - int MmsValue_encodeMmsData(MmsValue* self, uint8_t* buffer, int bufPos, bool encode) { diff --git a/src/mms/iso_mms/server/mms_information_report.c b/src/mms/iso_mms/server/mms_information_report.c index 50567bb7..ec014b8e 100644 --- a/src/mms/iso_mms/server/mms_information_report.c +++ b/src/mms/iso_mms/server/mms_information_report.c @@ -25,7 +25,6 @@ #include "mms_server_internal.h" #include "mms_common_internal.h" -#include "mms_access_result.h" #include "ber_encoder.h" diff --git a/src/mms/iso_mms/server/mms_read_service.c b/src/mms/iso_mms/server/mms_read_service.c index 8a7c7687..cfe2af9c 100644 --- a/src/mms/iso_mms/server/mms_read_service.c +++ b/src/mms/iso_mms/server/mms_read_service.c @@ -27,8 +27,6 @@ #include "mms_common_internal.h" #include "mms_value_internal.h" -#include "mms_access_result.h" - #include "linked_list.h" #include "ber_encoder.h" diff --git a/src/vs/libiec61850-wo-goose.def b/src/vs/libiec61850-wo-goose.def index 5d45282d..06594bb8 100644 --- a/src/vs/libiec61850-wo-goose.def +++ b/src/vs/libiec61850-wo-goose.def @@ -524,4 +524,6 @@ EXPORTS MmsConnection_getMmsConnectionParameters IedServer_updateVisibleStringAttributeValue MmsValue_setUtcTimeQuality + MmsValue_decodeMmsData + MmsValue_encodeMmsData diff --git a/src/vs/libiec61850.def b/src/vs/libiec61850.def index b25c2219..73853692 100644 --- a/src/vs/libiec61850.def +++ b/src/vs/libiec61850.def @@ -598,7 +598,6 @@ EXPORTS CDC_SPV_create CDC_TMS_create MmsValue_getUtcTimeQuality - MmsConnection_getMmsConnectionParameters - IedServer_updateVisibleStringAttributeValue - MmsValue_setUtcTimeQuality + MmsValue_decodeMmsData + MmsValue_encodeMmsData