Readbyte() blocking or non-blocking on windows?

Hello! It’s not clear to me (from reading the oF source code and the online documentation) whether the readbyte() function is blocking or not on WINDOWS. What I mean is, if there’s no data in the serial buffer, will the function block until there is?
Or, will the function return immediately? If so what will the returned value be?

From reading the definition of readbyte() it seems the function returns immediately on UNIX systems, giving OF_SERIAL_NO_DATA if there was no data. It’s not clear to me though, what happens on WINDOWS.

I strongly believe this should be clearly stated in the documentation. How can one contribute to the documentation?

Unless the contrary is said all the functions should behave the same in all the platforms.

In the 0.9 the code comments documentation says:

    /// \brief Reads and returns a single byte from the requested device.
    /// ~~~~{.cpp}
    /// ofSerial mySerial;
    /// mySerial.setup(0, 57600);
    /// int myByte = mySerial.readByte();
    /// if ( myByte == OF_SERIAL_NO_DATA ){
    ///     printf("no data was read");
    /// } else if ( myByte == OF_SERIAL_ERROR ){
    ///     printf("an error occurred");
    /// } else {
    ///     printf("myByte is %d", myByte);
    /// }
    /// ~~~~
    /// \returns The single byte as integer. If there is no data it will return
    /// `OF_SERIAL_NO_DATA`, and on error it returns `OF_SERIAL_ERROR`

so yes readByte will return immediately and will return OF_SERIAL_NO_DATA if no data is available. if windows doesn’t behave like that then it’s a bug.

this documentation comments are still not integrated in the web page documentation since the official docs still refer to 0.8.4 where it wasn’t present yet. you can also contribute to the documentation by editing the docs through the edit in github that you can find in every docs section

Ok! Thanks for quick reply! Most useful.