Skip to content

Stream functions for detecting if an int or float is available. #4924

Open
@damellis

Description

@damellis

That is, a function like intAvailable() or floatAvailable() that indicates whether or not a call to parseInt() or parseFloat() would succeed given the data currently in the stream's buffer. I'd suggest not applying the timeout to these (i.e. not waiting for additional characters to arrive), because part of the point would be to do other things while waiting for an int or float to arrive on the serial port.

This probably depends on having multi-byte look-ahead / peek (https://github.com/arduino/Arduino/issues/1910), which is a larger issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreRelated to the code for the standard Arduino APIPrint and Stream classThe Arduino core library's Print and Stream classesfeature requestA request to make an enhancement (not a bug fix)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions