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

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Conversation

TheCedarPrince
Copy link
Contributor

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
Contributor 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 ?

@Alexander-Barth
Copy link
Contributor

Thanks a lot! I will merge it. (for the error message, maybe we need to add import Base: read, but we can check this later)

@Alexander-Barth Alexander-Barth merged commit 51c931d into JuliaBerry:master Jan 20, 2025
3 checks passed
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