-
Notifications
You must be signed in to change notification settings - Fork 13
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
Demo of the full Greentea protocol flow on Unix PTY #31
Conversation
55ee660
to
27ea603
Compare
Pseudoconsole on Windows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"This replaces the file-based custom_io example, as there is no point
maintaining two examples to demonstrate how to override the default
IO."
The PTY example is more complex, so less good of an example for custom_io. I'd recommend keeping both for at least that reason.
Thanks for the suggestions, I've brought back custom_io and updated the README. |
Should we also add Windows support to this demo, or is that not feasible? |
@rwalton-arm I don't have a Windows environment to develop and test it, but if anyones wants to add support for Windows, they can raise another PR. The long-term solution @Patater suggests is adding an option in htrun to use stdio or files: ARMmbed/greentea#305 which doesn't quite depend on the OS. |
Yes, an "attach to process" feature, where htrun would read the process's stdout, would be useful. Sounds like the right solution to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The renaming of the stdio example should be its own commit.
The pty example commit sill says "This commit also removes the CMake cache variable BUILD_EXAMPLES
.", but that isn't the case anymore and should be removed from the commit message.
Previously we used the same name `greentea-client-example` for both the stdio and custom_io examples, and relied on the switch `GREENTEA_CLIENT_STDIO` to control which one gets built. But as different examples, each one should have its own precise name for clarity and to allow multiple examples to be built in the future.
Add a demo which creates a PTY (pseudo-terminals) device node which the host (htrun) can talk to like a serial device. To run it, two shells are required: one for the device running greentea-client, one for the host. Notes: * Given that htrun currently doesn't provide a generic way (e.g. stdio) to interact with another process running greentea-client, PTY is the easiest way to demo the full Greentea protocol without requiring an embedded device or Mbed OS. * PTY requires a Unix-like OS. Windows has a different API to access terminals, so this example is excluded on Windows.
@Patater Both are resolved now, thanks |
Add a demo which creates a PTY (pseudo-terminals) device node which the host (htrun) can talk to like a serial device. To run it, two shells are required: one for the device running greentea-client, one for the host.
Notes:
Also remove the CMake cache variable
BUILD_EXAMPLES
. Its intention was to offer an option to not build the examples when greentea-client is embedded in another project, but now we already have the checkif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
which does it more elegantly.