bimetek / QUSB

Qt wrapper classes for LibUSB 1.0
GNU Lesser General Public License v3.0
21 stars 16 forks source link

Sample code #6

Open ocgltd opened 8 years ago

ocgltd commented 8 years ago

I'm interested in your project, and would appreciate a sample code that reads/write to a device. I realize there are no docs, but a small sample with async (readyread signal?) read, and write would be helpful. Do you need to know the tx/rx endpoints of the device? I assume a simple example would make this clear. Thanks

uranusjr commented 8 years ago

There is a usage demo inside the demo/ directory. To get the ready-read signal, you can connect to the QUSB::IO::bytesReceived(QByteArray) signal.

I only implemented BulkIO to do read-only bulk transfer because it is the only thing we needed, but it should not be difficult to expand on the IO class.

To be honest, I am not familiar with USB myself, and the project was created mainly to hide away things I don’t understand so I don’t mess up too often. If you have knowledge on the topic, please feel free to just contribute directly.

ocgltd commented 8 years ago

Thanks for the feedback. I’m not familiar with USB either – which is why I was looking for a Qt class that would keep all of the details away. Looks like I’ll have to implement R+W methods for ‘control’ or ‘interrupt’ transfer (which from what I’ve read is one of 3 methods for transfer).

I found a generic c++ driver for a USB device so I’ll have to compare if it’s easier to wrap their code or expand yours.

Thanks Michelle

From: Tzu-ping Chung [mailto:notifications@github.com] Sent: Tuesday, March 29, 2016 10:41 PM To: bimetek/QUSB Cc: Michelle Dupuis Subject: Re: [bimetek/QUSB] Sample code (#6)

There is a usage demo inside the demo/ directory. To get the ready-read signal, you can connect to the QUSB::IO::bytesReceived(QByteArray) signal.

I only implemented BulkIO to do read-only bulk transfer because it is the only thing we needed, but it should not be difficult to expand on the IO class.

To be honest, I am not familiar with USB myself, and the project was created mainly to hide away things I don’t understand so I don’t mess up too often. If you have knowledge on the topic, please feel free to just contribute directly.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHubhttps://github.com/bimetek/QUSB/issues/6#issuecomment-203209207