/* This function will do USB_REQ_GET_STATUS bRequest for the device instance to get usb hub status. */
rt_err_t rt_usbh_hub_get_status(struct uinstance *device, rt_uint32_t *buffer)
/* This function will do USB_REQ_GET_STATUS bRequest for the device instance to get usb hub status. */
rt_err_t rt_usbh_hub_get_status(struct uinstance *device, rt_uint32_t *buffer)
{
    struct urequest setup;
    int timeout = USB_TIMEOUT_BASIC;
    RT_ASSERT(device != RT_NULL);
    setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE;
    setup.bRequest = USB_REQ_GET_STATUS;
    setup.wIndex = 0;
    setup.wLength = 4;
    setup.wValue = 0;
    if(rt_usb_hcd_setup_xfer(device->hcd, device->pipe_ep0_out, &setup, timeout) == 8)
    {
        if(rt_usb_hcd_pipe_xfer(device->hcd, device->pipe_ep0_in, buffer, 4, timeout) == 4)
        {
            return RT_EOK;
        }
    }
    return -RT_FALSE;
}