Skip to content

Commit

Permalink
Merge pull request #88 from ARMmbed/devel_detect_polishing
Browse files Browse the repository at this point in the history
mbed-ls can return data for target id with wields like mount_point or serial_port set to None
  • Loading branch information
PrzemekWirkus committed May 9, 2016
2 parents dffef40 + ee006e1 commit 938b844
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mbed_host_tests/host_tests_plugins/host_test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ def check_mount_point_ready(self, destination_disk, init_delay=0.2, loop_delay=0
mbeds_by_tid = mbeds.list_mbeds_by_targetid() # key: target_id, value mbedls_dict()
if target_id in mbeds_by_tid:
if 'mount_point' in mbeds_by_tid[target_id]:
new_destination_disk = mbeds_by_tid[target_id]['mount_point']
break
if mbeds_by_tid[target_id]['mount_point']:
# Only assign if mount point is known (not None)
new_destination_disk = mbeds_by_tid[target_id]['mount_point']
break
sleep(0.5)

if new_destination_disk != destination_disk:
Expand Down Expand Up @@ -173,8 +175,10 @@ def check_serial_port_ready(self, serial_port, target_id=None):
mbeds_by_tid = mbeds.list_mbeds_by_targetid() # key: target_id, value mbedls_dict()
if target_id in mbeds_by_tid:
if 'serial_port' in mbeds_by_tid[target_id]:
new_serial_port = mbeds_by_tid[target_id]['serial_port']
break
if mbeds_by_tid[target_id]['serial_port']:
# Only assign if serial port is known (not None)
new_serial_port = mbeds_by_tid[target_id]['serial_port']
break
sleep(0.2)

if new_serial_port != serial_port:
Expand Down

0 comments on commit 938b844

Please sign in to comment.