-
Notifications
You must be signed in to change notification settings - Fork 4
I can't make write work #113
Copy link
Copy link
Open
Description
When doing a write on a Tx stream I get an error:
nested task error: MethodError: no method matching unsafe_convert(::Type{Ptr{Int32}}, ::Nothing)
The function `unsafe_convert` exists, but no method is defined for this combination of argument types.
Closest candidates are:
unsafe_convert(::Type{Cwstring}, ::Any)
@ Base strings/cstring.jl:101
unsafe_convert(::Type{Ptr{T}}, ::Atomic{T}) where T
@ Base atomics.jl:335
unsafe_convert(::Type{Ptr{T}}, ::Array{T}) where T
@ Base pointer.jl:65
...
Stacktrace:
[1] (::SoapySDR.var"#SoapySDRDevice_writeStream##0#SoapySDRDevice_writeStream##1"{Device, SoapySDR.Stream{ComplexF32}, Ptr{Ptr{ComplexF32}}, Int64, Nothing, Int64, Float64})()
@ SoapySDR ~/.julia/packages/SoapySDR/adLbS/src/errors.jl:35
[2] with_error_check(f::SoapySDR.var"#SoapySDRDevice_writeStream##0#SoapySDRDevice_writeStream##1"{Device, SoapySDR.Stream{ComplexF32}, Ptr{Ptr{ComplexF32}}, Int64, Nothing, Int64, Float64})
@ SoapySDR ~/.julia/packages/SoapySDR/adLbS/src/errors.jl:25
[3] macro expansion
@ ~/.julia/packages/SoapySDR/adLbS/src/errors.jl:34 [inlined]
[4] SoapySDRDevice_writeStream(device::Device, stream::SoapySDR.Stream{ComplexF32}, buffs::Ptr{Ptr{ComplexF32}}, numElems::Int64, flags::Nothing, timeNs::Int64, timeoutUs::Float64)
@ SoapySDR ~/.julia/packages/SoapySDR/adLbS/src/libsoapysdr.jl:848
[5] write(s::SoapySDR.Stream{ComplexF32}, buffers::Vector{Vector{ComplexF32}}; timeout::Nothing, flags::Nothing, throw_error::Bool)
@ SoapySDR ~/.julia/packages/SoapySDR/adLbS/src/device/stream.jl:330
[6] write
@ ~/.julia/packages/SoapySDR/adLbS/src/device/stream.jl:306 [inlined]It seems the problem is in
SoapySDR.jl/src/device/stream.jl
Lines 329 to 343 in ae44914
| out_flags = Ref{Cint}(0) | |
| nwritten = SoapySDRDevice_writeStream( | |
| s.d, | |
| s, | |
| buff_ptrs, | |
| samples_to_write - total_nwritten, | |
| flags, | |
| 0, | |
| timeout_us, | |
| ) | |
| if flags isa Ref | |
| flags[] |= out_flags[] | |
| end | |
Shouldn't the newly created out_flags appear on line 335, not flags.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels