How to receive data from two devices

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

cross mob
Anonymous
Not applicable

 Hi

   

 

   

I would like to do a program that only read data from devices.

   

I plan to send a vendor command to request data from both devices and both devices will send data to host. Is it open two threading?

   

 

   

Best regards

   

Chong Han 

0 Likes
1 Reply
Anonymous
Not applicable

Yes, you can have a separate thread for each device and do your transfers. This approach will scale to as many devices you want. It will also be easy to add >2 devices and it will prevent any one device from locking up transfers on other devices.

   

 

   

 

   

You can alternatively go for a simple run loop by polling all devices. It is very simple to code but can introduce a lot of delays between samples of different devices. And one failed device can hold up every other devices in your loop.

0 Likes