From 721f83dd836be30f8e7b3b45ee05acc88ff0430b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Fri, 2 Jul 2021 18:12:05 +0300 Subject: [FL-1516] Fix name read on device without OTP (#561) * Fix name read on device without OTP * Dolphin: proper name handling. --- applications/cli/cli_commands.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'applications/cli') diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index df04f169..6900a425 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -15,7 +15,10 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) { // Model name printf("hardware_model : %s\r\n", api_hal_version_get_model_name()); - printf("hardware_name : %s\r\n", api_hal_version_get_name_ptr()); + const char* name = api_hal_version_get_name_ptr(); + if(name) { + printf("hardware_name : %s\r\n", name); + } // Unique ID printf("hardware_uid : "); @@ -191,27 +194,6 @@ void cli_command_log(Cli* cli, string_t args, void* context) { furi_stdglue_set_global_stdout_callback(NULL); } -void cli_command_hw_info(Cli* cli, string_t args, void* context) { - printf( - "%-20s %d.F%dB%dC%d\r\n", - "HW version:", - api_hal_version_get_hw_version(), - api_hal_version_get_hw_target(), - api_hal_version_get_hw_body(), - api_hal_version_get_hw_connect()); - time_t time = api_hal_version_get_hw_timestamp(); - char time_string[26] = ""; - ctime_r(&time, time_string); - if(time_string[strlen(time_string) - 1] == '\n') { - time_string[strlen(time_string) - 1] = '\0'; - } - printf("%-20s %s\r\n", "Production date:", time_string); - const char* name = api_hal_version_get_name_ptr(); - if(name) { - printf("%-20s %s", "Name:", name); - } -} - void cli_command_vibro(Cli* cli, string_t args, void* context) { if(!string_cmp(args, "0")) { NotificationApp* notification = furi_record_open("notification"); -- cgit v1.2.3