-
Notifications
You must be signed in to change notification settings - Fork 632
Adapter enumeration #1180
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
base: main
Are you sure you want to change the base?
Adapter enumeration #1180
Conversation
Each interface should provide a means for enumerating all matching adapters. The result should be an list of adapter identifiers. An adapter identifier is not limited or equal to serial number, it can be a place in a device tree (like PCI or USB tree). The adapter identifier then can be used with the init of the bus/interface.
Add the enumeration functionality and test it. The enumeration is useful to skip tests which rely on connected hardware.
Create a HRESULT fallback if platform is not win32 Make the method list_adapters a class method correctly Fix the formatting
Codecov Report
@@ Coverage Diff @@
## develop #1180 +/- ##
===========================================
- Coverage 70.95% 69.59% -1.36%
===========================================
Files 79 79
Lines 7808 7812 +4
===========================================
- Hits 5540 5437 -103
- Misses 2268 2375 +107 |
…t if it is not loaded.
@marcel-kanter , how is this different from |
Basically this provides the steps in between and is an attempt to unify the arguments for the bus instantiation. neovi : serial (The ones with the question mark are a guess.) In the end detect_available_configs can needs to enumerate the adapters and needs to find the configurations for each adapter. You can do this in one big step or provide the intermediate steps. However _detect_available_configs should be without the leading underscore. |
First part with the fix of #1179
The basic principle of the adapter enumeration is described in the commit message and here:
In case you have connected multiple IXXAT adapters, you have to select them by using their unique hardware id.
To get a list of all connected IXXAT adapters you can use the function
list_adapters()
as demonstrated below:The method list_adapters shall return an iterable with adapter identifiers or an empty list. If an driver must be installed, then an exception shall be thrown.
This principle should be rolled out to all other interfaces, because most of the time you deal with one type of interface but more likely with multiple adapters. To unify the interface for creating the busses, the adapter keyword argument should be used. As this does not imply that a serial number exists. For PCI cards the adapter identifier maybe the place in the PCI bus, or for network bridges this might be an arbitraty name which stands for an IP-address and port, etc.
The next step should be an method that returns the capabilities for an adapter.
Both methods then can be used to build a dict of all configurations of an interface.
The methods in each interface then can be used to build an dict of all configurations of all interfaces (recursively).