diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2015-01-28 16:29:14 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2015-01-28 16:29:14 +0100 |
commit | 2728889f7886e3ab2fea16941d29e60ece0d4449 (patch) | |
tree | ca9994d71205731ee4bb404175c2cf8f13fcc539 /src/systemcmds/ver/ver.c | |
parent | f23e603d02ba416ae250770cdaad6a859d6bae69 (diff) | |
parent | 1dcc5c49cc75778bcdde770f2d6c2700dd2bec2e (diff) | |
download | px4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.tar.gz px4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.tar.bz2 px4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.zip |
Merge remote-tracking branch 'upstream/master' into ros_messagelayer_merge_attctlposctl
Diffstat (limited to 'src/systemcmds/ver/ver.c')
-rw-r--r-- | src/systemcmds/ver/ver.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/systemcmds/ver/ver.c b/src/systemcmds/ver/ver.c index 2ead3e632..087eb52e3 100644 --- a/src/systemcmds/ver/ver.c +++ b/src/systemcmds/ver/ver.c @@ -54,6 +54,7 @@ static const char sz_ver_bdate_str[] = "bdate"; static const char sz_ver_gcc_str[] = "gcc"; static const char sz_ver_all_str[] = "all"; static const char mcu_ver_str[] = "mcu"; +static const char mcu_uid_str[] = "uid"; static void usage(const char *reason) { @@ -61,7 +62,7 @@ static void usage(const char *reason) printf("%s\n", reason); } - printf("usage: ver {hw|hwcmp|git|bdate|gcc|all|mcu}\n\n"); + printf("usage: ver {hw|hwcmp|git|bdate|gcc|all|mcu|uid}\n\n"); } __EXPORT int ver_main(int argc, char *argv[]); @@ -141,6 +142,17 @@ int ver_main(int argc, char *argv[]) ret = 0; } + if (show_all || !strncmp(argv[1], mcu_uid_str, sizeof(mcu_uid_str))) { + uint32_t uid[3]; + + mcu_unique_id(uid); + + printf("UID: %X:%X:%X \n",uid[0],uid[1],uid[2]); + + ret = 0; + } + + if (ret == 1) { errx(1, "unknown command.\n"); } |