Documente Academic
Documente Profesional
Documente Cultură
* client_example_files.c
*
* This example demonstrates the usage of the file services
*
* - How to browse the file system of the server
* - How to download a file from the server
*
* Note: intended to be used with server_example3
*
*/
#include "iec61850_client.h"
#include <stdlib.h>
#include <stdio.h>
#include "thread.h"
static bool
downloadHandler(void* parameter, uint8_t* buffer, uint32_t bytesRead)
{
printf("received %i bytes\n", bytesRead);
char* hostname;
int tcpPort = 102;
if (argc > 1)
hostname = argv[1];
else
hostname = "localhost";
if (argc > 2)
tcpPort = atoi(argv[2]);
IedClientError error;
if (error == IED_ERROR_OK) {
if (error != IED_ERROR_OK) {
printf("Error retrieving file directory\n");
goto abort_connection;
}
directoryEntry = LinkedList_getNext(directoryEntry);
}
abort_connection:
IedConnection_abort(con, &error);
}
else {
printf("Failed to connect to %s:%i\n", hostname, tcpPort);
}
IedConnection_destroy(con);
}