40 #ifndef WSF_EFS_MAX_FILES    41 #define WSF_EFS_MAX_FILES                   6    45 #ifndef WSF_EFS_MAX_MEDIA    46 #define WSF_EFS_MAX_MEDIA                   4    53 #define WSF_EFS_SUCCESS                     0                 54 #define WSF_EFS_FAILURE                     1                 55 #define WSF_EFS_GET_FAILED                  0xFFFF            56 #define WSF_EFS_PUT_FAILED                  0xFFFF            64 #define WSF_EFS_INVALID_HANDLE              0xFFFF            65 #define WSF_EFS_INVALID_OFFSET              0xFFFFFFFF        66 #define WSF_EFS_INVALID_SIZE                0xFFFFFFFF        67 #define WSF_EFS_INVALID_MEDIA               0xFF              74 #define WSF_EFS_FILE_TYPE_BULK              0                 75 #define WSF_EFS_FILE_TYPE_STREAM            1                 79 #define WSF_EFS_FILE_OFFSET_ANY             0xFFFFFFFF    85 #define WSF_EFS_REMOTE_PERMISSIONS_MASK     0xFF              86 #define WSF_EFS_REMOTE_GET_PERMITTED        0x01              87 #define WSF_EFS_REMOTE_PUT_PERMITTED        0x02              88 #define WSF_EFS_REMOTE_ERASE_PERMITTED      0x04              89 #define WSF_EFS_REMOTE_VERIFY_PERMITTED     0x08              90 #define WSF_EFS_LOCAL_GET_PERMITTED         0x0100            91 #define WSF_EFS_LOCAL_PUT_PERMITTED         0x0200            92 #define WSF_EFS_LOCAL_ERASE_PERMITTED       0x0400            93 #define WSF_EFS_REMOTE_VISIBLE              0x0800            97 #define WSF_EFS_NAME_LEN                    16   100 #define WSF_EFS_VERSION_LEN                 16   106 #define WSF_EFS_WDXS_PUT_COMPLETE_CMD       0x00             107 #define WSF_EFS_VALIDATE_CMD                0x01             111 #define WSF_EFS_USER_CMD                    0x80   307 uint16_t 
WsfEfsGet(wsfEfsHandle_t handle, uint32_t offset, uint8_t *pBuffer, uint16_t len);
   321 uint16_t 
WsfEfsPut(wsfEfsHandle_t handle, uint32_t offset, 
const uint8_t *pBuffer, uint16_t len);
 uint8_t wsfMediaEraseFunc_t(uint8_t *pAddress, uint32_t size)
Media Erase function. 
uint8_t WsfEfsErase(wsfEfsHandle_t handle)
Clears the contents of a file without deleting the file. 
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. 
uint16_t permissions
File permissions. 
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. 
uint8_t wsfMediaWriteFunc_t(const uint8_t *pBuf, uint8_t *pAddress, uint32_t size)
Media Write function. 
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. 
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. 
uint8_t wsfMediaReadFunc_t(uint8_t *pBuf, uint8_t *pAddress, uint32_t size)
Media Read function. 
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. 
wsfEfsHandle_t handle
File handle. 
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. 
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. 
uint32_t address
File storage address. 
const wsfEfsMedia_t * pWsfEfsMedia_t
Pointer to Media Control data type. 
#define WSF_EFS_VERSION_LEN
File version length in bytes. 
File attributes data type. 
uint32_t WsfEfsGetFileSize(wsfEfsHandle_t handle)
Get the size of a file. 
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. 
#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. 
wsfEsfAttributes_t attributes
File attributes. 
uint32_t maxSize
File maximum size.