Allocate libusb buffers in C (#11)
* add alloc/free_transfer_and_buffer. Manages the buffer memory on the C side. * switch libusb.go to use the new alloc/free_transfer_and_buffer. Add a new buffer() call to get access to the allocated buffer as a Go slice. * Fake USB transfer uses the new alloc/free/buffer interface. * Switch to the new libusb.alloc signature, where libusb owns the buffer. * newUSBTransfer now allocates a separate buffer, do a copy on endpoint.transfer. * newUSBTransfer will now allocate it's own buffer. * Enable autodetach in rawread.
This commit is contained in:
@@ -140,6 +140,9 @@ func main() {
|
||||
}
|
||||
dev := devs[0]
|
||||
|
||||
log.Print("Enabling autodetach")
|
||||
dev.SetAutoDetach(true)
|
||||
|
||||
log.Printf("Setting configuration %d...", *config)
|
||||
cfg, err := dev.Config(*config)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user