/* This function will do USB_REQ_GET_STATUS request for the device instance to get usb hub status. */
rt_err_t rt_usb_hub_get_status(uinst_t uinst, rt_uint8_t *buffer)
/* This function will do USB_REQ_GET_STATUS request for the device instance to get usb hub status. */
rt_err_t rt_usb_hub_get_status(uinst_t uinst, rt_uint8_t *buffer)
{
    struct ureqest setup;
    int timeout = 100;
    int length = 4;
    RT_ASSERT(uinst != RT_NULL);
    setup.request_type = USB_REQ_TYPE_DIR_IN | USB_REQ_TYPE_CLASS | 
        USB_REQ_TYPE_DEVICE;
    setup.request = USB_REQ_GET_STATUS;
    setup.index = 0;
    setup.length = length;
    setup.value = 0;
    if(rt_usb_hcd_control_xfer(uinst->hcd, uinst, &setup, buffer, length, 
        timeout) == length) return RT_EOK;
    else return -RT_FALSE;    
}