Skip to content

Commit

Permalink
add rspy/acroname --disable
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel committed Oct 14, 2023
1 parent 33615aa commit 5131412
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions unit-tests/py/rspy/acroname.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ def usage():
print( ' Control the acroname USB hub' )
print( 'Options:' )
print( ' --enable Enable all ports' )
print( ' --disable Disable all ports' )
print( ' --recycle Recycle all ports' )
sys.exit(2)
try:
opts,args = getopt.getopt( sys.argv[1:], '',
longopts = [ 'help', 'recycle', 'enable' ])
longopts = [ 'help', 'recycle', 'enable', 'disable' ])
except getopt.GetoptError as err:
print( '-F-', err ) # something like "option -a not recognized"
usage()
Expand Down Expand Up @@ -96,7 +97,7 @@ def find_all_hubs():
"""
from rspy import lsusb
#
# 24ff:8013 =
# 24ff:8013 =
# iManufacturer Acroname Inc.
# iProduct USBHub3p-3[A]
hubs = set( lsusb.devices_by_vendor( '24ff' ))
Expand Down Expand Up @@ -314,6 +315,9 @@ def get_port_from_usb( first_usb_index, second_usb_index ):
if opt in ('--enable'):
connect()
enable_ports() # so ports() will return all
elif opt in ('--disable'):
connect()
disable_ports()
elif opt in ('--recycle'):
connect()
enable_ports() # so ports() will return all
Expand Down

0 comments on commit 5131412

Please sign in to comment.