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

Fix to rxbuf reader #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheCedarPrince
Copy link

Per #19 and the suggestion from @Alexander-Barth, I was able to make this fix to PiGPIO.jl! It works like it does in the python implementation now. I did have to do one more fix which was to explicitly pass in Base.read. Otherwise, this was what Alexander had suggested. :)

Thanks!

@Alexander-Barth
Copy link
Contributor

Thank a lot for the PR! Can you also check that it also work without the Base. prefix for the read function ? I know that in multiple places we have the Base prefix, but I am not sure what was the reason for this. If you get an error, can you paste the error message here?

@TheCedarPrince
Copy link
Author

TheCedarPrince commented Jan 16, 2025

Sure! Here is the error that I get without Base.read:

ERROR: MethodError: no method matching read(::Sockets.TCPSocket, ::Int32)
You may have intended to import Base.read

Closest candidates are:
  read(::Pi, ::Any)
   @ PiGPIO ~/PiGPIO.jl/src/pi.jl:442

Stacktrace:
 [1] rxbuf(self::Pi, count::Int32)
   @ PiGPIO ~/PiGPIO.jl/src/pi.jl:354
 [2] spi_xfer(self::Pi, handle::Int32, data::Vector{UInt8})
   @ PiGPIO ~/PiGPIO.jl/src/spiSerial.jl:205
 [3] top-level scope
   @ REPL[5]:1

This goes away when I use Base.read. Not entirely sure why -- any thoughts @Alexander-Barth ?

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

Successfully merging this pull request may close these issues.

2 participants