Ready to implement sync function on ESP32 device

This commit is contained in:
2024-09-21 20:06:19 +02:00
parent 8316746377
commit 5db7593a4f
3 changed files with 29 additions and 0 deletions

View File

@ -164,7 +164,23 @@ void app_main(void)
ESP_LOGI(TAG, "Current device certificate:\n%s", dev_certificate);
free(dev_certificate);
// Main loop
ESP_LOGI(TAG, "Starting main loop");
while (true)
{
if (!secure_api_sync_device())
{
ESP_LOGE(TAG, "Failed to synchronise device!");
}
else
{
ESP_LOGI(TAG, "Successfully synchronised device!");
}
system_sleep(10);
}
system_sleep(120);
reboot();