Skip to content

Commit d43a847

Browse files
committed
Added additional DAPLink version info for mbed detect command`
1 parent 3f2e986 commit d43a847

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

tools/detect_targets.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# Imports related to mbed build api
3232
from tools.build_api import mcu_toolchain_matrix
3333
from tools.test_api import get_autodetected_MUTS_list
34+
from tools.test_api import get_mounted_details_txt
3435
from argparse import ArgumentParser
3536

3637

@@ -75,9 +76,11 @@ def main():
7576
count = 0
7677
for mut in muts.values():
7778
if re.match(mcu_filter, mut['mcu']):
79+
# Grab additional target details about the mut
80+
details_txt = get_mounted_details_txt(mut['disk'])
7881
print ""
79-
print "[mbed] Detected %s, port %s, mounted %s" % \
80-
(mut['mcu'], mut['port'], mut['disk'])
82+
print "[mbed] Detected %s, port %s, mounted %s, DAPLink version %s" % \
83+
(mut['mcu'], mut['port'], mut['disk'], details_txt['Interface Version'])
8184
print "[mbed] Supported toolchains for %s" % mut['mcu']
8285
print mcu_toolchain_matrix(platform_filter=mut['mcu'])
8386
count += 1

tools/test_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,12 @@ def get_module_avail(module_name):
16471647
"""
16481648
return module_name in sys.modules.keys()
16491649

1650+
def get_mounted_details_txt(mount_point):
1651+
""" Function returns object containing details.txt information from the specified mount point
1652+
@param mount_point Name of disk where platform is connected to host machine.
1653+
"""
1654+
mbeds = mbed_lstools.create()
1655+
return mbeds.get_details_txt(mount_point)
16501656

16511657
def get_autodetected_MUTS_list(platform_name_filter=None):
16521658
oldError = None

0 commit comments

Comments
 (0)