Scan for Phidget sensors attached?
Posted: Tue Jun 21, 2022 1:53 am
Running on Linux and writing in Python and wondering what's the best way to scan for attached Phidget sensors and retrieve their serial numbers.
There can be a number of sensors attached and they are managed by a number of different programs executing on the system. So if I have sensors A, B and C, of which Sensor A is being monitored by program_A and sensor B is being monitored by program_B, but C is not currently being used by any Program, can I scan the environment for Sensor C or alternatively for all three sensors and find in the results that C is free.
I know there's the attach and detach handlers and that's what I'm currently using. Just executing a short Python program which runs the attach handler and prints any results, but I'm not sure that's a reliable method as yet, early days. If C is already attached to the Computer when I run the attached scan will I get it, or is that even only intended to trigger when the sensor is physically attached to the computer?
Been searching for a better solution but so far haven't found a winner. Thanks for any advice.
There can be a number of sensors attached and they are managed by a number of different programs executing on the system. So if I have sensors A, B and C, of which Sensor A is being monitored by program_A and sensor B is being monitored by program_B, but C is not currently being used by any Program, can I scan the environment for Sensor C or alternatively for all three sensors and find in the results that C is free.
I know there's the attach and detach handlers and that's what I'm currently using. Just executing a short Python program which runs the attach handler and prints any results, but I'm not sure that's a reliable method as yet, early days. If C is already attached to the Computer when I run the attached scan will I get it, or is that even only intended to trigger when the sensor is physically attached to the computer?
Been searching for a better solution but so far haven't found a winner. Thanks for any advice.