From 17deb9f8951ae42b3f06889ca76fbc74da5ce9c2 Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Tue, 6 May 2025 09:07:52 +0300 Subject: [PATCH] feat: added get initialization status --- include/zh_espnow.h | 7 +++++++ version.txt | 2 +- zh_espnow.c | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/zh_espnow.h b/include/zh_espnow.h index b302c91..5213dc5 100644 --- a/include/zh_espnow.h +++ b/include/zh_espnow.h @@ -121,6 +121,13 @@ extern "C" */ void zh_espnow_reset_stats(void); + /** + * @brief Check ESP-NOW initialization status. + * + * @return true if ESP-NOW is initialized false otherwise. + */ + bool zh_espnow_is_initialized(void); + #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/version.txt b/version.txt index 867e524..589268e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.2.0 \ No newline at end of file +1.3.0 \ No newline at end of file diff --git a/zh_espnow.c b/zh_espnow.c index 9929642..5b45469 100755 --- a/zh_espnow.c +++ b/zh_espnow.c @@ -516,4 +516,9 @@ void zh_espnow_reset_stats(void) _stats.sent_fail = 0; _stats.received = 0; ZH_ESPNOW_LOGI("ESP-NOW statistic reset successfully."); +} + +bool zh_espnow_is_initialized(void) +{ + return _is_initialized; } \ No newline at end of file