OpenUSB Developers Guide
Prev |  | Next

# `openusb_get_busid_list, openusb_free_busid_list`

## Name

`openusb_get_busid_list, openusb_free_busid_list` -- Return all busids in the system, Free returned busids

## Synopsis

``uint32_t openusb_get_busid_list`(openusb_handle_t handle , openusb_busid_t **busids , uint32_t *num_busids );`

``void openusb_free_busid_list`(openusb_busid_t * busids);`

## Parameters

`handle` - An openusb instance handle, obtained in `openusb_init`.

`busids` - Pointer to address of the busid list.

`num_busids` - Number of bus ids in the list.

## Description

`openusb_get_busid_list()` returns all the ids of busses in a system. The busids are used by other openusb functions to search and match specific devices that an application will operate on. `openusb_free_busid_list()` frees the busids returned in `openusb_get_busid_list()`.

## Return Value

`openusb_get_busid_list` may have the following return values,

OPENUSB_SUCCESS - Callback was successfully set.

OPENUSB_BADARG - Invalid argument. busids or num_busids is NULL. Or, (*busids) is NOT null, otherwise it will cause memory leak..

OPENUSB_INVALID_HANDLE - Invalid handle.

OPENUSB_NULL_LIST - The busids list is empty.

OPENUSB_NO_RESOURCES - Memory allocation failure.

## See Also

`openusb_init, openusb_fini`

Prev | Home | Next
Bus and Device Operations | Up | `openusb_get_devids_by_bus, openusb_get_devids_by_vendor, openusb_get_devids_by_class, openusb_free_devid_list`