diff --git a/psychopy_bbtk/tpad.py b/psychopy_bbtk/tpad.py index 9e6cc60..bf9794a 100644 --- a/psychopy_bbtk/tpad.py +++ b/psychopy_bbtk/tpad.py @@ -74,9 +74,10 @@ def __init__(self, pad, channels): def getAvailableDevices(): devices = [] # iterate through profiles of all serial port devices - for dev in TPad.getAvailableDevices(): + for profile in TPad.getAvailableDevices(): devices.append({ - 'pad': dev['port'], + 'deviceName': profile['Instance ID'] + "_photodiodes", + 'pad': profile['port'], 'channels': 2, }) @@ -177,9 +178,10 @@ def parseMessage(self, message): def getAvailableDevices(): devices = [] # iterate through profiles of all serial port devices - for dev in TPad.getAvailableDevices(): + for profile in TPad.getAvailableDevices(): devices.append({ - 'pad': dev['port'], + 'deviceName': profile['Instance ID'] + "_buttons", + 'pad': profile['port'], 'channels': 10, }) @@ -227,6 +229,7 @@ def getAvailableDevices(): # iterate through profiles of all serial port devices for profile in st.systemProfilerWindowsOS( classid="{4d36e978-e325-11ce-bfc1-08002be10318}", + connected=True ): # skip non-bbtk profiles if "BBTKTPAD" not in profile['Instance ID']: @@ -242,6 +245,7 @@ def getAvailableDevices(): num = desc[start:end] devices.append({ + 'deviceName': profile['Instance ID'], 'port': f"COM{num}", })