libiec61850  1.2.0
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...
 
LinkedList IedConnection_getFileDirectoryEx (IedConnection self, IedClientError *error, const char *directoryName, const char *continueAfter, bool *moreFollows)
 returns the directory entries of the specified file directory returned by a single file directory request. 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_setFilestoreBasepath (IedConnection, const char *basepath)
 Set the virtual filestore basepath for the setFile service. More...
 
void IedConnection_setFile (IedConnection self, IedClientError *error, const char *sourceFilename, const char *destinationFilename)
 Implementation of the SetFile 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
LinkedList IedConnection_getFileDirectoryEx ( IedConnection  self,
IedClientError error,
const char *  directoryName,
const char *  continueAfter,
bool *  moreFollows 
)

returns the directory entries of the specified file directory returned by a single file directory request.

This function will only create a single request and the result may only be the directory that fits into a single MMS PDU. If the server contains more directory entries, this will be indicated by setting the moreFollows variable (if provided by the caller). If the directory entry does not fit into a single MMS PDU the next part of the directory list can be requested by setting the continueAfter parameter with the value of the last filename of the received list.

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
continueAfterlast received filename to continue after, or NULL for the first request
moreFollowsif provided by the caller (non NULL) the function will indicate if more directory entries are available.
Returns
the list of directory entries. The return type is a LinkedList with FileDirectoryEntry elements
void IedConnection_setFile ( IedConnection  self,
IedClientError error,
const char *  sourceFilename,
const char *  destinationFilename 
)

Implementation of the SetFile ACSI service.

Upload a file to the server. The file has to be available in the local VMD filestore.

Parameters
selfthe connection object
errorthe error code if an error occurs
sourceFilenamethe filename of the local (client side) file
destinationFilenamethe filename of the remote (service side) file
void IedConnection_setFilestoreBasepath ( IedConnection  ,
const char *  basepath 
)

Set the virtual filestore basepath for the setFile service.

All external file service accesses will be mapped to paths relative to the base directory. NOTE: This function is only available when the CONFIG_SET_FILESTORE_BASEPATH_AT_RUNTIME option in stack_config.h is set.

Parameters
selfthe connection object
basepaththe new virtual filestore basepath