This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

vendorId and ProductId

Hi all,

How can i get vendorId and Productid of the usb connected. Which Api can be used from a middleware application?

From the link www.keil.com/.../_u_s_b__device__descriptor.html , i understood DEVICE DESCRIPTOR can be used.

But how this can be called in a function??

Regards
Arun

Parents
  • Hi ,

    I am using Keil-rtx and CMSIS driver for usb.

    For STM32Cube driver ,i found following code which give Vendor Id and Product id of usb.
    Refernce Link:
    github.com/.../usbh_msc.c

    ///code for STM32 cube
    case MSC_READ_INQUIRY:
            scsi_status = USBH_MSC_SCSI_Inquiry(phost, MSC_Handle->current_lun, &MSC_Handle->unit[MSC_Handle->current_lun].inquiry);
    
            if( scsi_status == USBH_OK)
            {
              USBH_UsrLog ("Inquiry Vendor  : %s", MSC_Handle->unit[MSC_Handle->current_lun].inquiry.vendor_id);
    
              USBH_UsrLog ("Inquiry Product : %s", MSC_Handle->unit[MSC_Handle->current_lun].inquiry.product_id);
    
              USBH_UsrLog ("Inquiry Version : %s", MSC_Handle->unit[MSC_Handle->current_lun].inquiry.revision_id);
    
              MSC_Handle->unit[MSC_Handle->current_lun].state = MSC_TEST_UNIT_READY;
            }
            if( scsi_status == USBH_FAIL)
            {
              MSC_Handle->unit[MSC_Handle->current_lun].state = MSC_REQUEST_SENSE;
            }
            else if(scsi_status == USBH_UNRECOVERED_ERROR)
            {
              MSC_Handle->unit[MSC_Handle->current_lun].state = MSC_IDLE;
              MSC_Handle->unit[MSC_Handle->current_lun].error = MSC_ERROR;
            }
            break;
    
    


    ///////////////////////////////////////////////////////////////////////////////

    but, since i am using CMSIS driver these functions are not provided.
    Is there any method to find usb details with CMSIS driver.

    Regards
    Arun

Reply
  • Hi ,

    I am using Keil-rtx and CMSIS driver for usb.

    For STM32Cube driver ,i found following code which give Vendor Id and Product id of usb.
    Refernce Link:
    github.com/.../usbh_msc.c

    ///code for STM32 cube
    case MSC_READ_INQUIRY:
            scsi_status = USBH_MSC_SCSI_Inquiry(phost, MSC_Handle->current_lun, &MSC_Handle->unit[MSC_Handle->current_lun].inquiry);
    
            if( scsi_status == USBH_OK)
            {
              USBH_UsrLog ("Inquiry Vendor  : %s", MSC_Handle->unit[MSC_Handle->current_lun].inquiry.vendor_id);
    
              USBH_UsrLog ("Inquiry Product : %s", MSC_Handle->unit[MSC_Handle->current_lun].inquiry.product_id);
    
              USBH_UsrLog ("Inquiry Version : %s", MSC_Handle->unit[MSC_Handle->current_lun].inquiry.revision_id);
    
              MSC_Handle->unit[MSC_Handle->current_lun].state = MSC_TEST_UNIT_READY;
            }
            if( scsi_status == USBH_FAIL)
            {
              MSC_Handle->unit[MSC_Handle->current_lun].state = MSC_REQUEST_SENSE;
            }
            else if(scsi_status == USBH_UNRECOVERED_ERROR)
            {
              MSC_Handle->unit[MSC_Handle->current_lun].state = MSC_IDLE;
              MSC_Handle->unit[MSC_Handle->current_lun].error = MSC_ERROR;
            }
            break;
    
    


    ///////////////////////////////////////////////////////////////////////////////

    but, since i am using CMSIS driver these functions are not provided.
    Is there any method to find usb details with CMSIS driver.

    Regards
    Arun

Children