Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2 from sionescu/master

A few fixes
  • Loading branch information...
commit 11238d3aa81ce809f6f717fce3f4d967231bcbf3 2 parents 9bebb50 + 7d7e5ae
@soemraws authored
Showing with 15 additions and 8 deletions.
  1. +1 −1  cl-libusb.lisp
  2. +12 −5 libusb-ffi.lisp
  3. +2 −2 libusb-grovel.lisp
View
2  cl-libusb.lisp
@@ -111,7 +111,7 @@
:test #'=)
(libusb-ffi:usb-release-interface handle-pointer number)
(setf claimed-interfaces (delete number claimed-interfaces :test #'=))
- (refresh-finalization device)))))
+ (usb-rebuild-finalization device)))))
(defun usb-set-altinterface (device setting-or-number)
"Set the alternate interface setting to that of the given
View
17 libusb-ffi.lisp
@@ -15,6 +15,14 @@
(defctype device-ptr :pointer)
(defctype device-handle-ptr :pointer)
+(defctype bus (:struct bus))
+(defctype endpoint-descriptor (:struct endpoint-descriptor))
+(defctype setting (:struct setting))
+(defctype interface (:struct interface))
+(defctype configuration (:struct configuration))
+(defctype device-descriptor (:struct device-descriptor))
+(defctype device (:struct device))
+
(defcfun (usb-init* "usb_init") :void)
(defcfun (usb-find-busses* "usb_find_busses") :int)
@@ -36,14 +44,14 @@
(handle device-handle-ptr)
(index :int)
(buffer :pointer)
- (buffer-size :size-t))
+ (buffer-size size-t))
(defcfun (usb-get-string* "usb_get_string") :int
(handle device-handle-ptr)
(index :int)
(language-id :int)
(buffer :pointer)
- (buffer-size :size-t))
+ (buffer-size size-t))
(defcfun (usb-claim-interface* "usb_claim_interface") :int
(handle device-handle-ptr)
@@ -282,7 +290,7 @@
(usb-claim-interface*
handle
(if (pointerp setting-or-number)
- (usb-setting-interface-get-number setting-or-number)
+ (usb-interface-setting-get-number setting-or-number)
setting-or-number)))
(defun usb-release-interface (handle setting-or-number)
@@ -361,8 +369,7 @@
bytes written."
(unless (integerp endpoint)
(setf endpoint (usb-endpoint-get-address endpoint)))
- (let* ((bytes-to-write (grid:dim0 buffer))
- (bytes-written
+ (let* ((bytes-written
(usb-bulk-write* handle endpoint
(grid::foreign-pointer buffer)
(grid:dim0 buffer) timeout)))
View
4 libusb-grovel.lisp
@@ -75,9 +75,9 @@
(cstruct device "struct usb_device"
(next "next" :type :pointer)
(previous "prev" :type :pointer)
- (descriptor "descriptor" :type device-descriptor)
+ (descriptor "descriptor" :type (:pointer (:struct device-descriptor)))
(configuration "config" :type :pointer)
(number-of-children "num_children" :type :uint8)
(children "children" :type :pointer))
-(ctype :size-t "size_t")
+(ctype size-t "size_t")
Please sign in to comment.
Something went wrong with that request. Please try again.