AnsweredAssumed Answered

imx6ul:how to use the one usb dev with different  Device endpoint

Question asked by 益 李 on May 16, 2016
Latest reply on May 19, 2016 by 益 李

hi

i use the usb g_serial module:

modprobe g_serial  use_acm=0

in the /dev. i can saw the ttyGS0。

connect pc ,i can saw the Device endpoint use the libusb:

usb信息.bmp

i can use :

int usb_fd = open("/dev/ttyGS0", O_RDWR);

and use the usb by read and writ functoin.

in the pc ,i use the libusb-win32-bin-1.2.6.0 .

in a qt project, i read and write the usb by:

usb_bulk_write(dev, EP_OUT, tmp, sizeof(tmp), 5000);

usb_bulk_read(dev, EP_IN, tmp, sizeof(tmp), 5000);

 

1.how to use the timeout in arm board?

i use the select to implement this function.

is there have other way to implement this function?

 

2.i want to use the Device endpoint 00h.

there is only one ttyGS0.how can i identification the data from the pc with different endpoint address?

and hwo can i send and receive data by endpoint 00h?

 

in the /sys/bus/usb/devices/usb1:

00.bmp

 

int the /sys/bus/usb/devices/usb1/1-0:1.0:

81.bmp

if i can use these files to send and receive data by different endpoint? how?

 

thanks for you help!!

Outcomes