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

sys/stdio: add optional function stdio_available #17446

Merged
merged 3 commits into from
Jan 3, 2022

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Dec 25, 2021

Contribution description

This PR provides the definition of an additional stdio function to check how many bytes are available for reading.

A number of stdio backend implementations allow to check the number of bytes available for reading before calling the blocking stdio_read. This helps to implement non-blocking functionalities while waiting for stdin.

This PR provides the implementation for

stdio_uart
stdio_cdc_acm

Testing procedure

Green CI.

Issues/PRs references

Follow-up of PR #17335
Required for PR #17447

@github-actions github-actions bot added Area: build system Area: Build system Area: Kconfig Area: Kconfig integration Area: sys Area: System Area: USB Area: Universal Serial Bus labels Dec 25, 2021
@gschorcht gschorcht added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Dec 25, 2021
@gschorcht gschorcht changed the title sys/stdio: add optional function stdio_available available sys/stdio: add optional function stdio_available Dec 25, 2021
sys/include/stdio_base.h Outdated Show resolved Hide resolved
A couple of `stdio` backend implementations allow to check for the number of available bytes for reading before the blocking `stdio_read` is called. This helps to implement non-blocking functionalities while waiting for `stdin`.
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

ACK

@aabadie aabadie enabled auto-merge January 3, 2022 15:16
@aabadie aabadie merged commit 74b38ca into RIOT-OS:master Jan 3, 2022
@gschorcht gschorcht deleted the sys/std_available branch January 3, 2022 17:20
@gschorcht
Copy link
Contributor Author

@aabadie Thanks for reviewing and merging.

@fjmolinas fjmolinas added this to the Release 2022.01 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: Kconfig Area: Kconfig integration Area: sys Area: System Area: USB Area: Universal Serial Bus CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants