Added restart handler module.

This commit is contained in:
Ole Odendahl 2023-04-11 12:51:58 +02:00
parent 69c0ed3694
commit 727138415e
No known key found for this signature in database
GPG key ID: 116D1FA8CD50CD0B
3 changed files with 22 additions and 1 deletions

View file

@ -16,8 +16,9 @@ target_sources(app PRIVATE
src/factory_reset.c
src/prst_zb_attrs.c
src/prst_zb_soil_moisture_defs.c
src/restart_handler.c
)
add_subdirectory(../../prstlib prstlib)
target_include_directories(app PRIVATE ../../prstlib/include)
target_link_libraries(app PUBLIC prstlib)
target_link_libraries(app PUBLIC prstlib)

View file

@ -0,0 +1,14 @@
#include <zephyr/logging/log.h>
#include <zephyr/kernel.h>
#include <zigbee/zigbee_app_utils.h>
#include "restart_handler.h"
LOG_MODULE_REGISTER(restart_handler, CONFIG_LOG_DEFAULT_LEVEL);
static void restart_network_steering_cb(struct k_timer *timer) {
LOG_DBG("Restart handler expired. Restarting network steering.");
user_input_indicate();
}
K_TIMER_DEFINE(restart_timer, restart_network_steering_cb, NULL);

View file

@ -0,0 +1,6 @@
#ifndef _PRST_ZB_RESTART_HANDLER_H_
#define _PRST_ZB_RESTART_HANDLER_H_
static const int PRST_ZB_RESET_TIMEOUT = 5 * 60;
#endif // _PRST_ZB_RESTART_HANDLER_H_