File types. More...

Data Structures

struct gos_file_t
struct gos_file_descriptor_t
struct gos_file_list_parameters_t
struct gos_file_system_stats_t
Statistics about the file system. More...

Typedefs

typedef uint32_t gos_file_handle_t
typedef gos_result_t (* gos_file_list_callback_t ) (const gos_file_t *file, void *user)

Enumerations

enum gos_file_type_t {
GOS_FILE_TYPE_UNKNOWN = 0x00,
GOS_FILE_TYPE_KERNEL = 0x01,
GOS_FILE_TYPE_WIFI_FW = 0x02,
GOS_FILE_TYPE_NVM_DEFAULTS = 0x03,
GOS_FILE_TYPE_WEAR_LEVELING_TABLE = 0x04,
GOS_FILE_TYPE_DEVICE_CREDENTIALS = 0x05,
GOS_FILE_TYPE_SAFEMODE_APP = 0x06,
GOS_FILE_TYPE_PLUGINS_APP = 0x07,
GOS_FILE_TYPE_USER_APP = 0x08,
GOS_FILE_TYPE_NVM_USER_DEFAULTS = 0x09,
GOS_FILE_TYPE_FIRST_STAGE_BOOTLOADER = 0x0A,
GOS_FILE_TYPE_SECOND_STAGE_BOOTLOADER = 0x0B,
GOS_FILE_TYPE_USER_TYPES_START = 0x40,
GOS_FILE_TYPE_LOG = 0x40,
GOS_FILE_TYPE_TLS_CERTIFICATE = 0x41,
GOS_FILE_TYPE_DEFAULT_CONFIG = 0x42,
GOS_FILE_TYPE_SETTINGS_CSV = 0x43,
GOS_FILE_TYPE_GENERAL = 0x44,
GOS_FILE_TYPE_WEB_APP = 0x45,
GOS_FILE_TYPE_CUSTOM_START = 0x80,
GOS_FILE_TYPE_CUSTOM_END = 0xFE,
GOS_FILE_TYPE_USER_TYPES_END = 0xFE,
GOS_FILE_TYPE_INVALID = 0xFF,
GOS_FILE_TYPE_ANY = 0x00
}
enum gos_file_flag_t {
GOS_FILE_FLAG_NONE = 0x00,
GOS_FILE_FLAG_VALID = (1 << 0),
GOS_FILE_FLAG_EXECUTABLE = (1 << 1),
GOS_FILE_FLAG_KERNEL_ONLY = (1 << 2),
GOS_FILE_FLAG_DFU_OUT_DATED = (1 << 3),
GOS_FILE_FLAG_DFU_ONLY = (1 << 4),
GOS_FILE_FLAG_DFU_COPY = (1 << 5) ,
GOS_FILE_FLAG_ENCRYPTED = (1 << 8),
GOS_FILE_FLAG_ESSENTIAL = (1 << 9),
GOS_FILE_FLAG_CHECKSUM_VALID = (1 << 10),
GOS_FILE_FLAG_PRE_ENCRYPTED = (1 << 11),
GOS_FILE_FLAG_SIGNED = (1 << 12)
}
enum gos_file_owner_t {
GOS_FILE_OWNER_NONE = 0,
GOS_FILE_OWNER_PRODUCT = 1,
GOS_FILE_OWNER_DEVICE = 2,
GOS_FILE_OWNER_USER = 3,
GOS_FILE_OWNER_INVALID = 0xFF
}
enum gos_file_permission_t {
GOS_FILE_PERMISSION_NONE = 0,
GOS_FILE_PERMISSION_SERIAL_BUS = (1 << 0),
GOS_FILE_PERMISSION_REMOTE_TERMINAL = (1 << 1),
GOS_FILE_PERMISSION_HTTP_API = (1 << 2),
GOS_FILE_PERMISSION_BLUETOOTH = (1 << 3),
GOS_FILE_PERMISSION_ZIGBEE = (1 << 4),
GOS_FILE_PERMISSION_ALL = 0xFFFF
}
enum gos_file_location_t {
GOS_FILE_LOCATION_UNKNOWN = 0,
GOS_FILE_LOCATION_INTERNAL = 1,
GOS_FILE_LOCATION_EXTENDED = 2,
GOS_FILE_LOCATION_BULK = 3,
GOS_FILE_LOCATION_STANDARD_COUNT = 3,
GOS_FILE_LOCATION_BOOTLOADER = 4,
GOS_FILE_LOCATION_ONBOARD_DEVICE = 0xFC,
GOS_FILE_LOCATION_ALL_WRITABLE = 0xFD,
GOS_FILE_LOCATION_ANY = 0xFE,
GOS_FILE_LOCATION_INVALID = 0xFF
}
enum gos_file_location_mask_t {
GOS_FILE_LOCATION_MASK_NULL = 0,
GOS_FILE_LOCATION_MASK_INTERNAL = (1 << 0),
GOS_FILE_LOCATION_MASK_EXTENDED = (1 << 1),
GOS_FILE_LOCATION_MASK_BULK = (1 << 2) ,
GOS_FILE_LOCATION_MASK_NON_INTERNAL = ~GOS_FILE_LOCATION_MASK_INTERNAL,
GOS_FILE_LOCATION_MASK_ALL = 0xff
}
enum gos_file_mode_t {
GOS_FILE_MODE_READ ,
GOS_FILE_MODE_WRITE ,
GOS_FILE_MODE_READ_WRITE
}

Detailed Description

File types.

Typedef Documentation

gos_file_handle_t

typedef uint32_t gos_file_handle_t

File handle

gos_file_list_callback_t

typedef gos_result_t (* gos_file_list_callback_t) (const gos_file_t *file, void *user)

Callback invoked when listing files

This is a callback that is invoked for each listed file. This may be used to provide further filtering.

Parameters
file Details about current file, see gos_file_t
user User provided argument provided to listing API
Returns
IF GOS_SUCCESS then add file to listing, ELIF GOS_ABORTED then drop file from listing, ELSE quit file listing and return error

Enumeration Type Documentation

gos_file_flag_t

File flags

Enumerator
GOS_FILE_FLAG_NONE

Null flags.

GOS_FILE_FLAG_VALID

File is valid on file system (reserved for system use)

GOS_FILE_FLAG_EXECUTABLE

File is executable (reserved for system use)

GOS_FILE_FLAG_KERNEL_ONLY

File is accessible to the Kernel only (reserved for system use)

GOS_FILE_FLAG_DFU_OUT_DATED

File is out-dated by a DFU and should be removed (reserved for system use)

GOS_FILE_FLAG_DFU_ONLY

File is for DFU only (reserved for system use)

GOS_FILE_FLAG_DFU_COPY

File should be copied to internal flash (reserved for system use)

GOS_FILE_FLAG_ENCRYPTED

File is encrypted.

GOS_FILE_FLAG_ESSENTIAL

File is essential to the system, it will NEVER be erased during DFU.

GOS_FILE_FLAG_CHECKSUM_VALID

The file's checksum is valid. This flag must be set if specifying a checksum during file creation.

GOS_FILE_FLAG_PRE_ENCRYPTED

The file's data was pre-encrypted. If set, the Kernel does not encrypt the file data as it is written.

GOS_FILE_FLAG_SIGNED

The file's data is signed by either the product or device auth key; the last 64 bytes contains the signature.

gos_file_location_mask_t

File location bitmask

See gos_file_location_t for more information

Enumerator
GOS_FILE_LOCATION_MASK_NULL

Null.

GOS_FILE_LOCATION_MASK_INTERNAL

Internal flash.

GOS_FILE_LOCATION_MASK_EXTENDED

Extended flash.

GOS_FILE_LOCATION_MASK_BULK

Bulk flash.

GOS_FILE_LOCATION_MASK_NON_INTERNAL

Non-internal locations.

GOS_FILE_LOCATION_MASK_ALL

All locations.

gos_file_location_t

File location

This specifies where the file resides.

Enumerator
GOS_FILE_LOCATION_UNKNOWN

Unknown.

GOS_FILE_LOCATION_INTERNAL

Internal flash (system use only)

GOS_FILE_LOCATION_EXTENDED

Extended flash.

GOS_FILE_LOCATION_BULK

Bulk flash.

GOS_FILE_LOCATION_STANDARD_COUNT

Standard file location count.

GOS_FILE_LOCATION_BOOTLOADER

Bootloader memory (system use only)

GOS_FILE_LOCATION_ONBOARD_DEVICE

Locations onboard the device (Internal and extended)

GOS_FILE_LOCATION_ALL_WRITABLE

All writable locations (Extended and Bulk)

GOS_FILE_LOCATION_ANY

Any location.

GOS_FILE_LOCATION_INVALID

Invalid location.

gos_file_mode_t

File I/O Mode

Note
This is a read-only property of the file.
Enumerator
GOS_FILE_MODE_READ

File is opened for reading.

GOS_FILE_MODE_WRITE

File is opened for writing.

GOS_FILE_MODE_READ_WRITE

File is opened for reading or writing.

gos_file_owner_t

File owner

The file's owner indicates which encryption key is used to encrypt/decrypt a file.

Enumerator
GOS_FILE_OWNER_NONE

No owner.

GOS_FILE_OWNER_PRODUCT

File owned by DMS product (system used only)

GOS_FILE_OWNER_DEVICE

File owned by the device (if the GOS_FILE_FLAG_ENCRYPTED flag is set then the device's encryption key is used for encryption/decryption)

GOS_FILE_OWNER_USER

File owned by user (if the GOS_FILE_FLAG_ENCRYPTED flag is set then the system.security_key encryption key is used for encryption/decryption)

GOS_FILE_OWNER_INVALID

Invalid owner.

gos_file_permission_t

File permissions

The file permissions indicates which command interface has access to the file.

Note
The File APIs always have access to the files regardless of the permissions set.
Enumerator
GOS_FILE_PERMISSION_NONE

No permissions, the file is not accessible to any command interfaces.

GOS_FILE_PERMISSION_SERIAL_BUS

Serial bus (e.g. UART, SPI, USB)

GOS_FILE_PERMISSION_REMOTE_TERMINAL

Remote terminal.

GOS_FILE_PERMISSION_HTTP_API

HTTP API (REST and websocket)

GOS_FILE_PERMISSION_BLUETOOTH

Bluetooth.

GOS_FILE_PERMISSION_ZIGBEE

Zigbee.

GOS_FILE_PERMISSION_ALL

All command interfaces have access to the file.

gos_file_type_t

File types

Types before GOS_FILE_TYPE_USER_TYPES_START are reserved for system use. Types before GOS_FILE_TYPE_CUSTOM_START are available to the user, but new values may not be defined by the user. Types after GOS_FILE_TYPE_CUSTOM_START are available to the user and the user may define new values.

Enumerator
GOS_FILE_TYPE_UNKNOWN

Unknown file type.

GOS_FILE_TYPE_KERNEL

Gecko OS Kernel.

GOS_FILE_TYPE_WIFI_FW

Gecko OS Wi-Fi chip firmware.

GOS_FILE_TYPE_NVM_DEFAULTS

Gecko OS NVM defaults.

GOS_FILE_TYPE_WEAR_LEVELING_TABLE

Gecko OS Wear leveling table.

GOS_FILE_TYPE_DEVICE_CREDENTIALS

Gecko OS Device security credentials.

GOS_FILE_TYPE_SAFEMODE_APP

Gecko OS safemode app.

GOS_FILE_TYPE_PLUGINS_APP

Gecko OS default plugins app.

GOS_FILE_TYPE_USER_APP

Gecko OS user app.

GOS_FILE_TYPE_NVM_USER_DEFAULTS

Gecko OS user NVM defaults.

GOS_FILE_TYPE_FIRST_STAGE_BOOTLOADER

Gecko OS first stage bootloader.

GOS_FILE_TYPE_SECOND_STAGE_BOOTLOADER

Gecko OS second stage bootloader.

GOS_FILE_TYPE_USER_TYPES_START

Start of file types available to user.

GOS_FILE_TYPE_LOG

Log file.

GOS_FILE_TYPE_TLS_CERTIFICATE

TLS certificate.

GOS_FILE_TYPE_DEFAULT_CONFIG

Default configuration file.

GOS_FILE_TYPE_SETTINGS_CSV

Settings.

GOS_FILE_TYPE_GENERAL

General.

GOS_FILE_TYPE_WEB_APP

Web application.

GOS_FILE_TYPE_CUSTOM_START

Start of types custom defined by user.

GOS_FILE_TYPE_CUSTOM_END

End of types custom defined by user.

GOS_FILE_TYPE_USER_TYPES_END

End of types available to user.

GOS_FILE_TYPE_INVALID

Invalid file type.

GOS_FILE_TYPE_ANY

Any file type.