nl::Weave::Platform::PersistedStorage

摘要

Typedefs

Key typedef

函式

Read(Key aKey, uint32_t & aValue)
從永久儲存空間讀取索引鍵的整數值。
Read(const char *aKey, uint32_t & aValue)
Write(Key aKey, uint32_t aValue)
將索引鍵的整數值寫入永久儲存空間。
Write(const char *aKey, uint32_t aValue)

Typedefs

WEAVE_CONFIG_PERSISTED_STORAGE_KEY_TYPE Key

函式

讀取

WEAVE_ERROR Read(
  Key aKey,
  uint32_t & aValue
)

從永久儲存空間讀取索引鍵的整數值。

平台負責驗證 aKey。

詳細說明
參數
[in] aKey
永久儲存值的索引鍵。
[in,out] aValue
整數值的參照。
傳回
如果 aKey 不存在,則當 aKey 為空值 WEAVE_ERROR_INVALID_STRING_LENGTH 時,則為 WEAVE_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH WEAVE_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND (否則傳回 WEAVE_NO_ERROR)

讀取

WEAVE_ERROR Read(
  const char *aKey,
  uint32_t & aValue
)

撰寫

WEAVE_ERROR Write(
  Key aKey,
  uint32_t aValue
)

將索引鍵的整數值寫入永久儲存空間。

平台負責驗證 aKey。如果鍵不存在,系統會建立該鍵並指定一個值。否則,Key 的所有現有值都會替換為 aValue。

詳細說明
參數
[in] aKey
永久儲存值的索引鍵。
[in] aValue
值。
傳回
如果 aKey 超過 WEAVE_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH WEAVE_NO_ERROR,如果 aKey 為空值 WEAVE_ERROR_INVALID_STRING_LENGTH

撰寫

WEAVE_ERROR Write(
  const char *aKey,
  uint32_t aValue
)