diff --git a/CHANGELOG b/CHANGELOG index bf84029b..ea68a97c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ Changes to version 1.0.1 ------------------------ +- server: fixed problem in COTP src/dst reference handling (returning zero src reference) +- client: fixed problem in report handling when RCB contains no rptID +- Python: added pyiec61850 tutorial and example thanks to Cédric Boudinet +- .NET API: fixed server side bug with connection indication handler +- added Lantronix XPORT PRO uclinux make target - .NET API: fixed bug in client readValue functions - .NET API: added MmsValue.GetDataAccessError() method diff --git a/CMakeLists.txt b/CMakeLists.txt index 01a9b0dd..16994b08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,10 +79,13 @@ set(API_HEADERS src/hal/inc/hal_time.h src/hal/inc/hal_thread.h src/hal/inc/hal_filesystem.h + src/hal/inc/platform_endian.h src/common/inc/libiec61850_common_api.h + src/common/inc/libiec61850_platform_includes.h src/common/inc/linked_list.h src/common/inc/byte_buffer.h src/common/inc/lib_memory.h + src/common/inc/string_utilities.h src/iec61850/inc/iec61850_client.h src/iec61850/inc/iec61850_common.h src/iec61850/inc/iec61850_server.h @@ -108,6 +111,7 @@ set(API_HEADERS src/sampled_values/sv_subscriber.h src/sampled_values/sv_publisher.h src/logging/logging_api.h + ${CMAKE_CURRENT_BINARY_DIR}/config/stack_config.h ) IF(MSVC) diff --git a/config/stack_config.h b/config/stack_config.h index 2159992f..a3052809 100644 --- a/config/stack_config.h +++ b/config/stack_config.h @@ -24,6 +24,7 @@ #define DEBUG_GOOSE_SUBSCRIBER 0 #define DEBUG_GOOSE_PUBLISHER 0 #define DEBUG_SV_SUBSCRIBER 0 +#define DEBUG_SV_PUBLISHER 0 #define DEBUG_HAL_ETHERNET 0 /* Maximum MMS PDU SIZE - default is 65000 */ diff --git a/dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs b/dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs index ef6173c2..70e7b1d4 100644 --- a/dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs +++ b/dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs @@ -432,19 +432,26 @@ namespace IEC61850 IedConnection_destroy (connection); } - } + } + + private IsoConnectionParameters isoConnectionParameters = null; /// /// Gets the connection parameters /// /// The connection parameters public IsoConnectionParameters GetConnectionParameters () - { - IntPtr mmsConnection = IedConnection_getMmsConnection(connection); - - IntPtr parameters = MmsConnection_getIsoConnectionParameters(mmsConnection); - - return new IsoConnectionParameters(parameters); + { + if (isoConnectionParameters == null) + { + IntPtr mmsConnection = IedConnection_getMmsConnection(connection); + + IntPtr parameters = MmsConnection_getIsoConnectionParameters(mmsConnection); + + isoConnectionParameters = new IsoConnectionParameters(parameters); + } + + return isoConnectionParameters; } private void FreeHGlobaleDeleteFunction (IntPtr pointer) diff --git a/dotnet/IEC61850forCSharp/IsoConnectionParameters.cs b/dotnet/IEC61850forCSharp/IsoConnectionParameters.cs index 778048ca..9192eff3 100644 --- a/dotnet/IEC61850forCSharp/IsoConnectionParameters.cs +++ b/dotnet/IEC61850forCSharp/IsoConnectionParameters.cs @@ -102,8 +102,6 @@ namespace IEC61850 { if (authParameter != IntPtr.Zero) AcseAuthenticationParameter_destroy(authParameter); - - //IsoConnectionParameters_destroy(self); } /// diff --git a/dotnet/authenticate/Main.cs b/dotnet/authenticate/Main.cs index afab9520..22bff505 100644 --- a/dotnet/authenticate/Main.cs +++ b/dotnet/authenticate/Main.cs @@ -21,7 +21,6 @@ namespace authenticate Console.WriteLine("Connect to " + hostname); - try { IsoConnectionParameters parameters = con.GetConnectionParameters(); diff --git a/dotnet/reporting/ReportingExample.cs b/dotnet/reporting/ReportingExample.cs index 9e84c861..454f4376 100644 --- a/dotnet/reporting/ReportingExample.cs +++ b/dotnet/reporting/ReportingExample.cs @@ -93,8 +93,6 @@ namespace reporting rcb1.SetIntgPd(5000); rcb1.SetRptEna(true); - rcb1.SetRCBValues(); - rcb2.GetRCBValues(); if (rcb2.IsBuffered()) diff --git a/examples/goose_subscriber/goose_subscriber_example.c b/examples/goose_subscriber/goose_subscriber_example.c index fb96bd4d..c9a7e103 100644 --- a/examples/goose_subscriber/goose_subscriber_example.c +++ b/examples/goose_subscriber/goose_subscriber_example.c @@ -29,7 +29,9 @@ gooseListener(GooseSubscriber subscriber, void* parameter) printf(" stNum: %u sqNum: %u\n", GooseSubscriber_getStNum(subscriber), GooseSubscriber_getSqNum(subscriber)); printf(" timeToLive: %u\n", GooseSubscriber_getTimeAllowedToLive(subscriber)); +#ifndef _WIN32 printf(" timestamp: %"PRIu64"\n", GooseSubscriber_getTimestamp(subscriber)); +#endif MmsValue* values = GooseSubscriber_getDataSetValues(subscriber); diff --git a/examples/iec61850_client_example1/client_example1.c b/examples/iec61850_client_example1/client_example1.c index 651c0c74..e20a2327 100644 --- a/examples/iec61850_client_example1/client_example1.c +++ b/examples/iec61850_client_example1/client_example1.c @@ -65,8 +65,8 @@ int main(int argc, char** argv) { if (error != IED_ERROR_OK) printf("failed to write simpleIOGenericIO/GGIO1.NamPlt.vendor!\n"); - else - MmsValue_delete(value); + + MmsValue_delete(value); /* read data set */ @@ -117,6 +117,8 @@ int main(int argc, char** argv) { ClientDataSet_destroy(clientDataSet); + ClientReportControlBlock_destroy(rcb); + close_connection: IedConnection_close(con); diff --git a/examples/iec61850_client_example2/client_example2.c b/examples/iec61850_client_example2/client_example2.c index d199d0ab..f2e6be37 100644 --- a/examples/iec61850_client_example2/client_example2.c +++ b/examples/iec61850_client_example2/client_example2.c @@ -42,8 +42,9 @@ printDataDirectory(char* doRef, IedConnection con, int spaces) sprintf(daRef, "%s.%s", doRef, daName); printDataDirectory(daRef, con, spaces + 2); } - } + + LinkedList_destroy(dataAttributes); } int @@ -145,6 +146,8 @@ main(int argc, char** argv) dataSetMemberRef = LinkedList_getNext(dataSetMemberRef); } + LinkedList_destroy(dataSetMembers); + dataSet = LinkedList_getNext(dataSet); } diff --git a/examples/iec61850_client_example5/client_example5.c b/examples/iec61850_client_example5/client_example5.c index 9dc66b68..5acf11b8 100644 --- a/examples/iec61850_client_example5/client_example5.c +++ b/examples/iec61850_client_example5/client_example5.c @@ -14,8 +14,9 @@ #include "hal_thread.h" -int main(int argc, char** argv) { - +int +main(int argc, char** argv) +{ char* hostname; int tcpPort = 102; @@ -46,25 +47,22 @@ int main(int argc, char** argv) { /* use this to skip AP-Title completely - this may be required by some "obscure" servers */ // IsoConnectionParameters_setRemoteApTitle(parameters, NULL, 0); // IsoConnectionParameters_setLocalApTitle(parameters, NULL, 0); + TSelector localTSelector = { 3, { 0x00, 0x01, 0x02 } }; + TSelector remoteTSelector = { 2, { 0x00, 0x01 } }; - TSelector localTSelector = { 3, { 0x00, 0x01, 0x02 } }; - TSelector remoteTSelector = { 2, { 0x00, 0x01 } }; - - SSelector sSelector1 = {2, { 0, 1 } }; - SSelector sSelector2 = {5, { 0, 1, 2, 3, 4 } }; - + SSelector sSelector1 = { 2, { 0, 1 } }; + SSelector sSelector2 = { 5, { 0, 1, 2, 3, 4 } }; /* change parameters for presentation, session and transport layers */ - IsoConnectionParameters_setRemoteAddresses(parameters, 0x12345678, sSelector1, localTSelector); - IsoConnectionParameters_setLocalAddresses(parameters, 0x87654321, sSelector2 , remoteTSelector); + IsoConnectionParameters_setRemoteAddresses(parameters, 0x12345678, sSelector1, localTSelector); + IsoConnectionParameters_setLocalAddresses(parameters, 0x87654321, sSelector2, remoteTSelector); char* password = "top secret"; /* use authentication */ - AcseAuthenticationParameter auth = (AcseAuthenticationParameter) calloc(1, sizeof(struct sAcseAuthenticationParameter)); - auth->mechanism = ACSE_AUTH_PASSWORD; - auth->value.password.octetString = (uint8_t*) password; - auth->value.password.passwordLength = strlen(password); + AcseAuthenticationParameter auth = AcseAuthenticationParameter_create(); + AcseAuthenticationParameter_setAuthMechanism(auth, ACSE_AUTH_PASSWORD); + AcseAuthenticationParameter_setPassword(auth, password); IsoConnectionParameters_setAcseAuthenticationParameter(parameters, auth); @@ -84,6 +82,8 @@ int main(int argc, char** argv) { } IedConnection_destroy(con); + + AcseAuthenticationParameter_destroy(auth); } diff --git a/examples/iec61850_client_example_files/client_example_files.c b/examples/iec61850_client_example_files/client_example_files.c index a04d6b42..e0ec2f9b 100644 --- a/examples/iec61850_client_example_files/client_example_files.c +++ b/examples/iec61850_client_example_files/client_example_files.c @@ -53,10 +53,6 @@ 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) { diff --git a/examples/mms_utility/mms_utility.c b/examples/mms_utility/mms_utility.c index 8d81c229..da6ca126 100644 --- a/examples/mms_utility/mms_utility.c +++ b/examples/mms_utility/mms_utility.c @@ -4,6 +4,7 @@ #include #include "string_utilities.h" #include "mms_client_connection.h" +#include "conversions.h" static void print_help() @@ -351,6 +352,7 @@ int main(int argc, char** argv) { } exit: + free(hostname); MmsConnection_destroy(con); } diff --git a/examples/server_example3/simpleIO_direct_control.icd b/examples/server_example3/simpleIO_direct_control.icd index b48a383e..0a0c6355 100644 --- a/examples/server_example3/simpleIO_direct_control.icd +++ b/examples/server_example3/simpleIO_direct_control.icd @@ -87,9 +87,9 @@ - + - + diff --git a/examples/server_example3/static_model.c b/examples/server_example3/static_model.c index 07b5b4a4..05926022 100644 --- a/examples/server_example3/static_model.c +++ b/examples/server_example3/static_model.c @@ -1944,13 +1944,13 @@ extern ReportControlBlock iedModel_GenericIO_LLN0_report4; extern ReportControlBlock iedModel_GenericIO_LLN0_report5; extern ReportControlBlock iedModel_GenericIO_LLN0_report6; -ReportControlBlock iedModel_GenericIO_LLN0_report0 = {&iedModel_GenericIO_LLN0, "EventsRCB01", "Events1", false, "Events", 4294967295, 24, 111, 50, 1000, &iedModel_GenericIO_LLN0_report1}; -ReportControlBlock iedModel_GenericIO_LLN0_report1 = {&iedModel_GenericIO_LLN0, "EventsIndexed01", "Events2", false, "Events", 1, 24, 111, 50, 1000, &iedModel_GenericIO_LLN0_report2}; -ReportControlBlock iedModel_GenericIO_LLN0_report2 = {&iedModel_GenericIO_LLN0, "EventsIndexed02", "Events2", false, "Events", 1, 24, 111, 50, 1000, &iedModel_GenericIO_LLN0_report3}; -ReportControlBlock iedModel_GenericIO_LLN0_report3 = {&iedModel_GenericIO_LLN0, "EventsIndexed03", "Events2", false, "Events", 1, 24, 111, 50, 1000, &iedModel_GenericIO_LLN0_report4}; -ReportControlBlock iedModel_GenericIO_LLN0_report4 = {&iedModel_GenericIO_LLN0, "Measurements01", "Measurements", true, "Measurements", 1, 16, 111, 50, 1000, &iedModel_GenericIO_LLN0_report5}; -ReportControlBlock iedModel_GenericIO_LLN0_report5 = {&iedModel_GenericIO_LLN0, "Measurements02", "Measurements", true, "Measurements", 1, 16, 111, 50, 1000, &iedModel_GenericIO_LLN0_report6}; -ReportControlBlock iedModel_GenericIO_LLN0_report6 = {&iedModel_GenericIO_LLN0, "Measurements03", "Measurements", true, "Measurements", 1, 16, 111, 50, 1000, NULL}; +ReportControlBlock iedModel_GenericIO_LLN0_report0 = {&iedModel_GenericIO_LLN0, "EventsRCB01", "Events1", false, "Events", 4294967295, 24, 239, 50, 1000, &iedModel_GenericIO_LLN0_report1}; +ReportControlBlock iedModel_GenericIO_LLN0_report1 = {&iedModel_GenericIO_LLN0, "EventsIndexed01", "Events2", false, "Events", 1, 24, 239, 50, 1000, &iedModel_GenericIO_LLN0_report2}; +ReportControlBlock iedModel_GenericIO_LLN0_report2 = {&iedModel_GenericIO_LLN0, "EventsIndexed02", "Events2", false, "Events", 1, 24, 239, 50, 1000, &iedModel_GenericIO_LLN0_report3}; +ReportControlBlock iedModel_GenericIO_LLN0_report3 = {&iedModel_GenericIO_LLN0, "EventsIndexed03", "Events2", false, "Events", 1, 24, 239, 50, 1000, &iedModel_GenericIO_LLN0_report4}; +ReportControlBlock iedModel_GenericIO_LLN0_report4 = {&iedModel_GenericIO_LLN0, "Measurements01", "Measurements", true, "Measurements", 1, 16, 239, 50, 1000, &iedModel_GenericIO_LLN0_report5}; +ReportControlBlock iedModel_GenericIO_LLN0_report5 = {&iedModel_GenericIO_LLN0, "Measurements02", "Measurements", true, "Measurements", 1, 16, 239, 50, 1000, &iedModel_GenericIO_LLN0_report6}; +ReportControlBlock iedModel_GenericIO_LLN0_report6 = {&iedModel_GenericIO_LLN0, "Measurements03", "Measurements", true, "Measurements", 1, 16, 239, 50, 1000, NULL}; diff --git a/pyiec61850/CMakeLists.txt b/pyiec61850/CMakeLists.txt index 49429957..f5f0f922 100644 --- a/pyiec61850/CMakeLists.txt +++ b/pyiec61850/CMakeLists.txt @@ -1,7 +1,7 @@ FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) FIND_PACKAGE(PythonLibs REQUIRED) -FIND_PACKAGE ( PythonInterp REQUIRED ) +FIND_PACKAGE ( PythonInterp ${PYTHONLIBS_VERSION_STRING} EXACT REQUIRED ) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(CMAKE_SWIG_FLAGS "") diff --git a/pyiec61850/test_pyiec61850.py b/pyiec61850/test_pyiec61850.py index a37fd6bb..aceb3fdb 100755 --- a/pyiec61850/test_pyiec61850.py +++ b/pyiec61850/test_pyiec61850.py @@ -55,20 +55,20 @@ def testClient(): theVal = "testmodelSENSORS/TTMP1.TmpSp.setMag.f" theValType = iec61850.IEC61850_FC_SP temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType) - print temperatureSetpoint + print(temperatureSetpoint) assert(temperatureValue[1]==0) newValue= temperatureValue[0]+10 err = iec61850.IedConnection_writeFloatValue(con, theVal, theValType, newValue) assert(err==0) temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType) - print temperatureSetpoint + print(temperatureSetpoint) assert(temperatureSetpoint[0]==newValue) iec61850.IedConnection_close(con) else: - print "Connection error" + print("Connection error") sys.exit(-1) iec61850.IedConnection_destroy(con) - print "client ok" + print("client ok") try: srv=myIECServer() srvThread = threading.Thread(target = srv.run) @@ -78,6 +78,6 @@ try: #signal.pause() except: running = 0 - print "Error :" + print("Error :") traceback.print_exc(file=sys.stdout) sys.exit(-1) diff --git a/src/common/inc/libiec61850_platform_includes.h b/src/common/inc/libiec61850_platform_includes.h index 9ae9bd8e..674b554c 100644 --- a/src/common/inc/libiec61850_platform_includes.h +++ b/src/common/inc/libiec61850_platform_includes.h @@ -15,7 +15,7 @@ #include "platform_endian.h" -#define LIBIEC61850_VERSION "1.0.0" +#define LIBIEC61850_VERSION "1.0.1" #ifndef CONFIG_DEFAULT_MMS_VENDOR_NAME #define CONFIG_DEFAULT_MMS_VENDOR_NAME "libiec61850.com" diff --git a/src/iec61850/client/client_report.c b/src/iec61850/client/client_report.c index 2ded8114..1a294ca0 100644 --- a/src/iec61850/client/client_report.c +++ b/src/iec61850/client/client_report.c @@ -359,11 +359,14 @@ private_IedConnection_handleReport(IedConnection self, MmsValue* value) while (element != NULL) { ClientReport report = (ClientReport) element->data; - + char defaultRptId[129]; char* rptId = report->rptId; - if (rptId == NULL) - rptId = report->rcbReference; + if ((rptId == NULL) || (rptId && (strlen(rptId) == 0))) { + strncpy(defaultRptId, report->rcbReference, 129); + StringUtils_replace(defaultRptId, '.', '$'); + rptId = defaultRptId; + } if (strcmp(MmsValue_toString(rptIdValue), rptId) == 0) { matchingReport = report; diff --git a/src/mms/inc_private/cotp.h b/src/mms/inc_private/cotp.h index 273ef659..81ef122d 100644 --- a/src/mms/inc_private/cotp.h +++ b/src/mms/inc_private/cotp.h @@ -38,8 +38,8 @@ typedef struct { typedef struct { int state; - int srcRef; - int dstRef; + int remoteRef; + int localRef; int protocolClass; Socket socket; CotpOptions options; @@ -97,9 +97,9 @@ ByteBuffer* CotpConnection_getPayload(CotpConnection* self); int -CotpConnection_getSrcRef(CotpConnection* self); +CotpConnection_getRemoteRef(CotpConnection* self); int -CotpConnection_getDstRef(CotpConnection* self); +CotpConnection_getLocalRef(CotpConnection* self); #endif /* COTP_H_ */ diff --git a/src/mms/iso_cotp/cotp.c b/src/mms/iso_cotp/cotp.c index 4d53f77e..a29c8378 100644 --- a/src/mms/iso_cotp/cotp.c +++ b/src/mms/iso_cotp/cotp.c @@ -123,10 +123,10 @@ writeStaticConnectResponseHeader(CotpConnection* self, int optionsLength) buffer[4] = 6 + optionsLength; buffer[5] = 0xd0; - buffer[6] = (uint8_t) (self->srcRef / 0x100); - buffer[7] = (uint8_t) (self->srcRef & 0xff); - buffer[8] = (uint8_t) (self->dstRef / 0x100); - buffer[9] = (uint8_t) (self->dstRef & 0xff); + buffer[6] = (uint8_t) (self->remoteRef / 0x100); + buffer[7] = (uint8_t) (self->remoteRef & 0xff); + buffer[8] = (uint8_t) (self->localRef / 0x100); + buffer[9] = (uint8_t) (self->localRef & 0xff); buffer[10] = (uint8_t) (self->protocolClass); self->writeBuffer->size = 11; @@ -312,8 +312,8 @@ CotpConnection_sendConnectionRequestMessage(CotpConnection* self, IsoConnectionP buffer[7] = 0x00; /* SRC REF */ - buffer[8] = 0x00; - buffer[9] = 0x02; /* or 0x01 ? */ + buffer[8] = (uint8_t) (self->localRef / 0x100); + buffer[9] = (uint8_t) (self->localRef & 0xff); /* Class */ buffer[10] = 0x00; @@ -435,8 +435,8 @@ CotpConnection_init(CotpConnection* self, Socket socket, { self->state = 0; self->socket = socket; - self->srcRef = -1; - self->dstRef = -1; + self->remoteRef = -1; + self->localRef = 1; self->protocolClass = -1; self->options.tpduSize = 0; @@ -487,15 +487,15 @@ CotpConnection_getPayload(CotpConnection* self) } int -CotpConnection_getSrcRef(CotpConnection* self) +CotpConnection_getRemoteRef(CotpConnection* self) { - return self->srcRef; + return self->remoteRef; } int -CotpConnection_getDstRef(CotpConnection* self) +CotpConnection_getLocalRef(CotpConnection* self) { - return self->dstRef; + return self->localRef; } /* @@ -515,8 +515,7 @@ parseConnectRequestTpdu(CotpConnection* self, uint8_t* buffer, uint8_t len) if (len < 6) return false; - self->dstRef = getUint16(buffer); - self->srcRef = getUint16(buffer + 2); + self->remoteRef = getUint16(buffer + 2); self->protocolClass = getUint8(buffer + 4); return parseOptions(self, buffer + 5, len - 6); @@ -528,8 +527,7 @@ parseConnectConfirmTpdu(CotpConnection* self, uint8_t* buffer, uint8_t len) if (len < 6) return false; - self->srcRef = getUint16(buffer); - self->dstRef = getUint16(buffer + 2); + self->remoteRef = getUint16(buffer); self->protocolClass = getUint8(buffer + 4); return parseOptions(self, buffer + 5, len - 6); diff --git a/src/mms/iso_mms/common/mms_value.c b/src/mms/iso_mms/common/mms_value.c index d5cbaf89..199e3ec4 100644 --- a/src/mms/iso_mms/common/mms_value.c +++ b/src/mms/iso_mms/common/mms_value.c @@ -1999,6 +1999,7 @@ MmsValue_printToBuffer(const MmsValue* self, char* buffer, int bufferSize) case MMS_STRUCTURE: case MMS_ARRAY: { + if (bufferSize==0) break; buffer[0] = '{'; int bufPos = 1; diff --git a/src/mms/iso_mms/server/mms_get_var_access_service.c b/src/mms/iso_mms/server/mms_get_var_access_service.c index 635876bf..abdf6d02 100644 --- a/src/mms/iso_mms/server/mms_get_var_access_service.c +++ b/src/mms/iso_mms/server/mms_get_var_access_service.c @@ -134,7 +134,7 @@ createTypeSpecification ( break; default: if (DEBUG_MMS_SERVER) - printf("MMS-SERVER: Unsupported type %i!\n", namedVariable->type); + printf("MMS-SERVER: Unsupported type %i!\n", namedVariable->type); return -1; break; } diff --git a/src/sampled_values/sv_publisher.c b/src/sampled_values/sv_publisher.c index 5f812fb2..d550b57e 100644 --- a/src/sampled_values/sv_publisher.c +++ b/src/sampled_values/sv_publisher.c @@ -30,7 +30,9 @@ #include "hal_ethernet.h" #include "ber_encoder.h" +#ifndef DEBUG_SV_PUBLISHER #define DEBUG_SV_PUBLISHER 1 +#endif #define CONFIG_SV_DEFAULT_DST_ADDRESS CONFIG_GOOSE_DEFAULT_DST_ADDRESS @@ -567,6 +569,11 @@ SV_ASDU_setFLOAT64(SV_ASDU self, int index, double value) } } +uint16_t +SV_ASDU_getSmpCnt(SV_ASDU self) +{ + return self->smpCnt; +} void SV_ASDU_setSmpCnt(SV_ASDU self, uint16_t value) diff --git a/src/sampled_values/sv_publisher.h b/src/sampled_values/sv_publisher.h index 5612aa96..eeaf70e3 100644 --- a/src/sampled_values/sv_publisher.h +++ b/src/sampled_values/sv_publisher.h @@ -89,6 +89,9 @@ SV_ASDU_setFLOAT64(SV_ASDU self, int index, double value); void SV_ASDU_setSmpCnt(SV_ASDU self, uint16_t value); +uint16_t +SV_ASDU_getSmpCnt(SV_ASDU self); + void SV_ASDU_increaseSmpCnt(SV_ASDU self); diff --git a/tools/model_generator/genconfig.jar b/tools/model_generator/genconfig.jar index 073f4bc8..0fa5a6ae 100644 Binary files a/tools/model_generator/genconfig.jar and b/tools/model_generator/genconfig.jar differ diff --git a/tools/model_generator/genmodel.jar b/tools/model_generator/genmodel.jar index 87c64d67..c79ce550 100644 Binary files a/tools/model_generator/genmodel.jar and b/tools/model_generator/genmodel.jar differ diff --git a/tools/model_generator/src/com/libiec61850/scl/model/OptionFields.java b/tools/model_generator/src/com/libiec61850/scl/model/OptionFields.java index a55e6624..226f1188 100644 --- a/tools/model_generator/src/com/libiec61850/scl/model/OptionFields.java +++ b/tools/model_generator/src/com/libiec61850/scl/model/OptionFields.java @@ -90,11 +90,11 @@ public class OptionFields { if (boolVal != null) this.entryID = boolVal; - boolVal = ParserUtils.parseBooleanAttribute(optFieldsNode, "bufOvfl"); + boolVal = ParserUtils.parseBooleanAttribute(optFieldsNode, "configRef"); if (boolVal != null) this.configRef = boolVal; - boolVal = ParserUtils.parseBooleanAttribute(optFieldsNode, "reasonCode"); + boolVal = ParserUtils.parseBooleanAttribute(optFieldsNode, "bufOvlf"); if (boolVal != null) this.bufOvfl = boolVal; }