libusb async symbols missing
If I run this code
function transfer_callback(trans)
@show trans[].status
@show trans[].actual_length
@show trans[].buffer
LibUSB.Low.libusb_submit_transfer(trans)
end
buffer = Vector{UInt8}(undef, 8)
LibUSB.Low.libusb_fill_bulk_transfer(C_NULL, C_NULL, 0x81, buffer, length(buffer), @cfunction(transfer_callback, Cint, (Ptr{LibUSB.Low.libusb_transfer},)), C_NULL, 0)
which uses an updated version of LibUSB I get the following error:
ERROR: could not load symbol "libusb_fill_bulk_transfer":
/home/schrist/.julia/artifacts/3888805a32adaf3439cbd23178b2e9b5e922995c/lib/libusb-1.0.so: undefined symbol: libusb_fill_bulk_transfer
Stacktrace:
[1] libusb_fill_bulk_transfer(transfer::Ptr{LibUSB.Low.libusb_transfer}, dev_handle::Ptr{LibUSB.Low.libusb_device_handle}, endpoint::UInt8, buffer::Vector{UInt8}, length::Int64, callback::Ptr{Nothing}, user_data::Ptr{Nothing}, timeout::Int64)
@ LibUSB.Low ~/.julia/dev/LibUSB/deps/deps.jl:1353
[2] top-level scope
@ ~/.julia/dev/LibUSB/scripts/DancePad_async.jl:25
same with the other async transfer functions of libusb.
The libusb_fill_bulk_transfer function is not actually contained inside the compiled library, it is shipped as an inline function inside the libusb.h header that the library consumers have to include. That means it isn't actually present in the library and instead is inside the application code. You can see the functions that are like this (i.e. not in the library) on the API page here https://libusb.sourceforge.io/api-1.0/group__libusb__asyncio.html by looking for the functions flagged inline and static.
Does that mean it could be called with the current libusb_jll just differently?
Or would we need to build it differently or it just not possible to call them?
You can't call them in the current libusb_jll library at all.
In order to use them in a jll package, you would have to write C wrappers for them and include those as part of the library API (e.g. just a C function that calls that inline function). Unfortuently, they would have to have a different name than the current library functions.