ESP-IDF
nvs::Item
is only used within ESP-IDF.
Symbol previews are coming soon...
Symbols
loading...
Files
loading...
Summary
Syntax
Methods
Related
Examples
References
Call Tree
Data Use
Class Tree
Override Tree
Implementations
Instances
Lifecycle
SourceVu
ESP-IDF Framework and Examples
ESP-IDF
nvs::Item
nvs::Item class
Syntax
Show:
Summary
Declaration
from
nvs_types.hpp:42
class
Item
{
public
:
union
{
struct
{
uint8_t
nsIndex
;
ItemType
datatype
;
uint8_t
span
;
uint8_t
chunkIndex
;
uint32_t
crc32
;
char
key
[
NVS_KEY_NAME_MAX_SIZE
]
;
union
{
struct
{
uint16_t
dataSize
;
uint16_t
reserved
;
uint32_t
dataCrc32
;
}
varLength
;
struct
{
uint32_t
dataSize
;
uint8_t
chunkCount
;
VerOffset
chunkStart
;
uint16_t
reserved
;
}
blobIndex
;
uint8_t
data
[
8
]
;
}
;
}
;
uint8_t
rawData
[
32
]
;
}
;
static
const
size_t
MAX_KEY_LENGTH
=
sizeof
(
key
)
-
1
;
static
const
uint8_t
CHUNK_ANY
=
0xff
;
Item
(
uint8_t
nsIndex
,
ItemType
datatype
,
uint8_t
span
,
const
char
*
key_
,
uint8_t
chunkIdx
=
CHUNK_ANY
)
:
nsIndex
(
nsIndex
)
,
datatype
(
datatype
)
,
span
(
span
)
,
chunkIndex
(
chunkIdx
)
{
std
::
fill_n
(
reinterpret_cast
<
uint32_t
*
>
(
key
)
,
sizeof
(
key
)
/
4
,
0xffffffff
)
;
std
::
fill_n
(
reinterpret_cast
<
uint32_t
*
>
(
data
)
,
sizeof
(
data
)
/
4
,
0xffffffff
)
;
if
(
key_
)
{
strncpy
(
key
,
key_
,
sizeof
(
key
)
-
1
)
;
key
[
sizeof
(
key
)
-
1
]
=
0
;
}
else
{
key
[
0
]
=
0
;
}
}
Item
(
)
{
}
uint32_t
calculateCrc32
(
)
const
;
uint32_t
calculateCrc32WithoutValue
(
)
const
;
static
uint32_t
calculateCrc32
(
const
uint8_t
*
data
,
size_t
size
)
;
void
getKey
(
char
*
dst
,
size_t
dstSize
)
{
strncpy
(
dst
,
key
,
min
(
dstSize
,
sizeof
(
key
)
)
)
;
dst
[
dstSize
-
1
]
=
0
;
}
template
<
typename
T
>
esp_err_t
getValue
(
T
&
dst
)
{
NVS_ASSERT_OR_RETURN
(
itemTypeOf
(
dst
)
==
datatype
,
ESP_FAIL
)
;
dst
=
*
reinterpret_cast
<
T
*
>
(
data
)
;
return
ESP_OK
;
}
bool
checkHeaderConsistency
(
const
uint8_t
entryIndex
)
const
;
}
;
Fields
Field
nvs::Item::MAX_KEY_LENGTH
nvs::Item::CHUNK_ANY
Methods
getValue()
checkHeaderConsistency() const
calculateCrc32() const
calculateCrc32WithoutValue() const
calculateCrc32()
getKey()
Related Functions
Found 8 other functions taking a
Item
argument:
Function
nvs::Storage::findItem()
nvs::Page::readEntry() const
nvs::Page::writeEntry()
nvs::Storage::fillEntryInfo()
nvs::HashList::insert()
nvs::HashList::find()
nvs::isIterableItem()
nvs::isMultipageBlob()
Examples
References
from
examples
Code
Location
Scope
Referrer
class
Item
nvs_types.hpp:42
if
(
size
!=
sizeof
(
Item
)
)
return
ESP_ERR_INVALID_SIZE
;
nvs_encrypted_partition.cpp:38
nvs::NVSEncryptedPartition::read()
uint8_t
entrySize
=
sizeof
(
Item
)
;
nvs_encrypted_partition.cpp:77
nvs::NVSEncryptedPartition::write()
esp_err_t
HashList
::
insert
(
const
Item
&
item
,
size_t
index
)
nvs_item_hash_list.cpp:45
nvs::HashList::insert()
nvs::HashList::insert()::item
size_t
HashList
::
find
(
size_t
start
,
const
Item
&
item
)
nvs_item_hash_list.cpp:106
nvs::HashList::find()
nvs::HashList::find()::item
esp_err_t
insert
(
const
Item
&
item
,
size_t
index
)
;
nvs_item_hash_list.hpp:24
nvs::HashList::insert()
nvs::HashList::insert()::item
size_t
find
(
size_t
start
,
const
Item
&
item
)
;
nvs_item_hash_list.hpp:26
nvs::HashList::find()
nvs::HashList::find()::item
esp_err_t
Page
::
writeEntry
(
const
Item
&
item
)
nvs_page.cpp:99
nvs::Page::writeEntry()
nvs::Page::writeEntry()::item
Item
item
;
nvs_page.cpp:155
nvs::Page::writeItem()
if
(
keySize
>
Item
::
MAX_KEY_LENGTH
)
{
nvs_page.cpp:174
nvs::Page::writeItem()
item
=
Item
(
nsIndex
,
datatype
,
span
,
key
,
chunkIdx
)
;
nvs_page.cpp:205
nvs::Page::writeItem()
item
.
varLength
.
dataCrc32
=
Item
::
calculateCrc32
(
src
,
dataSize
)
;
nvs_page.cpp:221
nvs::Page::writeItem()
Item
item
;
nvs_page.cpp:256
nvs::Page::readItem()
Item
ditem
;
nvs_page.cpp:283
nvs::Page::readItem()
if
(
Item
::
calculateCrc32
(
reinterpret_cast
<
uint8_t
*
>
(
data
)
,
item
.
varLength
.
dataSize
)
!=
item
.
varLength
.
dataCrc32
)
{
nvs_page.cpp:294
nvs::Page::readItem()
Item
item
;
nvs_page.cpp:307
nvs::Page::cmpItem()
Item
ditem
;
nvs_page.cpp:336
nvs::Page::cmpItem()
if
(
Item
::
calculateCrc32
(
reinterpret_cast
<
const
uint8_t
*
>
(
data
)
,
item
.
varLength
.
dataSize
)
!=
item
.
varLength
.
dataCrc32
)
{
nvs_page.cpp:349
nvs::Page::cmpItem()
Item
item
;
nvs_page.cpp:359
nvs::Page::eraseItem()
Item
item
;
nvs_page.cpp:370
nvs::Page::findItem()
Item
item
;
nvs_page.cpp:387
nvs::Page::eraseEntryAndSpan()
Item
entry
;
nvs_page.cpp:479
nvs::Page::copyItems()
Item
item
;
nvs_page.cpp:614
nvs::Page::mLoadEntryTable()
Item
dupItem
;
nvs_page.cpp:700
nvs::Page::mLoadEntryTable()
Item
item
;
nvs_page.cpp:714
nvs::Page::mLoadEntryTable()
esp_err_t
Page
::
readEntry
(
size_t
index
,
Item
&
dst
)
const
nvs_page.cpp:851
nvs::Page::readEntry() const
nvs::Page::readEntry() const::dst
esp_err_t
Page
::
findItem
(
uint8_t
nsIndex
,
ItemType
datatype
,
const
char
*
key
,
size_t
&
itemIndex
,
Item
&
item
,
uint8_t
chunkIdx
,
VerOffset
chunkStart
)
nvs_page.cpp:865
nvs::Page::findItem()
if
(
key
!=
nullptr
&&
strncmp
(
key
,
item
.
key
,
Item
::
MAX_KEY_LENGTH
)
!=
0
)
{
nvs_page.cpp:934
nvs::Page::findItem()
Item
item
;
nvs_page.cpp:1111
nvs::Page::debugDump() const
static
const
uint8_t
CHUNK_ANY
=
Item
::
CHUNK_ANY
;
nvs_page.hpp:48
esp_err_t
findItem
(
uint8_t
nsIndex
,
ItemType
datatype
,
const
char
*
key
,
size_t
&
itemIndex
,
Item
&
item
,
uint8_t
chunkIdx
=
CHUNK_ANY
,
VerOffset
chunkStart
=
VerOffset
::
VER_ANY
)
;
nvs_page.hpp:99
nvs::Page::findItem()
esp_err_t
readEntry
(
size_t
index
,
Item
&
dst
)
const
;
nvs_page.hpp:187
nvs::Page::readEntry() const
nvs::Page::readEntry() const::dst
esp_err_t
writeEntry
(
const
Item
&
item
)
;
nvs_page.hpp:189
nvs::Page::writeEntry()
nvs::Page::writeEntry()::item
Item
item
;
nvs_pagemanager.cpp:61
nvs::PageManager::load()
esp_err_t
Storage
::
findItem
(
uint8_t
nsIndex
,
ItemType
datatype
,
const
char
*
key
,
Page
*
&
page
,
Item
&
item
,
uint8_t
chunkIdx
,
VerOffset
chunkStart
)
nvs_storage.cpp:257
nvs::Storage::findItem()
nvs::Storage::findItem()::item
Item
item
;
nvs_storage.cpp:352
nvs::Storage::writeMultiPageBlob()
Item
item
;
nvs_storage.cpp:383
nvs::Storage::writeItem()
Item
item
;
nvs_storage.cpp:585
nvs::Storage::readMultiPageBlob()
Item
item
;
nvs_storage.cpp:635
nvs::Storage::cmpMultiPageBlob()
Item
item
;
nvs_storage.cpp:681
nvs::Storage::readItem()
Item
item
;
nvs_storage.cpp:703
nvs::Storage::eraseMultiPageBlob()
Item
item
;
nvs_storage.cpp:776
nvs::Storage::eraseItem()
Item
item
;
nvs_storage.cpp:817
nvs::Storage::findKey()
Item
item
;
nvs_storage.cpp:837
nvs::Storage::getItemDataSize()
void
Storage
::
fillEntryInfo
(
Item
&
item
,
nvs_entry_info_t
&
info
)
nvs_storage.cpp:923
nvs::Storage::fillEntryInfo()
nvs::Storage::fillEntryInfo()::item
inline
bool
isIterableItem
(
Item
&
item
)
nvs_storage.cpp:961
nvs::isIterableItem()
nvs::isIterableItem()::item
inline
bool
isMultipageBlob
(
Item
&
item
)
nvs_storage.cpp:968
nvs::isMultipageBlob()
nvs::isMultipageBlob()::item
Item
item
;
nvs_storage.cpp:977
nvs::Storage::nextEntry()
char
mName
[
Item
::
MAX_KEY_LENGTH
+
1
]
;
nvs_storage.hpp:33
char
key
[
Item
::
MAX_KEY_LENGTH
+
1
]
;
nvs_storage.hpp:47
void
fillEntryInfo
(
Item
&
item
,
nvs_entry_info_t
&
info
)
;
nvs_storage.hpp:154
nvs::Storage::fillEntryInfo()
nvs::Storage::fillEntryInfo()::item
esp_err_t
findItem
(
uint8_t
nsIndex
,
ItemType
datatype
,
const
char
*
key
,
Page
*
&
page
,
Item
&
item
,
uint8_t
chunkIdx
=
Page
::
CHUNK_ANY
,
VerOffset
chunkStart
=
VerOffset
::
VER_ANY
)
;
nvs_storage.hpp:156
nvs::Storage::findItem()
nvs::Storage::findItem()::item
uint32_t
Item
::
calculateCrc32
(
)
const
nvs_types.cpp:14
nvs::Item::calculateCrc32() const
result
=
esp_rom_crc32_le
(
result
,
p
+
offsetof
(
Item
,
nsIndex
)
,
nvs_types.cpp:18
nvs::Item::calculateCrc32() const
offsetof
(
Item
,
crc32
)
-
offsetof
(
Item
,
nsIndex
)
)
;
nvs_types.cpp:19
nvs::Item::calculateCrc32() const
result
=
esp_rom_crc32_le
(
result
,
p
+
offsetof
(
Item
,
key
)
,
sizeof
(
key
)
)
;
nvs_types.cpp:20
nvs::Item::calculateCrc32() const
result
=
esp_rom_crc32_le
(
result
,
p
+
offsetof
(
Item
,
data
)
,
sizeof
(
data
)
)
;
nvs_types.cpp:21
nvs::Item::calculateCrc32() const
uint32_t
Item
::
calculateCrc32WithoutValue
(
)
const
nvs_types.cpp:25
nvs::Item::calculateCrc32WithoutValue() const
result
=
esp_rom_crc32_le
(
result
,
p
+
offsetof
(
Item
,
nsIndex
)
,
nvs_types.cpp:29
nvs::Item::calculateCrc32WithoutValue() const
offsetof
(
Item
,
datatype
)
-
offsetof
(
Item
,
nsIndex
)
)
;
nvs_types.cpp:30
nvs::Item::calculateCrc32WithoutValue() const
result
=
esp_rom_crc32_le
(
result
,
p
+
offsetof
(
Item
,
key
)
,
sizeof
(
key
)
)
;
nvs_types.cpp:31
nvs::Item::calculateCrc32WithoutValue() const
result
=
esp_rom_crc32_le
(
result
,
p
+
offsetof
(
Item
,
chunkIndex
)
,
sizeof
(
chunkIndex
)
)
;
nvs_types.cpp:32
nvs::Item::calculateCrc32WithoutValue() const
uint32_t
Item
::
calculateCrc32
(
const
uint8_t
*
data
,
size_t
size
)
nvs_types.cpp:36
nvs::Item::calculateCrc32()
bool
Item
::
checkHeaderConsistency
(
const
uint8_t
entryIndex
)
const
nvs_types.cpp:43
nvs::Item::checkHeaderConsistency() const
Call Tree
from
examples
All items filtered out
All items filtered out
Data Use
from
examples
All items filtered out
All items filtered out
Class Tree
from
examples
All items filtered out
All items filtered out
Override Tree
from
examples
All items filtered out
All items filtered out
Implementations
from
examples
All items filtered out
All items filtered out
Instances
from
examples
Instance
Scope
Location
Project
nvs::Page::readEntry() const::dst
nvs::Page::readEntry() const
nvs_page.hpp:187
nvs::Page::writeEntry()::item
nvs::Page::writeEntry()
nvs_page.hpp:189
nvs::HashList::insert()::item
nvs::HashList::insert()
nvs_item_hash_list.hpp:24
nvs::HashList::find()::item
nvs::HashList::find()
nvs_item_hash_list.hpp:26
nvs::Storage::fillEntryInfo()::item
nvs::Storage::fillEntryInfo()
nvs_storage.hpp:154
nvs::Storage::findItem()::item
nvs::Storage::findItem()
nvs_storage.hpp:156
nvs::HashList::insert()::item
nvs::HashList::insert()
nvs_item_hash_list.cpp:45
nvs::HashList::find()::item
nvs::HashList::find()
nvs_item_hash_list.cpp:106
nvs::Page::writeEntry()::item
nvs::Page::writeEntry()
nvs_page.cpp:99
nvs::Page::readEntry() const::dst
nvs::Page::readEntry() const
nvs_page.cpp:851
nvs::Storage::findItem()::item
nvs::Storage::findItem()
nvs_storage.cpp:257
nvs::Storage::fillEntryInfo()::item
nvs::Storage::fillEntryInfo()
nvs_storage.cpp:923
nvs::isIterableItem()::item
nvs::isIterableItem()
nvs_storage.cpp:961
nvs::isMultipageBlob()::item
nvs::isMultipageBlob()
nvs_storage.cpp:968
Lifecycle
from
examples
All items filtered out
All items filtered out