Add libusb_get_port_path wrapper
This follows the libusbx API reference at http://libusbx.sourceforge.net/api-1.0/group__dev.html Reviewed by: hselasky@
This commit is contained in:
parent
be4147dd7c
commit
5906bf4984
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250342
@ -26,7 +26,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd May 7, 2012
|
.Dd May 7, 2013
|
||||||
.Dt LIBUSB 3
|
.Dt LIBUSB 3
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -102,6 +102,15 @@ counter decremented once.
|
|||||||
Returns the number of the bus contained by the device
|
Returns the number of the bus contained by the device
|
||||||
.Fa dev .
|
.Fa dev .
|
||||||
.Pp
|
.Pp
|
||||||
|
.Ft int
|
||||||
|
.Fn libusb_get_port_path "libusb_context *ctx" "libusb_device *dev" "uint8_t *buf" "uint8_t bufsize"
|
||||||
|
Stores, in the buffer
|
||||||
|
.Fa buf
|
||||||
|
of size
|
||||||
|
.Fa bufsize ,
|
||||||
|
the list of all port numbers from root for the device
|
||||||
|
.Fa dev .
|
||||||
|
.Pp
|
||||||
.Ft uint8_t
|
.Ft uint8_t
|
||||||
.Fn libusb_get_device_address "libusb_device *dev"
|
.Fn libusb_get_device_address "libusb_device *dev"
|
||||||
Returns the device_address contained by the device
|
Returns the device_address contained by the device
|
||||||
|
@ -369,6 +369,7 @@ void libusb_exit(struct libusb_context *ctx);
|
|||||||
ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list);
|
ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list);
|
||||||
void libusb_free_device_list(libusb_device ** list, int unref_devices);
|
void libusb_free_device_list(libusb_device ** list, int unref_devices);
|
||||||
uint8_t libusb_get_bus_number(libusb_device * dev);
|
uint8_t libusb_get_bus_number(libusb_device * dev);
|
||||||
|
int libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf, uint8_t bufsize);
|
||||||
uint8_t libusb_get_device_address(libusb_device * dev);
|
uint8_t libusb_get_device_address(libusb_device * dev);
|
||||||
enum libusb_speed libusb_get_device_speed(libusb_device * dev);
|
enum libusb_speed libusb_get_device_speed(libusb_device * dev);
|
||||||
int libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint);
|
int libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint);
|
||||||
|
@ -290,6 +290,13 @@ libusb_get_bus_number(libusb_device *dev)
|
|||||||
return (libusb20_dev_get_bus_number(dev->os_priv));
|
return (libusb20_dev_get_bus_number(dev->os_priv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf,
|
||||||
|
uint8_t bufsize)
|
||||||
|
{
|
||||||
|
return (libusb20_dev_get_port_path(dev->os_priv, buf, bufsize));
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
libusb_get_device_address(libusb_device *dev)
|
libusb_get_device_address(libusb_device *dev)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user