Skip to content

Replace get devs#3

Merged
jaenrig-ifx merged 11 commits intomainfrom
replace-get-devs
Nov 24, 2025
Merged

Replace get devs#3
jaenrig-ifx merged 11 commits intomainfrom
replace-get-devs

Conversation

@jaenrig-ifx
Copy link
Copy Markdown
Member

@jaenrig-ifx jaenrig-ifx commented Nov 20, 2025

By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---

CONTRIBUTING.md also tells you what to expect in the PR process.

In devs.py:

  • Added serial_number attribute to DevAccessSerial class. It will match the uid of the Device class. But allows direct handling of serial ports.
    This for example will be useful when locally testing devices, and we don´t have or want to create a device yaml. We just have 2 devices connected, and these will be used for testing.
  • To support that the scan() function is added to DevAccessSerial. See how this is used in devs_query.main_devs_query_cli().

  • Added devs_query.py to enable simple command line queries of connected devices, either provided explicitly in a .yml file, or just by scanning the available serial devices. This is currently used by the micropython make deploy_multi target, which can be both used locally (during development) and it is as well used in CI to flash in the same jobs, the same type of boards. See Replace get devs micropython#239

  • run_test_plan.py now handles devices rather than just serial ports. And keep the serial port and switchable capabilities abstracted until required for communication and switching the devices.

  • uhubctl.py will not raise any exception is not available. In that case a device won´t have switching capabilities. This should enable a transparent management of the devices of uhubctl, or in future, any underlying reset/power-switch or comparable hardware/software mechanism.

The devs** will eventually moved out of this repository, as this is independent of micropython. The run_test_plan.py uses devs.py. But devs**.py and uhubctl.py` does not need to know anything about micropython ecosystem (and it should remain like this is to extend this utility to arduino or any future ecosystem).

Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Signed-off-by: jaenrig-ifx <enriquezgarcia.external@infineon.com>
Copy link
Copy Markdown

@LinjingZhang LinjingZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread test/test_devs_query.py
assert(dev_querier.query("address") == None)

print("---- deep query ---")
assert(dev_querier.query_deep("name") == "CY8CKIT-062S2-AI")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is query_deep providing differently? Maybe I could also run the test and see :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normal query will search for valid type (str, int) attributes of the first level object (Device object). And "Deep" query will also consider the attributes of "attribute objects". So in this case, it will make queryable the attributes of DevSwitch and DevAccessSerial.

So, without "deep" -> you could only query "name, uid", with deeps, you can also query "access, serial_number" and "hub, port".

But that I did not make it CLI configurable. The CLI is set to deep_query.

@jaenrig-ifx jaenrig-ifx merged commit a18fff8 into main Nov 24, 2025
@jaenrig-ifx jaenrig-ifx deleted the replace-get-devs branch November 24, 2025 14:05
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 this pull request may close these issues.

3 participants