HB 区分usb port 方法如下:
在usb callback 内
static void _SysInitUSBCallback(MS_U8 u8Event, MS_U32 u32Para, char* s)
{
HB_printf("USB Call Back Event %.2x Parameter %lx %s \n", u8Event, u32Para, s);
// Control USBInsertFlag
MS_U8 usbnum = 0xff;
if (s == NULL || strlen(s) < 6) // s = "/dev/sdx/", at least should be "/dev/x"
{
HB_printf("[%s][%d]invalid mount device:%s\n", (s == NULL) ? "NULL" : s);
return ;
}
MS_U8 _u8hostId=0xff;
_u8hostId = MDrv_USB_MscLookupHostID(s);
printf("\033[1;33m""[NMGR][%s][%d] usb host is %ld \n \033[m", __FUNCTION__,__LINE__,_u8hostId);
也就是调用MDrv_USB_MscLookupHostID 将 /dev/sda/ 传进来就可以得到是那个port 口。