35 #ifndef WSF_EFS_MAX_FILES 36 #define WSF_EFS_MAX_FILES 6 40 #ifndef WSF_EFS_MAX_MEDIA 41 #define WSF_EFS_MAX_MEDIA 4 48 #define WSF_EFS_SUCCESS 0 49 #define WSF_EFS_FAILURE 1 50 #define WSF_EFS_GET_FAILED 0xFFFF 51 #define WSF_EFS_PUT_FAILED 0xFFFF 59 #define WSF_EFS_INVALID_HANDLE 0xFFFF 60 #define WSF_EFS_INVALID_OFFSET 0xFFFFFFFF 61 #define WSF_EFS_INVALID_SIZE 0xFFFFFFFF 62 #define WSF_EFS_INVALID_MEDIA 0xFF 69 #define WSF_EFS_FILE_TYPE_BULK 0 70 #define WSF_EFS_FILE_TYPE_STREAM 1 74 #define WSF_EFS_FILE_OFFSET_ANY 0xFFFFFFFF 80 #define WSF_EFS_REMOTE_PERMISSIONS_MASK 0xFF 81 #define WSF_EFS_REMOTE_GET_PERMITTED 0x01 82 #define WSF_EFS_REMOTE_PUT_PERMITTED 0x02 83 #define WSF_EFS_REMOTE_ERASE_PERMITTED 0x04 84 #define WSF_EFS_REMOTE_VERIFY_PERMITTED 0x08 85 #define WSF_EFS_LOCAL_GET_PERMITTED 0x0100 86 #define WSF_EFS_LOCAL_PUT_PERMITTED 0x0200 87 #define WSF_EFS_LOCAL_ERASE_PERMITTED 0x0400 88 #define WSF_EFS_REMOTE_VISIBLE 0x0800 92 #define WSF_EFS_NAME_LEN 16 95 #define WSF_EFS_VERSION_LEN 16 101 #define WSF_EFS_WDXS_PUT_COMPLETE_CMD 0x00 102 #define WSF_EFS_VALIDATE_CMD 0x01 106 #define WSF_EFS_USER_CMD 0x80 uint8_t WsfEfsErase(wsfEfsHandle_t handle)
Clears the contents of a file without deleting the file.
wsfEsfAttributes_t attributes
File attributes.
uint16_t wsfEfsHandle_t
File handle data type.
uint8_t WsfEfsMediaSpecificCommand(wsfEfsHandle_t handle, uint8_t cmd, uint32_t param)
Execute a media specific command on a file.
uint8_t wsfMediaReadFunc_t(uint8_t *pBuf, uint32_t address, uint32_t size)
Media Read function.
uint16_t WsfEfsPut(wsfEfsHandle_t handle, uint32_t offset, const uint8_t *pBuffer, uint16_t len)
Writes data to a file.
wsfEsfAttributes_t attributes
File attributes.
File Listing Information.
uint16_t permissions
File permissions.
char * WsfEfsGetFileVersion(wsfEfsHandle_t handle)
Get the version of a file.
wsfEfsHandle_t WsfEfsAddFile(uint32_t maxSize, uint8_t media, wsfEsfAttributes_t *pAttr, uint32_t offset)
Create a file in the embedded file system.
uint32_t address
File storage address.
wsfEfsHandle_t handle
File handle.
uint8_t wsfMediaInitFunc_t(void)
Media Init function, called when media is registered.
uint8_t WsfEfsGetAttributes(wsfEfsHandle_t handle, wsfEsfAttributes_t *pAttr)
Gets the attributes of a file.
uint16_t WsfEfsGetFilePermissions(wsfEfsHandle_t handle)
Get the permissions of a file.
uint8_t wsfMediaHandleCmdFunc_t(uint8_t cmd, uint32_t param)
Media Specific Command handler.
void WsfEfsInit(void)
Initialise the embedded file system.
uint8_t WsfEfsRegisterMedia(const wsfEfsMedia_t *pMediaCtrl, uint8_t mediaID)
Registers a File Storage Medium with the Embedded File System.
uint32_t WsfEfsGetFileMaxSize(wsfEfsHandle_t handle)
Get the number of bytes of memory reserved for use by a file.
unsigned long uint32_t
Unsigned 32-bit value.
uint8_t WsfEfsSetAttributes(wsfEfsHandle_t handle, wsfEsfAttributes_t *pInfo)
Updates the attributes of a file.
uint16_t WsfEfsGet(wsfEfsHandle_t handle, uint32_t offset, uint8_t *pBuffer, uint16_t len)
Copies data from a file.
const wsfEfsMedia_t * pWsfEfsMedia_t
Pointer to Media Control data type.
#define WSF_EFS_VERSION_LEN
File version length in bytes.
uint8_t wsfMediaWriteFunc_t(const uint8_t *pBuf, uint32_t address, uint32_t size)
Media Write function.
File attributes data type.
uint32_t WsfEfsGetFileSize(wsfEfsHandle_t handle)
Get the size of a file.
unsigned short uint16_t
Unsigned 16-bit value.
char * WsfEfsGetFileName(wsfEfsHandle_t handle)
Get the name of a file.
uint8_t WsfEfsGetFileType(wsfEfsHandle_t handle)
Get the type of a file.
uint8_t WsfEfsRemoveFile(wsfEfsHandle_t handle)
Deletes a file in the embedded file system.
uint32_t maxSize
File maximum size.
#define WSF_EFS_NAME_LEN
File name length in bytes.
wsfEfsControl_t * WsfEfsGetFileByHandle(wsfEfsHandle_t handle)
Returns the file control block for the given handle.
File control block data type.
unsigned char uint8_t
Unsigned 8-bit value.
uint8_t wsfMediaEraseFunc_t(uint32_t address, uint32_t size)
Media Erase function.