Classes | |
class | Device |
Functions | |
def | _device_change_callback (info) |
def | _get_port_by_loc (usb_location) |
def | _get_sns_from_spec (spec) |
def | _get_usb_location (physical_port) |
def | _wait_for (serial_numbers, timeout=5) |
def | _wait_until_removed (serial_numbers, timeout=5) |
def | all () |
def | by_configuration (config) |
def | by_name (name) |
def | by_product_line (product_line) |
def | enable_all () |
def | enable_only (serial_numbers, recycle=False, timeout=5) |
def | enabled () |
def | get (sn) |
def | get_port (sn) |
def | hw_reset (serial_numbers, timeout=5) |
def | query (monitor_changes=True) |
Variables | |
_context = None | |
_device_by_sn = dict() | |
acroname = None | |
path | |
rs = None | |
|
private |
Called when librealsense detects a device change (see query())
Definition at line 144 of file devices.py.
|
private |
Definition at line 435 of file devices.py.
|
private |
Helper function for by_configuration. Yields all serial-numbers matching the given spec
Definition at line 200 of file devices.py.
|
private |
Helper method to get windows USB location from registry
Definition at line 399 of file devices.py.
|
private |
Wait until the given serial numbers are all online :param serial_numbers: A collection of serial-numbers to wait for :param timeout: Number of seconds of maximum wait time :return: True if all have come online; False if timeout was reached
Definition at line 340 of file devices.py.
|
private |
Wait until the given serial numbers are all offline :param serial_numbers: A collection of serial-numbers to wait until removed :param timeout: Number of seconds of maximum wait time :return: True if all have come offline; False if timeout was reached
Definition at line 316 of file devices.py.
def rspy.devices.all | ( | ) |
:return: A set of all device serial-numbers at the time of query()
Definition at line 166 of file devices.py.
def rspy.devices.by_configuration | ( | config | ) |
Yields the serial numbers fitting the given configuration. If configuration includes an 'each' directive will yield all fitting serial numbers one at a time. Otherwise yields one set of serial numbers fitting the configuration :param config: A test:device line collection of arguments (e.g., [L515 D400*]) If no device matches the configuration devices specified, a RuntimeError will be raised!
Definition at line 212 of file devices.py.
def rspy.devices.by_name | ( | name | ) |
:param name: Part of the product name to search for ("L515" would match "Intel RealSense L515") :return: A set of device serial-numbers
Definition at line 191 of file devices.py.
def rspy.devices.by_product_line | ( | product_line | ) |
:param product_line: The product line we're interested in, as a string ("L500", etc.) :return: A set of device serial-numbers
Definition at line 182 of file devices.py.
def rspy.devices.enable_all | ( | ) |
Enables all ports on an Acroname -- without an Acroname, this does nothing!
Definition at line 308 of file devices.py.
def rspy.devices.enable_only | ( | serial_numbers, | |
recycle = False , |
|||
timeout = 5 |
|||
) |
Enable only the devices corresponding to the given serial-numbers. This can work either with or without Acroname: without, the devices will simply be HW-reset, but other devices will still be present. NOTE: will raise an exception if any SN is unknown! :param serial_numbers: A collection of serial-numbers to enable - all others' ports are disabled and will no longer be usable! :param recycle: If False, the devices will not be reset if they were already enabled. If True, the devices will be recycled by disabling the port, waiting, then re-enabling :param timeout: The maximum seconds to wait to make sure the devices are indeed online
Definition at line 266 of file devices.py.
def rspy.devices.enabled | ( | ) |
:return: A set of all device serial-numbers that are currently enabled
Definition at line 174 of file devices.py.
def rspy.devices.get | ( | sn | ) |
NOTE: will raise an exception if the SN is unknown! :param sn: The serial-number of the requested device :return: The pyrealsense2.device object with the given SN, or None
Definition at line 244 of file devices.py.
def rspy.devices.get_port | ( | sn | ) |
NOTE: will raise an exception if the SN is unknown! :param sn: The serial-number of the requested device :return: The port number (0-7) the device is on, or None if Acroname interface is unavailable
Definition at line 255 of file devices.py.
def rspy.devices.hw_reset | ( | serial_numbers, | |
timeout = 5 |
|||
) |
Recycles the given devices manually, using a hardware-reset (rather than any acroname port reset). The devices are sent a HW-reset command and then we'll wait until they come back online. NOTE: will raise an exception if any SN is unknown! :param serial_numbers: A collection of serial-numbers to reset :param timeout: Maximum # of seconds to wait for the devices to come back online :return: True if all devices have come back online before timeout
Definition at line 374 of file devices.py.
def rspy.devices.query | ( | monitor_changes = True | ) |
Start a new LRS context, and collect all devices :param monitor_changes: If True, devices will update dynamically as they are removed/added
Definition at line 96 of file devices.py.
|
private |
Definition at line 38 of file devices.py.
|
private |
Definition at line 37 of file devices.py.
rspy.devices.acroname = None |
Definition at line 25 of file devices.py.
rspy.devices.path |
Definition at line 27 of file devices.py.
rspy.devices.rs = None |
Definition at line 32 of file devices.py.