From 39a00212517163f5f51a8759817e6d25a0a1cba3 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 7 Sep 2017 13:30:08 -1000 Subject: [PATCH] ver:Add PX4 GUID (MFGUID and UID will be deprecated later) --- src/systemcmds/ver/ver.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/systemcmds/ver/ver.c b/src/systemcmds/ver/ver.c index c71389fe7c..008e46e32d 100644 --- a/src/systemcmds/ver/ver.c +++ b/src/systemcmds/ver/ver.c @@ -59,6 +59,7 @@ static const char sz_ver_all_str[] = "all"; static const char mcu_ver_str[] = "mcu"; static const char mcu_uid_str[] = "uid"; static const char mfg_uid_str[] = "mfguid"; +static const char px4_guid_str[] = "px4guid"; #if defined(PX4_CPU_UUID_WORD32_FORMAT) # define CPU_UUID_FORMAT PX4_CPU_UUID_WORD32_FORMAT @@ -90,6 +91,7 @@ static void usage(const char *reason) PRINT_MODULE_USAGE_COMMAND_DESCR("bdate", "Build date and time"); PRINT_MODULE_USAGE_COMMAND_DESCR("uid", "UUID"); PRINT_MODULE_USAGE_COMMAND_DESCR("mfguid", "Manufacturer UUID"); + PRINT_MODULE_USAGE_COMMAND_DESCR("px4guid", "PX4 GUID"); PRINT_MODULE_USAGE_COMMAND_DESCR("uri", "Build URI"); PRINT_MODULE_USAGE_COMMAND_DESCR("all", "Print all versions"); @@ -244,6 +246,18 @@ int ver_main(int argc, char *argv[]) ret = 0; } + if (show_all || !strncmp(argv[1], px4_guid_str, sizeof(px4_guid_str))) { + +#if defined(BOARD_OVERRIDE_PX4_GUID) + char *px4guid_fmt_buffer = BOARD_OVERRIDE_PX4_GUID; +#else + char px4guid_fmt_buffer[PX4_GUID_FORMAT_SIZE]; + board_get_px4_guid_formated(px4guid_fmt_buffer, sizeof(px4guid_fmt_buffer)); +#endif + printf("PX4GUID: %s\n", px4guid_fmt_buffer); + ret = 0; + } + if (show_all || !strncmp(argv[1], mcu_ver_str, sizeof(mcu_ver_str))) { char rev = ' ';