Adding NameChanger Service - Reads and sets name from file at boot.

This commit is contained in:
ESurge
2022-09-27 00:13:40 -07:00
parent a4c6c3be52
commit 87b775a48b
6 changed files with 208 additions and 0 deletions
@@ -90,6 +90,16 @@ typedef struct {
static FuriHalVersion furi_hal_version = {0};
void furi_hal_version_set_custom_name(const char* name) {
if((name != NULL) && ((strlen(name) >= 1) && (strlen(name) <= 8))) {
strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH);
snprintf(
furi_hal_version.device_name, FURI_HAL_VERSION_DEVICE_NAME_LENGTH, "xFlipper %s", name);
furi_hal_version.device_name[0] = AD_TYPE_COMPLETE_LOCAL_NAME;
}
}
static void furi_hal_version_set_name(const char* name) {
if(name != NULL) {
strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH);
@@ -127,6 +127,9 @@ FuriHalVersionDisplay furi_hal_version_get_hw_display();
*/
uint32_t furi_hal_version_get_hw_timestamp();
// Set custom name
void furi_hal_version_set_custom_name(const char* name);
/** Get pointer to target name
*
* @return Hardware Name C-string