libIEC61850  0.8.2
Open-source IEC 61850 MMS/GOOSE server and client library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Typedefs | Functions
File service related functions, data types, and definitions

Typedefs

typedef struct
sFileDirectoryEntry * 
FileDirectoryEntry
 
typedef bool(* IedClientGetFileHandler )(void *parameter, uint8_t *buffer, uint32_t bytesRead)
 user provided handler to receive the data of the GetFile request More...
 

Functions

FileDirectoryEntry FileDirectoryEntry_create (const char *fileName, uint32_t fileSize, uint64_t lastModified)
 
void FileDirectoryEntry_destroy (FileDirectoryEntry self)
 
char * FileDirectoryEntry_getFileName (FileDirectoryEntry self)
 
uint32_t FileDirectoryEntry_getFileSize (FileDirectoryEntry self)
 
uint64_t FileDirectoryEntry_getLastModified (FileDirectoryEntry self)
 
LinkedList IedConnection_getFileDirectory (IedConnection self, IedClientError *error, const char *directoryName)
 returns the directory entries of the specified file directory. More...
 
uint32_t IedConnection_getFile (IedConnection self, IedClientError *error, const char *fileName, IedClientGetFileHandler handler, void *handlerParameter)
 Implementation of the GetFile ACSI service. More...
 
void IedConnection_deleteFile (IedConnection self, IedClientError *error, const char *fileName)
 Implementation of the DeleteFile ACSI service. More...
 

Detailed Description

Typedef Documentation

typedef struct sFileDirectoryEntry* FileDirectoryEntry
typedef bool(* IedClientGetFileHandler)(void *parameter, uint8_t *buffer, uint32_t bytesRead)

user provided handler to receive the data of the GetFile request

This handler will be invoked whenever the clients receives a data block from the server. The API user has to copy the data to another location before returning. The other location could for example be a file in the clients file system.

Parameters
parameteruser provided parameter
bufferpointer to the buffer containing the received data
bytesReadnumber of bytes available in the buffer
Returns
true if the client implementation shall continue to download data false if the download should be stopped. E.g. if the file cannot be stored client side due to missing resources.

Function Documentation

FileDirectoryEntry FileDirectoryEntry_create ( const char *  fileName,
uint32_t  fileSize,
uint64_t  lastModified 
)
void FileDirectoryEntry_destroy ( FileDirectoryEntry  self)
char* FileDirectoryEntry_getFileName ( FileDirectoryEntry  self)
uint32_t FileDirectoryEntry_getFileSize ( FileDirectoryEntry  self)
uint64_t FileDirectoryEntry_getLastModified ( FileDirectoryEntry  self)
void IedConnection_deleteFile ( IedConnection  self,
IedClientError error,
const char *  fileName 
)

Implementation of the DeleteFile ACSI service.

Delete a file at the server.

Parameters
selfthe connection object
errorthe error code if an error occurs
fileNamethe name of the file to delete
uint32_t IedConnection_getFile ( IedConnection  self,
IedClientError error,
const char *  fileName,
IedClientGetFileHandler  handler,
void *  handlerParameter 
)

Implementation of the GetFile ACSI service.

Download a file from the server.

Parameters
selfthe connection object
errorthe error code if an error occurs
fileNamethe name of the file to be read from the server
Returns
number of bytes received
LinkedList IedConnection_getFileDirectory ( IedConnection  self,
IedClientError error,
const char *  directoryName 
)

returns the directory entries of the specified file directory.

Requires the server to support file services.

NOTE: the returned linked list has to be freed by the user. You can user the following statement to free the list of directory entries:

LinkedList_destroyDeep(fileNames, (LinkedListValueDeleteFunction) FileDirectoryEntry_destroy);

where fileNames is the return value of this function.

Parameters
selfthe connection object
errorthe error code if an error occurs
directoryNamethe name of the directory or NULL to get the entries of the root directory
Returns
the list of directory entries. The return type is a LinkedList with FileDirectoryEntry elements