Added toString() for sntp_sync_status_t

This commit is contained in:
feedc0de committed 2021-08-11 23:29:27 +02:00
1 parent 3195a3e590
commit a6ed293eab
2 files changed
+14

No files matched your search

+13
View File
@@ -29,6 +29,19 @@ std::string toString(sntp_sync_mode_t val)
} }
} }
std::string toString(sntp_sync_status_t val)
{
switch (val)
{
case SNTP_SYNC_STATUS_RESET: return "RESET";
case SNTP_SYNC_STATUS_COMPLETED: return "COMPLETED";
case SNTP_SYNC_STATUS_IN_PROGRESS: return "IN_PROGRESS";
default:
ESP_LOGW(TAG, "unknown sntp_sync_status_t(%i)", std::to_underlying(val));
return fmt::format("Unknown sntp_sync_status_t({})", std::to_underlying(val));
}
}
std::string toString(esp_log_level_t val) std::string toString(esp_log_level_t val)
{ {
switch (val) switch (val)
+1
View File
@@ -10,6 +10,7 @@
namespace espcpputils { namespace espcpputils {
std::string toString(sntp_sync_mode_t val); std::string toString(sntp_sync_mode_t val);
std::string toString(sntp_sync_status_t val);
std::string toString(esp_log_level_t val); std::string toString(esp_log_level_t val);
} // namespace espcpputils } // namespace espcpputils