2021-07-25 14:34:54 +03:00
|
|
|
#include "random_name.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <furi.h>
|
2022-05-17 15:54:09 +03:00
|
|
|
#include <furi_hal.h>
|
2021-07-25 14:34:54 +03:00
|
|
|
|
|
|
|
void set_random_name(char* name, uint8_t max_name_size) {
|
2022-05-17 15:54:09 +03:00
|
|
|
FuriHalRtcDateTime datetime;
|
|
|
|
furi_hal_rtc_get_datetime(&datetime);
|
|
|
|
char strings[1][25];
|
2022-06-24 13:01:41 +03:00
|
|
|
sprintf(
|
|
|
|
strings[0],
|
|
|
|
"%s%.4d%.2d%.2d%.2d%.2d",
|
|
|
|
"s",
|
|
|
|
datetime.year,
|
|
|
|
datetime.month,
|
|
|
|
datetime.day,
|
|
|
|
datetime.hour,
|
|
|
|
datetime.minute);
|
2022-05-17 15:54:09 +03:00
|
|
|
sniprintf(name, max_name_size, "%s", strings[0]);
|
2021-07-25 14:34:54 +03:00
|
|
|
}
|