USB Libraries Help > USB Device Libraries > USB Device Layer Library > Library Interface > d) Device Management Functions > USB_DEVICE_ActiveConfigurationGet Function
MPLAB Harmony USB Stack
USB_DEVICE_ActiveConfigurationGet Function

This function returns the current active USB device configuration.

C
uint8_t USB_DEVICE_ActiveConfigurationGet(
    USB_DEVICE_HANDLE usbDeviceHandle
);
Preconditions

The USB Device Layer must have been initialized and opened before calling this function.

Parameters
Parameters 
Description 
usbDeviceHandle 
Pointer to the Device Layer Handle that is returned from USB_DEVICE_Open 
Returns

Present active configuration.

Remarks

None.

Example
// This code example shows how the
// USB_DEVICE_ActiveConfigurationGet function can be called to obtain
// the configuration that has been set by the host. Note that this
// information is also available in the macro USB_DEVICE_EVENT_CONFIGURED.

uint8_t currentConfiguration;
USB_DEVICE_HANDLE usbDeviceHandle;

currentConfiguration = USB_DEVICE_ActiveConfigurationGet(usbDeviceHandle);