File types. More...

Data Structures

struct  zos_file_t
 Basic information about the file. More...
 
struct  zos_file_parameters_t
 File listing parameters. More...
 
struct  zos_file_descriptor_t
 Information about a file opened for reading or writing. More...
 
struct  zos_file_system_stats_t
 Statistics about the file system. More...
 
struct  zos_log_stats_t
 Information about a log file. More...
 

Typedefs

typedef zos_bool_t(* zos_file_list_callback_t) (void *user, zos_file_t *info)
 Callback to determine if a file should be returned with zn_file_list_with_callback() More...
 
typedef uint16_t zos_log_header_t
 Header prepended to each log record. More...
 

Enumerations

enum  zos_file_type_t {
  FILE_TYPE_KERNEL = 0x00,
  FILE_TYPE_WIFI_FW = 0x01,
  FILE_TYPE_SHARED_LIB = 0x02,
  FILE_TYPE_TLS_CERT = 0x03,
  FILE_TYPE_LOG = 0x04,
  FILE_TYPE_NVM = 0x05,
  FILE_TYPE_MISC_APP = 0x80,
  FILE_TYPE_REGULAR_APP = 0x81,
  FILE_TYPE_SUB_APP = 0x82,
  FILE_TYPE_ZAP = 0x83,
  FILE_TYPE_SAFEMODE_APP = 0x84,
  FILE_TYPE_USER_RANGE_START = 150,
  FILE_TYPE_USER_RANGE_END = 199,
  FILE_TYPE_TEMPORARY = 0xF9,
  FILE_TYPE_GPIO_CONFIG = 0xFA,
  FILE_TYPE_COMMAND_HELP = 0xFB ,
  FILE_TYPE_SETUP_SCRIPT = 0xFD,
  FILE_TYPE_MISC_FIX_LEN = 0xFE,
  FILE_TYPE_INVALID = 0xFF
}
 The type of file. More...
 
enum  zos_file_flag_t {
  FILE_FLAG_VALID = (1 << 0),
  FILE_FLAG_EXECUTABLE = (1 << 1),
  FILE_FLAG_ENCRYPTED = (1 << 2),
  FILE_FLAG_INTERNAL = (1 << 3),
  FILE_FLAG_BOOTABLE = (1 << 4),
  FILE_FLAG_USER = (1 << 5),
  FILE_FLAG_ESSENTIAL = (1 << 6),
  FILE_FLAG_BACKUP = (1 << 7),
  FILE_FLAG_UNPROTECTED = (1 << 8),
  FILE_FLAG_LOG = (1 << 9),
  FILE_FLAG_USER_ENCRYPTED = (1 << 10),
  FILE_FLAG_INVALID = 0xFFFF
}
 File flags. More...
 
enum  zos_file_memory_t {
  FILE_MEMORY_INTERNAL = 0x1,
  FILE_MEMORY_EXTENDED = 0x2,
  FILE_MEMORY_BULK = 0x4,
  FILE_MEMORY_INTERNAL_OR_EXTENDED = (FILE_MEMORY_INTERNAL|FILE_MEMORY_EXTENDED),
  FILE_MEMORY_EXTENDED_OR_BULK = (FILE_MEMORY_EXTENDED|FILE_MEMORY_BULK),
  FILE_MEMORY_ALL = FILE_MEMORY_INTERNAL|FILE_MEMORY_EXTENDED|FILE_MEMORY_BULK
}
 File memory type. More...
 

Detailed Description

File types.

Typedef Documentation

typedef zos_bool_t(* zos_file_list_callback_t) (void *user, zos_file_t *info)

Callback to determine if a file should be returned with zn_file_list_with_callback()

This callback is called for each found file in zn_file_list_with_callback(). If the return value of the callback is ZOS_TRUE then the file is included in the file listing. If the return value is ZOS_FALSE the file is omitted from the file listing.

Parameters
userOptional user argument supplied to zn_file_list_with_callback()
infoThe found file's information, zos_file_t
Returns
ZOS_TRUE if the file should be included in the listing, ZOS_FALSE else
typedef uint16_t zos_log_header_t

Header prepended to each log record.

Note
If the most-significant bit is cleared (i.e. 0) then the record is valid else the record is invalid (i.e. the log record data may not have been successfully written)

Enumeration Type Documentation

File flags.

Enumerator
FILE_FLAG_VALID 

Valid within the file system (system use only)

FILE_FLAG_EXECUTABLE 

Executable (system use only)

FILE_FLAG_ENCRYPTED 

Encrypted (system use only)

FILE_FLAG_INTERNAL 

Resides on internal MCU flash (system use only)

FILE_FLAG_BOOTABLE 

Bootable image (system use only)

FILE_FLAG_USER 

Created by a serial command (system use only)

FILE_FLAG_ESSENTIAL 

Essential, refer to the Wiki for more info.

FILE_FLAG_BACKUP 

Backed up on extended flash (system use only)

FILE_FLAG_UNPROTECTED 

NOT protected by the HTTP server auth credentials, refer to the Wiki for more info.

FILE_FLAG_LOG 

Log file, use the zn_file_read_log() / zos_file_append_log() APIs to read/write log records.

FILE_FLAG_USER_ENCRYPTED 

File is encrypted with a user specified AES-128 key, See ZentriOS variable API documentation: system.security_key {"target":"_blank"}

FILE_FLAG_INVALID 

Invalid.

File memory type.

Enumerator
FILE_MEMORY_INTERNAL 

Wi-Fi module internal MCU flash memory.

FILE_MEMORY_EXTENDED 

Wi-Fi module on-board serial flash memory.

FILE_MEMORY_BULK 

External (to Wi-Fi module) serial flash memory.

FILE_MEMORY_INTERNAL_OR_EXTENDED 

File on internal or extended flash.

FILE_MEMORY_EXTENDED_OR_BULK 

File on extended or bulk flash.

FILE_MEMORY_ALL 

File on any/all memories.

The type of file.

Custom file types should be within the range: FILE_TYPE_USER_RANGE_START to FILE_TYPE_USER_RANGE_END

Enumerator
FILE_TYPE_KERNEL 

kernel type (system use only)

FILE_TYPE_WIFI_FW 

wifi_fw.bin type (system use only)

FILE_TYPE_SHARED_LIB 

Shared library type (system use only)

FILE_TYPE_TLS_CERT 

TLS certificate.

FILE_TYPE_LOG 

Text log (system use only)

FILE_TYPE_NVM 

Non-volatile Memory file (system use only)

FILE_TYPE_MISC_APP 

Miscellaneous application (system use only)

FILE_TYPE_REGULAR_APP 

Regular application (system use only)

FILE_TYPE_SUB_APP 

Sub-application (system use only)

FILE_TYPE_ZAP 

ZentriOS App file type (system use only)

FILE_TYPE_SAFEMODE_APP 

Safemode application.

FILE_TYPE_USER_RANGE_START 

Custom file type start range.

FILE_TYPE_USER_RANGE_END 

Custom file type end range.

FILE_TYPE_TEMPORARY 

Temporary file (system use only)

FILE_TYPE_GPIO_CONFIG 

GPIO configuration file.

FILE_TYPE_COMMAND_HELP 

Command help file.

FILE_TYPE_SETUP_SCRIPT 

Setup script file.

FILE_TYPE_MISC_FIX_LEN 

Miscellaneous fixed length file.

FILE_TYPE_INVALID 

Invalid file types.