USB Libraries Help > USB Host Libraries > USB Host Layer Library > Library Interface > a) Functions > USB_HOST_DeviceGetNext Function
MPLAB Harmony USB Stack
USB_HOST_DeviceGetNext Function

This function returns information of the next device attached on the bus. The USB_HOST_DeviceGetFirst() function should have been called at least once on the deviceInfo object. Then calling this function repeatedly on the deviceInfo object will return information about the next attached device on the bus. When there are no more attached devices to report, the function returns USB_HOST_RESULT_END_OF_DEVICE_LIST. 

Calling the USB_HOST_DeviceGetFirst() function on the deviceInfo object after the USB_HOST_DeviceGetNext() function has been called will cause the host to reset the deviceInfo object to point to the first attached device.

C
USB_HOST_RESULT USB_HOST_DeviceGetNext(
    USB_HOST_DEVICE_INFO * deviceInfo
);
Preconditions

The USB_HOST_DeviceGetFirst() function must have been called before calling this function.

Parameters
Parameters 
Description 
deviceInfo 
pointer to the USB_HOST_DEVICE_INFO object. 
Returns

USB_HOST_RESULT_SUCCESS - The function executed successfully. USB_HOST_RESULT_END_OF_DEVICE_LIST - There are no attached devices on the bus. USB_HOST_RESULT_PARAMETER_INVALID - the deviceInfo parameter is NULL. USB_HOST_RESULT_DEVICE_UNKNOWN - the device specified in deviceInfo does not exist in the system. The search should be restarted. USB_HOST_RESULT_FAILURE - an unknown failure occurred. Application can restart the search by calling the USB_HOST_DeviceGetFirst() function.

Remarks

None.

Example
TBD.