One application communicates two USBDevices?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,I am going to develope a application to communicate with two USBDevices with c++ and CyAPI.lib.I just need to send data to the USBDevice one by one.But I can't find some message about it.I hope someone could help me.Thank you very much.

0 Likes
1 Solution
Anonymous
Not applicable

You will have to define 2 instance of the device type and then assign the device pointer by checking the required VID/PID from the device. You need to access the define the endpoints for each device (whichever EP you want to use). Once you have the individual endpoints for both the devices, you can start data transfer using Xferdata function for that EP.  Let us know if you are facing any problem.

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

You can communicate with 2 device using one host application. We have provided our example Streamer where we only use one device at a time. However, you can use 2 different device instances, and use these two handles to communicate to 2 different devices at a time. I suppose you can take the reference for communicating with one device, and modify it to support 2 devices as per your requirements. If you face any diffiluty, do let us know.

0 Likes
Anonymous
Not applicable

Tnanks for your advice.I have read CyAPI.pdf recently.And I want to know that ,in my application, I need to communicate with two USBDevice,So if I need to create two ControlEndPoints to control them,or the two USBDevices share the same ControlEndPoint.

0 Likes
Anonymous
Not applicable

You will have to define 2 instance of the device type and then assign the device pointer by checking the required VID/PID from the device. You need to access the define the endpoints for each device (whichever EP you want to use). Once you have the individual endpoints for both the devices, you can start data transfer using Xferdata function for that EP.  Let us know if you are facing any problem.

0 Likes