Added toString() for sntp_sync_status_t

This commit is contained in:
2021-08-11 23:28:06 +02:00
parent 3195a3e590
commit a6ed293eab
2 changed files with 14 additions and 0 deletions

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)
{
switch (val)

View File

@ -10,6 +10,7 @@
namespace espcpputils {
std::string toString(sntp_sync_mode_t val);
std::string toString(sntp_sync_status_t val);
std::string toString(esp_log_level_t val);
} // namespace espcpputils