Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource: udev: also suggest ID_USB_INTERFACE_NUM for USBResource #1334

Merged

Conversation

joergho
Copy link
Contributor

@joergho joergho commented Mar 1, 2024

Description
A USB serial device often provides multiple interfaces for the same
serial number. In these cases it is not possible to distinguish
the interfaces solely based on the serial number (ID_SERIAL_SHORT).
However, if additionally the interface number (ID_USB_INTERFACE_NUM)
is provided, it is possible to distinguish all interfaces without
the need of using the full device path (ID_PATH).

Example:

  (...)
  === suggested matches ===
  (...)
  USBSerialPort:
    match:
      ID_SERIAL_SHORT: ABCDEF00001
      ID_USB_INTERFACE_NUM: '00'
  (...)
  === suggested matches ===
  (...)
  USBSerial Port
  USBSerialPort:
    match:
      ID_SERIAL_SHORT: ABCDEF00001
      ID_USB_INTERFACE_NUM: '01'

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

@joergho joergho force-pushed the usbserial-suggest-interface-num branch 2 times, most recently from 4f21d52 to 720a79a Compare March 1, 2024 08:51
@Bastian-Krause Bastian-Krause requested a review from jluebbe March 14, 2024 07:16
Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 62.7%. Comparing base (be28ac1) to head (c7b634b).

Files Patch % Lines
labgrid/resource/udev.py 0.0% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1334     +/-   ##
========================================
- Coverage    62.8%   62.7%   -0.1%     
========================================
  Files         163     163             
  Lines       12019   12025      +6     
========================================
  Hits         7550    7550             
- Misses       4469    4475      +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

jluebbe
jluebbe previously approved these changes Mar 14, 2024
@jluebbe
Copy link
Member

jluebbe commented Mar 14, 2024

Looks good, but needs a rebase.

joergho added 2 commits March 14, 2024 10:12
A USB serial device often provides multiple interfaces for the same
serial number. In these cases it is not possible to distinguish
the interfaces solely based on the serial number (ID_SERIAL_SHORT).
However, if additionally the interface number (ID_USB_INTERFACE_NUM)
is provided, it is possible to distinguish all interfaces without
the need of using the full device path (ID_PATH).

Example:

  (...)
  === suggested matches ===
  (...)
  USBSerialPort:
    match:
      ID_SERIAL_SHORT: ABCDEF00001
      ID_USB_INTERFACE_NUM: '00'
  (...)
  === suggested matches ===
  (...)
  USBSerialPort:
    match:
      ID_SERIAL_SHORT: ABCDEF00001
      ID_USB_INTERFACE_NUM: '01'

Signed-off-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
Signed-off-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
@joergho joergho force-pushed the usbserial-suggest-interface-num branch from 720a79a to c7b634b Compare March 14, 2024 10:08
@joergho joergho changed the title Usbserial suggest interface num resource: udev: also suggest ID_USB_INTERFACE_NUM for USBResource Mar 14, 2024
@joergho joergho removed their assignment Mar 14, 2024
@Emantor Emantor merged commit d8835d5 into labgrid-project:master Mar 14, 2024
9 of 11 checks passed
@joergho joergho deleted the usbserial-suggest-interface-num branch March 19, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants