| 82 | } |
| 83 | |
| 84 | std::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 | |
| 103 | bool saveAppNameForLabel(const char *label, const String &name) { |
| 104 | if (!label || !label[0]) return false; |
no test coverage detected