25 #ifndef XBEE_FILE_SYSTEM_H 26 #define XBEE_FILE_SYSTEM_H 35 #define XBEE_FRAME_FILE_SYSTEM_REQ 0x3B 46 #define XBEE_FRAME_REMOTE_FS_REQ 0x3C 61 #define XBEE_FS_CMD_ID_FILE_OPEN 0x01 62 #define XBEE_FS_CMD_ID_FILE_CLOSE 0x02 63 #define XBEE_FS_CMD_ID_FILE_READ 0x03 64 #define XBEE_FS_CMD_ID_FILE_WRITE 0x04 65 #define XBEE_FS_CMD_ID_FILE_HASH 0x08 67 #define XBEE_FS_CMD_ID_DIR_CREATE 0x10 68 #define XBEE_FS_CMD_ID_DIR_OPEN 0x11 69 #define XBEE_FS_CMD_ID_DIR_CLOSE 0x12 70 #define XBEE_FS_CMD_ID_DIR_READ 0x13 71 #define XBEE_FS_CMD_ID_GET_PATH_ID 0x1C 73 #define XBEE_FS_CMD_ID_RENAME 0x21 74 #define XBEE_FS_CMD_ID_DELETE 0x2F 76 #define XBEE_FS_CMD_ID_VOL_STAT 0x40 77 #define XBEE_FS_CMD_ID_VOL_FORMAT 0x4F 79 #define XBEE_FS_OPT_CREATE (1<<0) // create if file/dir doesn't exist 80 #define XBEE_FS_OPT_EXCLUSIVE (1<<1) // error out if file/dir exists 81 #define XBEE_FS_OPT_READ (1<<2) // open file for reading 82 #define XBEE_FS_OPT_WRITE (1<<3) // open file for writing 83 #define XBEE_FS_OPT_TRUNCATE (1<<4) // truncate file to 0 bytes 84 #define XBEE_FS_OPT_APPEND (1<<5) // append to end of file 85 #define XBEE_FS_OPT_SECURE (1<<7) // create a secure file 118 #define XBEE_FS_OFFSET_CURRENT 0xFFFFFFFF 121 #define XBEE_FS_BYTE_COUNT_MAX 0xFFFF 165 #define XBEE_FRAME_FILE_SYSTEM_RESP 0xBB 182 #define XBEE_FRAME_REMOTE_FS_RESP 0xBC 204 #define XBEE_FS_STATUS_SUCCESS 0x00 205 #define XBEE_FS_STATUS_UNKNOWN_ERROR 0x01 206 #define XBEE_FS_STATUS_INVALID_COMMAND 0x02 207 #define XBEE_FS_STATUS_INVALID_PARAM 0x03 208 #define XBEE_FS_STATUS_ACCESS_DENIED 0x50 209 #define XBEE_FS_STATUS_ALREADY_EXISTS 0x51 210 #define XBEE_FS_STATUS_DOES_NOT_EXIST 0x52 211 #define XBEE_FS_STATUS_INVALID_NAME 0x53 212 #define XBEE_FS_STATUS_IS_DIRECTORY 0x54 213 #define XBEE_FS_STATUS_DIR_NOT_EMPTY 0x55 214 #define XBEE_FS_STATUS_EOF 0x56 215 #define XBEE_FS_STATUS_HW_FAILURE 0x57 216 #define XBEE_FS_STATUS_NO_DEVICE 0x58 217 #define XBEE_FS_STATUS_VOLUME_FULL 0x59 218 #define XBEE_FS_STATUS_TIMED_OUT 0x5A 219 #define XBEE_FS_STATUS_BUSY 0x5B 220 #define XBEE_FS_STATUS_RESOURCE_FAILURE 0x5C 230 }) xbee_payload_fs_dir_entry_t;
232 #define XBEE_FS_DIR_ENTRY_IS_DIR (UINT32_C(1)<<31) 233 #define XBEE_FS_DIR_ENTRY_IS_SECURE (UINT32_C(1)<<30) 234 #define XBEE_FS_DIR_ENTRY_IS_LAST (UINT32_C(1)<<24) 235 #define XBEE_FS_DIR_ENTRY_FLAG_MASK UINT32_C(0xFF000000) 268 #define XBEE_FS_MAX_PATH_ELEMENT_LEN 64 277 char name[XBEE_FS_MAX_PATH_ELEMENT_LEN + 1];
287 #define xbee_fs_req_send(xbee, header_data, header_len, target) \ 288 xbee_fs_req_send_data(xbee, NULL, 0, header_data, header_len, target) 290 #define xbee_fs_req_send_str(xbee, header_data, header_len, var_str, target) \ 291 xbee_fs_req_send_data(xbee, header_data, header_len, \ 292 var_str, strlen(var_str), target) 295 const void *header_data,
uint16_t header_len,
296 const void *payload,
uint16_t payload_len,
300 #endif // XBEE_FILE_SYSTEM_H unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
int xbee_fs_req_send_data(xbee_dev_t *xbee, const void *header_data, uint16_t header_len, const void *payload, uint16_t payload_len, const addr64 FAR *target_ieee)
Send a File System Request to the local or a remote XBee module.
Definition: xbee_file_system.c:36
WPAN datatypes and support functions, valid for ZigBee and DigiMesh.
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
Format for the payload of "File Write" File System Request.
Definition: file_system.h:144
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
Format for the payload of "File Open" File System Request.
Definition: file_system.h:113
Format for the payload of File System Request with path_id and name:
Definition: file_system.h:101
Format for a directory entry in a Directory Read Response.
Definition: file_system.h:230
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
Format for the payload of "File Close" File System Request.
Definition: file_system.h:152
unsigned char uint8_t
8-bit unsigned integer
Definition: platform_config.h:39
Format for the payload of File System Response: File Open.
Definition: file_system.h:243
int xbee_fs_extract_dir_entry(xbee_fs_dir_entry_t *entry, const uint8_t FAR *payload, int length)
Send a File System Request to the local or a remote XBee module.
Definition: xbee_file_system.c:84
Typedef used to hold a 64-bit IEEE address, represented as 8 bytes, 4 16-bit values or 2 32-bit value...
Definition: types.h:34
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
Format for the payload of "Directory Read/Close" File System Requests.
Definition: file_system.h:161
Format for the payload of "File Read" File System Request.
Definition: file_system.h:132
Format for the payload of File System Response: File Read/File Write.
Definition: file_system.h:254
Format for the payload of File System Response: Volume Stat/Format.
Definition: file_system.h:264