I've just started using QNX. I'm trying to write a USB3 vision driver under QNX by adapting a code found on GitHub: https://github.com/ni/usb3vision/tree/master
and I wanted to know how to replace the usb_bulk_msg() function by the functions of the QNX libusbdi but I can't figure out how to do it.
Most of the functions are identical, but I can't figure out how to replace usb_bulk_msg().
I only have access to
libusbdidocumentation for QNX 6.5 and prior. At that time, QNX libusbdi did not supply synchronous messaging functions, only an asynchronous completion callback interface viausbd_io. You will need to write your own shim function.usb_bulk_msgitself is actually implemented using an underlying asynchronous USB API very similar to libusbdi; you can use the kernel source code there as a guide on how to implement it. On QNX,struct completioncould be implemented with a condvar. Note that you'll also need to track outstanding requests so as to manage cleanup in the device removal callback.