plestylib.traffic.usb_utils
===========================

.. py:module:: plestylib.traffic.usb_utils


Functions
---------

.. autoapisummary::

   plestylib.traffic.usb_utils.usb_address_to_decimal
   plestylib.traffic.usb_utils.reset_usb_device


Module Contents
---------------

.. py:function:: usb_address_to_decimal(address: str) -> str

   Convert a VISA USB resource address to decimal format for pyvisa.
   Example: "USB0::0x1313::0x8078::INSTR" -> "1313:8078"


.. py:function:: reset_usb_device(device_id: str) -> None

   Reset the underlying USB device before opening a VISA session.
   Why?
   The device's USBTMC firmware sometimes leaves the USB bulk endpoint
   in a halted state after failed communication attempts. That might
   cause subsequent VISA sessions to stall indefinitely on write operations.

   Expected VISA resource format: USB...::0xVVVV::0xPPPP::...::INSTR


