mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-30 02:18:11 -07:00
Adding NameChanger Service - Reads and sets name from file at boot.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user