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

Correct documentation for transports #94

Closed
heevasti opened this issue Aug 9, 2024 · 0 comments · Fixed by #95
Closed

Correct documentation for transports #94

heevasti opened this issue Aug 9, 2024 · 0 comments · Fixed by #95

Comments

@heevasti
Copy link
Collaborator

heevasti commented Aug 9, 2024

Description

An user opened an issue about problems in parsing an USBTMC transport string of format "usbtmc[:vendorid=0x1313][:productid=0x8075]:serialnr=Pxxxxxxx". The string is incorrect so the problem was not in the parsing, but what caused the user to think this would be a valid string is that:
a) The documentation does not state the parts between "[...]" are optional inputs
b) For USBTMC all inputs are obligatory, but the example string shows the contrary!
c) r"(?::\[(.+)[\]$])|" # enclosed parameter (for example used in ipv6): i.e. ...:[param]:... or ...:[param] line in parsing implies [ and ] would be allowed inputs.

We should fix the documentation such that:
a) Write clearly that the parts between "[...]" are for giving an IPv6 address for TCP transports.
b) Remove the incorrect optional parts of USBTMC device's string format, and also the =0x... and =sn parts, as they are explained below. Besides, =0x... suggests that the format has to be hex, while decimal (int) is also fine.
c) This is valid, as for TCP transports with IPv6 addresses the square brackets are used to distinct the : characters in the IPv6 address from the : characters in the transport string. But it is confusing to use the same character to imply optional input and the IPv6 address delimiter. So, probably it would be useful to use some other character, say < and > to imply the optional inputs.

Modules to be modified

  • qmi.core.transport
  • CHANGELOG.md

Tests to be created or updated

  • tests.core.test_transport to either catch an error if square brackets are used, or, if "fixed", to test that the use of square brackets works correctly.
@heevasti heevasti self-assigned this Aug 9, 2024
@heevasti heevasti linked a pull request Aug 9, 2024 that will close this issue
@heevasti heevasti removed their assignment Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant