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
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
Lifecycle
from
examples
All items filtered out
All items filtered out