From d43a8476676134856c58e6e063a90bf90c16dcaf Mon Sep 17 00:00:00 2001 From: David Walters Date: Mon, 11 Sep 2017 16:54:32 +0100 Subject: [PATCH] Added additional DAPLink version info for `mbed detect` command` --- tools/detect_targets.py | 7 +++++-- tools/test_api.py | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/detect_targets.py b/tools/detect_targets.py index 5f32801db8..1ef57e764b 100644 --- a/tools/detect_targets.py +++ b/tools/detect_targets.py @@ -31,6 +31,7 @@ check_required_modules(['prettytable']) # Imports related to mbed build api from tools.build_api import mcu_toolchain_matrix from tools.test_api import get_autodetected_MUTS_list +from tools.test_api import get_mounted_details_txt from argparse import ArgumentParser @@ -75,9 +76,11 @@ def main(): count = 0 for mut in muts.values(): if re.match(mcu_filter, mut['mcu']): + # Grab additional target details about the mut + details_txt = get_mounted_details_txt(mut['disk']) print "" - print "[mbed] Detected %s, port %s, mounted %s" % \ - (mut['mcu'], mut['port'], mut['disk']) + print "[mbed] Detected %s, port %s, mounted %s, DAPLink version %s" % \ + (mut['mcu'], mut['port'], mut['disk'], details_txt['Interface Version']) print "[mbed] Supported toolchains for %s" % mut['mcu'] print mcu_toolchain_matrix(platform_filter=mut['mcu']) count += 1 diff --git a/tools/test_api.py b/tools/test_api.py index 985c318e85..13fac4cbe3 100644 --- a/tools/test_api.py +++ b/tools/test_api.py @@ -1647,6 +1647,12 @@ def get_module_avail(module_name): """ return module_name in sys.modules.keys() +def get_mounted_details_txt(mount_point): + """ Function returns object containing details.txt information from the specified mount point + @param mount_point Name of disk where platform is connected to host machine. + """ + mbeds = mbed_lstools.create() + return mbeds.get_details_txt(mount_point) def get_autodetected_MUTS_list(platform_name_filter=None): oldError = None