Page 1 of 1

Transfer idea needed

Posted: Tue Jul 26, 2011 10:35 pm
by bla
Hi,

I'm quite unexperienced with USB/HID in general so I need some help.

Using HID is mandatory. On my µC I have a table full of data. It's pretty much as big as the eeprom is. The host software (written in Delphi using a TJvHidDeviceController component) needs to be able to update each line in this table. I already figured this out (SetFeature). Using GetFeature to read a predefined line also works.
The "problem" now is to read out any other line of the table. Or all of them. Let's say I want to read line 23. My idea was to introduce a new report id just to tell the µC which line is next with SetFeature, then use GetFeature. A bit complicated, isn't it? How would you do it?

Thanks.

Re: Transfer idea needed

Posted: Thu Jul 28, 2011 5:46 am
by _frank26080115
Your report should consist of an address followed by data, all contained into one report

Re: Transfer idea needed

Posted: Thu Jul 28, 2011 11:14 am
by bla
But if I use GetFeature, no data (besides the report id) gets transferred to the µC, right?

Re: Transfer idea needed

Posted: Thu Jul 28, 2011 12:32 pm
by Daid
Each request you do to the USB device has a "value" parameter, which can be filled with anything you want. You could use it as an address so you can do multiple requests. (the usbRequest_t recieves this value in wValue)

Re: Transfer idea needed

Posted: Thu Jul 28, 2011 12:42 pm
by bla
This sounds great. :) Now I only have to find out how to use it with TJvHidDeviceController..... hmmm...

Re: Transfer idea needed

Posted: Fri Jul 29, 2011 8:28 am
by Micha
Perhaps you can take http://www.mikrocontroller.net/articles ... r#Download as an example. The dll is written in Delphi and maybe the author will share some code with you if you ask him. His name is Hugo Portisch.