|
| | __init__ (self, vendor_id, product_id) |
| | Initializes a new instance of the UsbComm class.
|
| |
| | descriptor_use_vendor_id (self, vId, pId) |
| |
| | open (self) |
| | Opens the connection to the USB device.
|
| |
| bool | is_connected (self) |
| | Checks if the USB device is connected.
|
| |
| | async_listen_read (self) |
| | Asynchronously listens for and reads data from the USB device.
|
| |
| | stop_listen_read (self) |
| | Stops listening for and reading data from the USB device.
|
| |
| | close (self) |
| | Closes the connection to the USB device.
|
| |
| | write (self, text) |
| | Writes data to the USB device.
|
| |
| | read (self) |
| | Reads data from the USB device.
|
| |
| | write_and_wait_for_response (self, text, response_start_timeout, response_end_timeout, completion_token="") |
| | Writes data to the device and waits for a response.
|
| |
| | write_and_wait_for_response_json (self, text, response_start_timeout, response_end_timeout, completion_token="") |
| | Writes data to the device and waits for a response.
|
| |
◆ __init__()
| UsbComm.UsbComm.__init__ |
( |
| self, |
|
|
| vendor_id, |
|
|
| product_id ) |
Initializes a new instance of the UsbComm class.
- Parameters
-
| vendor_id | The vendor ID for the instance. |
| product_id | The product ID for the instance. |
◆ async_listen_read()
| UsbComm.UsbComm.async_listen_read |
( |
| self | ) |
|
Asynchronously listens for and reads data from the USB device.
◆ close()
| UsbComm.UsbComm.close |
( |
| self | ) |
|
Closes the connection to the USB device.
◆ descriptor_use_vendor_id()
| UsbComm.UsbComm.descriptor_use_vendor_id |
( |
| self, |
|
|
| vId, |
|
|
| pId ) |
◆ is_connected()
| bool UsbComm.UsbComm.is_connected |
( |
| self | ) |
|
Checks if the USB device is connected.
- Returns
- : True if connected, False otherwise.
◆ open()
| UsbComm.UsbComm.open |
( |
| self | ) |
|
Opens the connection to the USB device.
◆ read()
| UsbComm.UsbComm.read |
( |
| self | ) |
|
Reads data from the USB device.
- Returns
- : The data read from the device.
◆ stop_listen_read()
| UsbComm.UsbComm.stop_listen_read |
( |
| self | ) |
|
Stops listening for and reading data from the USB device.
◆ write()
| UsbComm.UsbComm.write |
( |
| self, |
|
|
| text ) |
Writes data to the USB device.
- Parameters
-
| text | The data to write to the device. |
◆ write_and_wait_for_response()
| UsbComm.UsbComm.write_and_wait_for_response |
( |
| self, |
|
|
| text, |
|
|
| response_start_timeout, |
|
|
| response_end_timeout, |
|
|
| completion_token = "" ) |
Writes data to the device and waits for a response.
- Parameters
-
| text | The data to write to the device. |
| response_start_timeout | The timeout interval for the start of the response. |
| response_end_timeout | The timeout interval for the end of the response. |
| completion_token | A token indicating the completion of the response. |
- Returns
- : The data received in response from the device.
◆ write_and_wait_for_response_json()
| UsbComm.UsbComm.write_and_wait_for_response_json |
( |
| self, |
|
|
| text, |
|
|
| response_start_timeout, |
|
|
| response_end_timeout, |
|
|
| completion_token = "" ) |
Writes data to the device and waits for a response.
- Parameters
-
| text | The data to write to the device. |
| response_start_timeout | The timeout interval for the start of the response. |
| response_end_timeout | The timeout interval for the end of the response. |
| completion_token | A token indicating the completion of the response. |
- Returns
- : The data received in response from the device.
◆ _connected
| bool UsbComm.UsbComm._connected = False |
|
protected |
◆ _device_list
| dict UsbComm.UsbComm._device_list = {} |
|
protected |
◆ _discovered_interfaces
| list UsbComm.UsbComm._discovered_interfaces = [] |
|
protected |
◆ _matched_interfaces
| UsbComm.UsbComm._matched_interfaces = None |
|
protected |
◆ _pId
| UsbComm.UsbComm._pId = int(product_id) |
|
protected |
◆ _should_stop_read_loop
| bool UsbComm.UsbComm._should_stop_read_loop = True |
|
protected |
◆ _vId
| UsbComm.UsbComm._vId = int(vendor_id) |
|
protected |
◆ current_batch
| int UsbComm.UsbComm.current_batch = 0 |
◆ data_to_write
| UsbComm.UsbComm.data_to_write = None |
◆ run_loop_thread
| UsbComm.UsbComm.run_loop_thread = threading.Thread(target=self.run_loop_thread_entry) |
◆ total_batches
| int UsbComm.UsbComm.total_batches = 0 |
The documentation for this class was generated from the following file:
- /Users/bob_huang/Documents/Project/UniPRTSDK_python/Comm/UsbComm.py