Select one of the symbols to view example projects that use it.
 
Outline
#include "esp_partition.h"
#include "nvs_partition_lookup.hpp"
#include "nvs_encrypted_partition.hpp"
nvs
Files
loading (2/5)...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/nvs_flash/src/nvs_partition_lookup.cpp
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
#include "esp_partition.h" #include "nvs_partition_lookup.hpp" #ifndef LINUX_TARGET #include "nvs_encrypted_partition.hpp" #endif // ! LINUX_TARGET namespace nvs { namespace partition_lookup { esp_err_t lookup_nvs_partition(const char* label, NVSPartition **p) { const esp_partition_t* esp_partition = esp_partition_find_first( ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, label); if (esp_partition == nullptr) { return ESP_ERR_NOT_FOUND; }{...} if (esp_partition->encrypted) { return ESP_ERR_NVS_WRONG_ENCRYPTION; }{...} NVSPartition *partition = new (std::nothrow) NVSPartition(esp_partition); if (partition == nullptr) { return ESP_ERR_NO_MEM; }{...} *p = partition; return ESP_OK; }{ ... } #ifndef LINUX_TARGET esp_err_t lookup_nvs_encrypted_partition(const char* label, nvs_sec_cfg_t* cfg, NVSPartition **p) { const esp_partition_t* esp_partition = esp_partition_find_first( ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, label); if (esp_partition == nullptr) { return ESP_ERR_NOT_FOUND; }{...} if (esp_partition->encrypted) { return ESP_ERR_NVS_WRONG_ENCRYPTION; }{...} NVSEncryptedPartition *enc_p = new (std::nothrow) NVSEncryptedPartition(esp_partition); if (enc_p == nullptr) { return ESP_ERR_NO_MEM; }{...} esp_err_t result = enc_p->init(cfg); if (result != ESP_OK) { delete enc_p; return result; }{...} *p = enc_p; return ESP_OK; }{ ... } /* ... */#endif // ! LINUX_TARGET }{...} // partition_lookup }{...} // nvs
Details