Merge pull request #6 from cedricboudinet/master

Various patch
pull/8/head
mzillgith 9 years ago committed by GitHub
commit 046541700a

@ -79,10 +79,13 @@ set(API_HEADERS
src/hal/inc/hal_time.h src/hal/inc/hal_time.h
src/hal/inc/hal_thread.h src/hal/inc/hal_thread.h
src/hal/inc/hal_filesystem.h src/hal/inc/hal_filesystem.h
src/hal/inc/platform_endian.h
src/common/inc/libiec61850_common_api.h src/common/inc/libiec61850_common_api.h
src/common/inc/libiec61850_platform_includes.h
src/common/inc/linked_list.h src/common/inc/linked_list.h
src/common/inc/byte_buffer.h src/common/inc/byte_buffer.h
src/common/inc/lib_memory.h src/common/inc/lib_memory.h
src/common/inc/string_utilities.h
src/iec61850/inc/iec61850_client.h src/iec61850/inc/iec61850_client.h
src/iec61850/inc/iec61850_common.h src/iec61850/inc/iec61850_common.h
src/iec61850/inc/iec61850_server.h src/iec61850/inc/iec61850_server.h
@ -108,6 +111,7 @@ set(API_HEADERS
src/sampled_values/sv_subscriber.h src/sampled_values/sv_subscriber.h
src/sampled_values/sv_publisher.h src/sampled_values/sv_publisher.h
src/logging/logging_api.h src/logging/logging_api.h
${CMAKE_CURRENT_BINARY_DIR}/config/stack_config.h
) )
IF(MSVC) IF(MSVC)

@ -24,6 +24,7 @@
#define DEBUG_GOOSE_SUBSCRIBER 0 #define DEBUG_GOOSE_SUBSCRIBER 0
#define DEBUG_GOOSE_PUBLISHER 0 #define DEBUG_GOOSE_PUBLISHER 0
#define DEBUG_SV_SUBSCRIBER 0 #define DEBUG_SV_SUBSCRIBER 0
#define DEBUG_SV_PUBLISHER 0
#define DEBUG_HAL_ETHERNET 0 #define DEBUG_HAL_ETHERNET 0
/* Maximum MMS PDU SIZE - default is 65000 */ /* Maximum MMS PDU SIZE - default is 65000 */

@ -1,7 +1,7 @@
FIND_PACKAGE(SWIG REQUIRED) FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE}) INCLUDE(${SWIG_USE_FILE})
FIND_PACKAGE(PythonLibs REQUIRED) FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE ( PythonInterp REQUIRED ) FIND_PACKAGE ( PythonInterp ${PYTHONLIBS_VERSION_STRING} EXACT REQUIRED )
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS "") SET(CMAKE_SWIG_FLAGS "")

@ -55,20 +55,20 @@ def testClient():
theVal = "testmodelSENSORS/TTMP1.TmpSp.setMag.f" theVal = "testmodelSENSORS/TTMP1.TmpSp.setMag.f"
theValType = iec61850.IEC61850_FC_SP theValType = iec61850.IEC61850_FC_SP
temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType) temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType)
print temperatureSetpoint print(temperatureSetpoint)
assert(temperatureValue[1]==0) assert(temperatureValue[1]==0)
newValue= temperatureValue[0]+10 newValue= temperatureValue[0]+10
err = iec61850.IedConnection_writeFloatValue(con, theVal, theValType, newValue) err = iec61850.IedConnection_writeFloatValue(con, theVal, theValType, newValue)
assert(err==0) assert(err==0)
temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType) temperatureSetpoint = iec61850.IedConnection_readFloatValue(con, theVal, theValType)
print temperatureSetpoint print(temperatureSetpoint)
assert(temperatureSetpoint[0]==newValue) assert(temperatureSetpoint[0]==newValue)
iec61850.IedConnection_close(con) iec61850.IedConnection_close(con)
else: else:
print "Connection error" print("Connection error")
sys.exit(-1) sys.exit(-1)
iec61850.IedConnection_destroy(con) iec61850.IedConnection_destroy(con)
print "client ok" print("client ok")
try: try:
srv=myIECServer() srv=myIECServer()
srvThread = threading.Thread(target = srv.run) srvThread = threading.Thread(target = srv.run)
@ -78,6 +78,6 @@ try:
#signal.pause() #signal.pause()
except: except:
running = 0 running = 0
print "Error :" print("Error :")
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)
sys.exit(-1) sys.exit(-1)

@ -1999,6 +1999,7 @@ MmsValue_printToBuffer(const MmsValue* self, char* buffer, int bufferSize)
case MMS_STRUCTURE: case MMS_STRUCTURE:
case MMS_ARRAY: case MMS_ARRAY:
{ {
if (bufferSize==0) break;
buffer[0] = '{'; buffer[0] = '{';
int bufPos = 1; int bufPos = 1;

@ -30,7 +30,9 @@
#include "hal_ethernet.h" #include "hal_ethernet.h"
#include "ber_encoder.h" #include "ber_encoder.h"
#ifndef DEBUG_SV_PUBLISHER
#define DEBUG_SV_PUBLISHER 1 #define DEBUG_SV_PUBLISHER 1
#endif
#define CONFIG_SV_DEFAULT_DST_ADDRESS CONFIG_GOOSE_DEFAULT_DST_ADDRESS #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 void
SV_ASDU_setSmpCnt(SV_ASDU self, uint16_t value) SV_ASDU_setSmpCnt(SV_ASDU self, uint16_t value)

@ -89,6 +89,9 @@ SV_ASDU_setFLOAT64(SV_ASDU self, int index, double value);
void void
SV_ASDU_setSmpCnt(SV_ASDU self, uint16_t value); SV_ASDU_setSmpCnt(SV_ASDU self, uint16_t value);
uint16_t
SV_ASDU_getSmpCnt(SV_ASDU self);
void void
SV_ASDU_increaseSmpCnt(SV_ASDU self); SV_ASDU_increaseSmpCnt(SV_ASDU self);

Loading…
Cancel
Save