libiec61850
1.2.0
|
Macros | |
#define | CONFIG_SYSTEM_FILE_SEPARATOR '/' |
Typedefs | |
typedef void * | FileHandle |
typedef struct sDirectoryHandle * | DirectoryHandle |
Functions | |
FileHandle | FileSystem_openFile (char *pathName, bool readWrite) |
open a file More... | |
int | FileSystem_readFile (FileHandle handle, uint8_t *buffer, int maxSize) |
read from an open file More... | |
int | FileSystem_writeFile (FileHandle handle, uint8_t *buffer, int size) |
write to an open file More... | |
void | FileSystem_closeFile (FileHandle handle) |
close an open file More... | |
bool | FileSystem_getFileInfo (char *filename, uint32_t *fileSize, uint64_t *lastModificationTimestamp) |
return attributes of the given file More... | |
bool | FileSystem_deleteFile (char *filename) |
delete a file More... | |
bool | FileSystem_renameFile (char *oldFilename, char *newFilename) |
rename a file More... | |
DirectoryHandle | FileSystem_openDirectory (char *directoryName) |
open the directoy with the specified name More... | |
char * | FileSystem_readDirectory (DirectoryHandle directory, bool *isDirectory) |
read the next directory entry More... | |
void | FileSystem_closeDirectory (DirectoryHandle directory) |
close a directory More... | |
void | FileSystem_setBasePath (char *basePath) |
set local file system base path for the MMS VMD More... | |
#define CONFIG_SYSTEM_FILE_SEPARATOR '/' |
typedef struct sDirectoryHandle* DirectoryHandle |
typedef void* FileHandle |
void FileSystem_closeDirectory | ( | DirectoryHandle | directory | ) |
close a directory
directory | the handle to identify the directory |
void FileSystem_closeFile | ( | FileHandle | handle | ) |
close an open file
handle | the file handle to identify the file |
bool FileSystem_deleteFile | ( | char * | filename | ) |
delete a file
pathName | full name (path + filename) of the file |
bool FileSystem_getFileInfo | ( | char * | filename, |
uint32_t * | fileSize, | ||
uint64_t * | lastModificationTimestamp | ||
) |
return attributes of the given file
This function is used by the MMS layer to determine basic file attributes. The size of the file has to be returned in bytes. The timestamp of the last modification has to be returned as milliseconds since Unix epoch - or 0 if this function is not supported.
pathName | full name (path + filename) of the file |
fileSize | a pointer where to store the file size |
lastModificationTimestamp | is used to store the timestamp of last modification of the file |
DirectoryHandle FileSystem_openDirectory | ( | char * | directoryName | ) |
open the directoy with the specified name
directoryName |
FileHandle FileSystem_openFile | ( | char * | pathName, |
bool | readWrite | ||
) |
open a file
pathName | full name (path + filename) of the file |
readWrite | true opens the file with read and write access - false opens for read access only |
char* FileSystem_readDirectory | ( | DirectoryHandle | directory, |
bool * | isDirectory | ||
) |
read the next directory entry
This function returns the next directory entry. The entry is only a valid pointer as long as the FileSystem_closeDirectory or another FileSystem_readDirectory function is not called for the given DirectoryHandle.
directory | the handle to identify the directory |
isDirectory | return value that indicates if the directory entry is itself a directory (true) |
int FileSystem_readFile | ( | FileHandle | handle, |
uint8_t * | buffer, | ||
int | maxSize | ||
) |
read from an open file
This function will read the next block of the file. The maximum number of bytes to read is given. A call to this function will move the file position by the number of bytes read. If the file position reaches the end of file then subsequent calls of this function shall return 0.
handle | the file handle to identify the file |
buffer | the buffer to write the read data |
maxSize | maximum number of bytes to read |
bool FileSystem_renameFile | ( | char * | oldFilename, |
char * | newFilename | ||
) |
rename a file
oldFileName | current full name (path + filename) of the file |
newFileName | new full name (path + filename) of the file |
void FileSystem_setBasePath | ( | char * | basePath | ) |
set local file system base path for the MMS VMD
NOTE: the meaning of this functions is platform specific. It was introduced to simplify the configuration of the VMD base path at runtime. It may not be supported on all platform. Also it is not called by the MMS protocol stack.
basePath | the local base path of the MMS VMD |
int FileSystem_writeFile | ( | FileHandle | handle, |
uint8_t * | buffer, | ||
int | size | ||
) |
write to an open file
handle | the file handle to identify the file |
buffer | the buffer with the data to write |
size | the number of bytes to write |