Generate device name

This commit is contained in:
2024-07-27 15:31:17 +02:00
parent 0e32622720
commit 900b436856
10 changed files with 249 additions and 3 deletions

@ -1,9 +1,29 @@
#include <stdio.h>
#include "esp_system.h"
#include "dev_name.h"
#include "storage.h"
void app_main(void)
{
printf("\n\n\nhello world and bye\n\n\n");
printf("\n");
if (storage_init() == false)
{
printf("Failed to init storage!\n");
fflush(stdout);
esp_restart();
}
if (dev_generate_name_if_required())
{
printf("Generated a new device name\n");
}
char *name = dev_name();
printf("Dev name: %s\n", name);
free(name);
fflush(stdout);
esp_restart();
}