diff --git a/include/zh_espnow.h b/include/zh_espnow.h index 7a18085..b302c91 100644 --- a/include/zh_espnow.h +++ b/include/zh_espnow.h @@ -116,6 +116,11 @@ extern "C" */ const zh_espnow_stats_t *zh_espnow_get_stats(void); + /** + * @brief Reset ESP-NOW statistics. + */ + void zh_espnow_reset_stats(void); + #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/version.txt b/version.txt index 8428158..867e524 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.2 \ No newline at end of file +1.2.0 \ No newline at end of file diff --git a/zh_espnow.c b/zh_espnow.c index 35c4b96..9929642 100755 --- a/zh_espnow.c +++ b/zh_espnow.c @@ -508,4 +508,12 @@ uint8_t zh_espnow_get_version(void) const zh_espnow_stats_t *zh_espnow_get_stats(void) { return &_stats; +} + +void zh_espnow_reset_stats(void) +{ + _stats.sent_success = 0; + _stats.sent_fail = 0; + _stats.received = 0; + ZH_ESPNOW_LOGI("ESP-NOW statistic reset successfully."); } \ No newline at end of file