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

When issuing a read, call_port can try to exit. #66

Open
critch opened this issue Jul 2, 2019 · 0 comments
Open

When issuing a read, call_port can try to exit. #66

critch opened this issue Jul 2, 2019 · 0 comments

Comments

@critch
Copy link

critch commented Jul 2, 2019

I have a section of code that is trying to handle incoming data till a marker is set and we can start the framing portion. The UART is a USB gadget that is always present, so open always succeeds. Sometimes a Circuits.UART.read(pid, 1000) results in an exit due to an odd issue with timeout or other. The documentation for read/2 is that it returns {:ok, buffer} or {:error, reason}, but does not cover the exit condition. Either this exit should be conditional, or documented.

Here is a link to the problematic line that calls exit.

exit(:port_timed_out)

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

1 participant