libusb.3 (70d8f36aa445e4556ead4de32f9b7b4687d95098) libusb.3 (4c0392e6fd10cd0ef9974ccfe16fb4a0f808711b)
1.\"
2.\" Copyright (c) 2009 Sylvestre Gallon
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 12 unchanged lines hidden (view full) ---

21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
1.\"
2.\" Copyright (c) 2009 Sylvestre Gallon
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 12 unchanged lines hidden (view full) ---

21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.Dd August 16, 2011
29.Dd November 9, 2011
30.Dt LIBUSB 3
31.Os
32.Sh NAME
33.Nm libusb
34.Nd "USB access library"
35.Sh LIBRARY
36USB access library
37.Pq libusb, -lusb

--- 273 unchanged lines hidden (view full) ---

311Free a configuration descriptor.
312.Pp
313.Ft int
314.Fn libusb_get_string_descriptor_ascii "libusb_device_handle *devh" "uint8_t desc_idx" "unsigned char *data" "int length"
315Retrieve a string descriptor in C style ASCII.
316Returns the positive number of bytes in the resulting ASCII string
317on success and a LIBUSB_ERROR code on failure.
318.Pp
30.Dt LIBUSB 3
31.Os
32.Sh NAME
33.Nm libusb
34.Nd "USB access library"
35.Sh LIBRARY
36USB access library
37.Pq libusb, -lusb

--- 273 unchanged lines hidden (view full) ---

311Free a configuration descriptor.
312.Pp
313.Ft int
314.Fn libusb_get_string_descriptor_ascii "libusb_device_handle *devh" "uint8_t desc_idx" "unsigned char *data" "int length"
315Retrieve a string descriptor in C style ASCII.
316Returns the positive number of bytes in the resulting ASCII string
317on success and a LIBUSB_ERROR code on failure.
318.Pp
319.Ft int
320.Fn libusb_parse_ss_endpoint_comp "const void *buf" "int len" "libusb_ss_endpoint_companion_descriptor **ep_comp"
321This function parses the USB 3.0 endpoint companion descriptor in host endian format pointed to by
322.Fa buf
323and having a length of
324.Fa len.
325Typically these arguments are the extra and extra_length fields of the
326endpoint descriptor.
327On success the pointer to resulting descriptor is stored at the location given by
328.Fa ep_comp.
329Returns zero on success and a LIBUSB_ERROR code on failure.
330On success the parsed USB 3.0 endpoint companion descriptor must be
331freed using the libusb_free_ss_endpoint_comp function.
332.Pp
333.Ft void
334.Fn libusb_free_ss_endpoint_comp "libusb_ss_endpoint_companion_descriptor *ep_comp"
335This function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor.
336.Pp
337.Ft int
338.Fn libusb_parse_bos_descriptor "const void *buf" "int len" "libusb_bos_descriptor **bos"
339This function parses a Binary Object Store, BOS, descriptor into host endian format pointed to by
340.Fa buf
341and having a length of
342.Fa len.
343On success the pointer to resulting descriptor is stored at the location given by
344.Fa bos.
345Returns zero on success and a LIBUSB_ERROR code on failure.
346On success the parsed BOS descriptor must be freed using the
347libusb_free_bos_descriptor function.
348.Pp
349.Ft void
350.Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos"
351This function is NULL safe and frees a parsed BOS descriptor.
352.Pp
319.Sh USB ASYNCHRONOUS I/O
320.Pp
321.Ft struct libusb_transfer *
322.Fn libusb_alloc_transfer "int iso_packets"
323Allocate a transfer with the number of isochronous packet descriptors
324specified by
325.Fa iso_packets .
326Returns NULL on error.

--- 194 unchanged lines hidden ---
353.Sh USB ASYNCHRONOUS I/O
354.Pp
355.Ft struct libusb_transfer *
356.Fn libusb_alloc_transfer "int iso_packets"
357Allocate a transfer with the number of isochronous packet descriptors
358specified by
359.Fa iso_packets .
360Returns NULL on error.

--- 194 unchanged lines hidden ---