MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / optString

Method optString

Tactility/Source/PreferencesEsp.cpp:53–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53bool Preferences::optString(const std::string& key, std::string& out) const {
54 nvs_handle_t handle;
55 if (nvs_open(namespace_, NVS_READWRITE, &handle) != ESP_OK) {
56 LOGGER.error("Failed to open namespace {}", namespace_);
57 return false;
58 } else {
59 size_t out_size = 256;
60 char* out_data = static_cast<char*>(malloc(out_size));
61 bool success = nvs_get_str(handle, key.c_str(), out_data, &out_size) == ESP_OK;
62 nvs_close(handle);
63 out = out_data;
64 free(out_data);
65 return success;
66 }
67}
68
69bool Preferences::hasBool(const std::string& key) const {
70 bool temp;

Callers 15

getTimeZoneNameFunction · 0.45
hasTimeZoneFunction · 0.45
getTimeZoneCodeFunction · 0.45
onCreateMethod · 0.45
getResultNameFunction · 0.45
getResultCodeFunction · 0.45
fromBundleFunction · 0.45
optSsidParameterFunction · 0.45
optPasswordParameterFunction · 0.45
getResultPathFunction · 0.45
getTitleParameterFunction · 0.45
onShowMethod · 0.45

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected