feat: added get statistics

This commit is contained in:
2025-05-04 12:11:51 +03:00
parent 9900a4ae60
commit fea64afe3e
4 changed files with 35 additions and 2 deletions

View File

@ -62,6 +62,13 @@ extern "C"
uint16_t data_len; // Size of the received ESP-NOW message.
} zh_espnow_event_on_recv_t;
typedef struct // Structure for message statistics storage.
{
uint32_t sent_success; // Number of successfully sent messages.
uint32_t sent_fail; // Number of failed sent messages.
uint32_t received; // Number of received messages.
} zh_espnow_stats_t;
/**
* @brief Initialize ESP-NOW interface.
*
@ -102,6 +109,13 @@ extern "C"
*/
uint8_t zh_espnow_get_version(void);
/**
* @brief Get ESP-NOW statistics.
*
* @return Pointer to the statistics structure.
*/
const zh_espnow_stats_t *zh_espnow_get_stats(void);
#ifdef __cplusplus
}
#endif