Added espstrutils

This commit is contained in:
2021-04-07 22:22:55 +02:00
parent a00a39a8f4
commit d8af81ddd9
3 changed files with 31 additions and 0 deletions

16
src/espstrutils.cpp Normal file
View File

@@ -0,0 +1,16 @@
#include "espstrutils.h"
namespace espcpputils {
std::string toString(sntp_sync_mode_t val)
{
switch (val)
{
case SNTP_SYNC_MODE_IMMED: return "SNTP_SYNC_MODE_IMMED";
case SNTP_SYNC_MODE_SMOOTH: return "SNTP_SYNC_MODE_SMOOTH";
}
return std::string{"Unknown sntp_sync_mode_t("} + std::to_string(int(val)) + ')';
}
} // namespace espcpputils