Skip to content

sys/stdio: add optional function stdio_available#17446

Merged
aabadie merged 3 commits intoRIOT-OS:masterfrom
gschorcht:sys/std_available
Jan 3, 2022
Merged

sys/stdio: add optional function stdio_available#17446
aabadie merged 3 commits intoRIOT-OS:masterfrom
gschorcht:sys/std_available

Conversation

@gschorcht
Copy link
Copy Markdown
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
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
Copy Markdown
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
Copy Markdown
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