MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / loadFatLabelsForLabel

Function loadFatLabelsForLabel

src/app_registry.cpp:84–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84std::vector<String> loadFatLabelsForLabel(const char *label) {
85 std::vector<String> labels;
86 if (!label || !label[0]) return labels;
87
88 esp_err_t err = ESP_OK;
89 auto handle = openNamespace(kNamespace, NVS_READONLY, err);
90 if (!handle) return labels;
91
92 String key = fatKeyForLabel(label);
93 char buffer[48] = {0};
94 err = handle->get_string(key.c_str(), buffer, sizeof(buffer));
95 if (err == ESP_ERR_NVS_NOT_FOUND) return labels;
96 if (err != ESP_OK) {
97 launcherConsolePrintf("App registry: FAT read failed label=%s err=%d\n", label, err);
98 return labels;
99 }
100 return parseFatLabels(String(buffer));
101}
102
103bool saveAppNameForLabel(const char *label, const String &name) {
104 if (!label || !label[0]) return false;

Callers 2

launcherLoadAppRegistryFunction · 0.85

Calls 4

fatKeyForLabelFunction · 0.85
launcherConsolePrintfFunction · 0.85
parseFatLabelsFunction · 0.85
openNamespaceFunction · 0.70

Tested by

no test coverage detected