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

in_waiting and out_waiting in pyftdi/serialext/protocol_ftdi.py not implemented but return always 0 #372

Open
SeDi343 opened this issue Mar 25, 2024 · 2 comments

Comments

@SeDi343
Copy link

SeDi343 commented Mar 25, 2024

I was debugging more than half a day why my readup thread is not working using this properties. Please consider raising an NotImplemented(). To reduce unnecessary waste of time for developers.

pyftdi/serialext/protocol_ftdi.py

    @property
    def in_waiting(self):
        """Return the number of characters currently in the input buffer."""
        # not implemented
        return 0

    @property
    def out_waiting(self):
        """Return the number of bytes currently in the output buffer."""
        return 0
@eblot
Copy link
Owner

eblot commented Mar 25, 2024

If I'm not mistaken (since I have not work on this code for years), in_waiting is used in pyserial and other APIs that do not expect an exception unless something not recoverable (such as the communication port being closed) occurs.

The semantic might have changed since the initial development of this file, so maybe it is no longer the case, but if it has not, it would not possible to change the behavior of this function without breaking its purpose unfortunately...

@SeDi343
Copy link
Author

SeDi343 commented Mar 26, 2024

Ended up using serial, since those properties are mandatory for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants