- file-tool: file client example is now compatible with windows

pull/72/head
Michael Zillgith 7 years ago
parent a830fc3cfb
commit c0ce64c758

@ -1,5 +1,10 @@
Changes to version 1.3.0
------------------------
- IEC 61850 server: more features configurable at runtime
- IEC 61850 server: control objects - fixed bug in select response for SBO control model
- IEC 61850 client: add support for single array element access (with component specification)
- IEC 61850 server: made IEC 61850 edition configurable at runtime
- IEC 61850 server: added ReadAccessHandler to control read access
- HAL: unified platform abstraction layer (to simplify using the library together with lib60870)
- IEC 61850 server: fixed bug when calling write access handler (wrong pointer for ClientConnection object)
- updated IEC 61850-9-2 LE example to be more realistic

@ -21,10 +21,7 @@ add_subdirectory(iec61850_client_example5)
add_subdirectory(iec61850_client_example_reporting)
add_subdirectory(iec61850_client_example_log)
add_subdirectory(iec61850_client_example_array)
if(NOT WIN32)
add_subdirectory(iec61850_client_example_files)
endif()
add_subdirectory(iec61850_client_example_files)
if(WIN32)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib")

@ -8,15 +8,73 @@
*
* Note: intended to be used with server_example3 or server_example_files
*
* Note: DOES NOT WORK WITH VISUAL STUDIO because of libgen.h
*
*/
#include "iec61850_client.h"
#include <stdlib.h>
#include <stdio.h>
#ifdef _WIN32
#include <Windows.h>
#else
#include <libgen.h>
#endif
#ifdef _WIN32
static char _dirname[1000];
static char*
dirname(char* path)
{
char* lastSep = NULL;
int len = strlen(path);
int i = 0;
while (i < len) {
if (path[i] == '/' || path[i] == ':' || path[i] == '\\')
lastSep = path + i;
i++;
}
if (lastSep) {
strcpy(_dirname, path);
_dirname[lastSep - path] = 0;
}
else
strcpy("", path);
return _dirname;
}
static char _basename[1000];
static char*
basename(char* path)
{
char* lastSep = NULL;
int len = strlen(path);
int i = 0;
while (i < len) {
if (path[i] == '/' || path[i] == ':' || path[i] == '\\')
lastSep = path + i;
i++;
}
if (lastSep)
strcpy(_basename, lastSep + 1);
else
strcpy(_basename, path);
return _basename;
}
#endif
static char* hostname = "localhost";
static int tcpPort = 102;

Loading…
Cancel
Save