diff --git a/CHANGELOG b/CHANGELOG index 458befbb..1591bb81 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +Changes to version 0.9.0.2 +-------------------------- +- added C++ compatible headers to GOOSE/SV publisher headers +- server: fixed problem in GetFileDirectory-service with a single file as parameter +- added goose_publisher_example to cmake + Changes to version 0.9.0.1 -------------------------- - fixed problem with windows build with GOOSE and SV support diff --git a/config/stack_config.h b/config/stack_config.h index c21730e5..61ae9e67 100644 --- a/config/stack_config.h +++ b/config/stack_config.h @@ -17,7 +17,7 @@ #define DEBUG_COTP 0 #define DEBUG_ISO_SERVER 0 #define DEBUG_ISO_CLIENT 0 -#define DEBUG_IED_SERVER 0 +#define DEBUG_IED_SERVER 1 #define DEBUG_IED_CLIENT 0 #define DEBUG_MMS_CLIENT 0 #define DEBUG_MMS_SERVER 0 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index ad831255..5bc892aa 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -27,6 +27,7 @@ if(EXISTS "../third_party/winpcap/Lib/wpcap.lib") message("Found winpcap -> compile examples for GOOSE and SV") add_subdirectory(server_example_goose) add_subdirectory(goose_subscriber) +add_subdirectory(goose_publisher) add_subdirectory(sv_subscriber) add_subdirectory(iec61850_9_2_LE_example) add_subdirectory(iec61850_sv_client_example) @@ -35,8 +36,9 @@ endif() else() add_subdirectory(server_example_goose) add_subdirectory(goose_subscriber) +add_subdirectory(goose_publisher) add_subdirectory(sv_subscriber) add_subdirectory(iec61850_9_2_LE_example) add_subdirectory(iec61850_sv_client_example) add_subdirectory(sv_publisher) -endif() \ No newline at end of file +endif() diff --git a/examples/goose_publisher/goose_publisher_example.c b/examples/goose_publisher/goose_publisher_example.c index c989b1de..916be700 100644 --- a/examples/goose_publisher/goose_publisher_example.c +++ b/examples/goose_publisher/goose_publisher_example.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "mms_value.h" #include "goose_publisher.h" diff --git a/src/goose/goose_receiver.h b/src/goose/goose_receiver.h index b313f2bc..51bdebc3 100644 --- a/src/goose/goose_receiver.h +++ b/src/goose/goose_receiver.h @@ -26,6 +26,11 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + + /** * \addtogroup goose_api_group */ @@ -122,4 +127,9 @@ GooseReceiver_tick(GooseReceiver self); /**@}*/ +#ifdef __cplusplus +} +#endif + + #endif /* GOOSE_RECEIVER_H_ */ diff --git a/src/mms/iso_mms/server/mms_file_service.c b/src/mms/iso_mms/server/mms_file_service.c index 742242ce..9bf8b72a 100644 --- a/src/mms/iso_mms/server/mms_file_service.c +++ b/src/mms/iso_mms/server/mms_file_service.c @@ -485,9 +485,7 @@ addFileEntriesToResponse(uint8_t* buffer, int bufPos, int maxBufSize, char* dire uint32_t fileSize; - if (FileSystem_getFileInfo(directoryName, &fileSize, &msTime) == NULL) - bufPos = -1; - else { + if (FileSystem_getFileInfo(directoryName, &fileSize, &msTime)) { char gtString[30]; @@ -512,6 +510,8 @@ addFileEntriesToResponse(uint8_t* buffer, int bufPos, int maxBufSize, char* dire bufPos = encodeFileSpecification(0xa0, directoryName, buffer, bufPos); /* fileName */ bufPos = encodeFileAttributes(0xa1, fileSize, gtString, buffer, bufPos); /* file attributes */ } + else + bufPos = -1; } diff --git a/src/mms/iso_mms/server/mms_read_service.c b/src/mms/iso_mms/server/mms_read_service.c index 1f48c642..ecee3ecc 100644 --- a/src/mms/iso_mms/server/mms_read_service.c +++ b/src/mms/iso_mms/server/mms_read_service.c @@ -525,13 +525,13 @@ handleReadListOfVariablesRequest( if (DEBUG_MMS_SERVER) printf("MMS_SERVER: READ domain %s not found!\n", domainIdStr); - appendErrorToResultList(values, 10 /* object-non-existent*/); + appendErrorToResultList(values, (uint32_t) DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT /* object-non-existent*/); } else { MmsVariableSpecification* namedVariable = MmsDomain_getNamedVariable(domain, nameIdStr); if (namedVariable == NULL) - appendErrorToResultList(values, 10 /* object-non-existent*/); + appendErrorToResultList(values, (uint32_t) DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT /* object-non-existent*/); else addNamedVariableToResultList(namedVariable, domain, nameIdStr, values, connection, alternateAccess); @@ -559,7 +559,7 @@ handleReadListOfVariablesRequest( #endif /* (CONFIG_MMS_SUPPORT_VMD_SCOPE_NAMED_VARIABLES == 1) */ else { - appendErrorToResultList(values, 10 /* object-non-existent*/); + appendErrorToResultList(values, (uint32_t) DATA_ACCESS_ERROR_OBJECT_NONE_EXISTENT /* object-non-existent*/); if (DEBUG_MMS_SERVER) printf("MMS_SERVER: READ object name type not supported!\n"); } diff --git a/src/sampled_values/sv_publisher.h b/src/sampled_values/sv_publisher.h index c27fc6f3..13466405 100644 --- a/src/sampled_values/sv_publisher.h +++ b/src/sampled_values/sv_publisher.h @@ -27,6 +27,11 @@ #include "libiec61850_platform_includes.h" +#ifdef __cplusplus +extern "C" { +#endif + + #define IEC61850_SV_SMPSYNC_NOT_SYNCHRONIZED 0 #define IEC61850_SV_SMPSYNC_SYNCED_UNSPEC_LOCAL_CLOCK 1 #define IEC61850_SV_SMPSYNC_SYNCED_GLOBAL_CLOCK 2 @@ -96,4 +101,9 @@ SV_ASDU_setRefrTm(SV_ASDU self, uint64_t refrTm); void SV_ASDU_setSmpMod(SV_ASDU self, uint8_t smpMod); +#ifdef __cplusplus +} +#endif + + #endif /* LIBIEC61850_SRC_SAMPLED_VALUES_SV_PUBLISHER_H_ */