Re: USB data Transfer question



Thanks for the reply!

Here is the code :
//===xxx_Read===
dwErr = IssueBulkTransfer (pUsbSIS->UsbFuncs,
pUsbSIS->BulkIn.hPipe, DefaultTransferComplete, //Callback
pUsbSIS->BulkIn.hEvent, //Context
(USB_IN_TRANSFER|USB_SHORT_TRANSFER_OK), //Flags pBuffer, 0, //
*pBuffer==0 here
BufferLength, &dwBytesTransferred, dwTimeout,
&dwUsbErr);

//===Write===
dwErr = IssueBulkTransfer( pUsbSIS->UsbFuncs,
pUsbSIS->BulkOut.hPipe,
DefaultTransferComplete, // Callback
pUsbSIS->BulkOut.hEvent, // Context
(USB_OUT_TRANSFER /*
pBuffer, 0, //*pBuffer equal to the
data I trying to transfered
dwTransferSize,
&dwBytesTransferred,
dwTimeout,
&dwUsbErr );


"Voidcoder" wrote:

Post your IssueBulkTransfer call here. I'm not sure, but may
be something is wrong there.

"Charles Wang" <Charles Wang@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4CAD4799-7723-48B1-BD16-A8228EDF2A26@xxxxxxxxxxxxxxxx
The USB host and Client are CE device.

When I read the data from Client, in my app I can see the data "hello" in
the first several times and then start dumpping like "heeeeeeee...".
when I tried to printf out the value of pBuffer in IssueBulkTransfer(..,
pBuffer,),
the value is always 0 even though I can see the data correctly in my app.

As I said in OP, I can write data from host to client, I can see the data in
my app running in client, and both USB analizer and the pBuffer value is the
right value I am trying to transfer.

Any ideas?



"Charles Wang" wrote:

I guess the USB2Serial driver you mentioned is the USB Function Client driver.
The driver I worte is for host. I want to Read/Write into USB hostport as a
comport.



"voidcoder" wrote:

May be I'm missing something, but CE already includes
USB2Serial driver... what are you doing exactly? Give us
some details. For example you may want to tell
is your device USB Host or USB Device, and what is
on the oposite side? Desktop? Different device?



"Charles Wang" <CharlesWang@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:50614146-40A1-46CC-9B25-F99D79DBDA39@xxxxxxxxxxxxxxxx
I wrote a USB to Serial driver on CE ARM device.
and the write function which write data from USB host to client works
fine,
but when tried to read data from client, just occasionally get the serial
data, most likely, host only read partial data.

USB analizer tells that Writing from USB host to Client works fine, but
always error when I tried to read data from Client, no matter I got data
complete or not.
eg. if I write "Hello" in Client, I can read "Hello" in the beginning some
times, then I'll get "HHH......" or "lllll....." or "oooo..." randomly.
The
USB analizer always tells "no data".

Any ideas?








.



Relevant Pages

  • Re: USB data Transfer question
    ... What do you pass as BufferLength? ... client when the trouble happens? ... and both USB analizer and the pBuffer value is the ... and the write function which write data from USB host to client works ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB data Transfer question
    ... BTW, after I load my driver, in xxx_iocontrol funciton, the dwcode ... the pBuffer!=0 if there is data sending from client. ... and both USB analizer and the pBuffer value is the ... and the write function which write data from USB host to client works ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB data Transfer question
    ... I'm afraid you can't pass 1-byte length buffer ... the pBuffer!=0 if there is data sending from client. ... and both USB analizer and the pBuffer value is the ... and the write function which write data from USB host to client works ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB data Transfer question
    ... the pBuffer!=0 if there is data sending from client. ... and both USB analizer and the pBuffer value is the ... and the write function which write data from USB host to client works ...
    (microsoft.public.windowsce.platbuilder)
  • Re: USB data Transfer question
    ... the value is always 0 even though I can see the data correctly in my app. ... As I said in OP, I can write data from host to client, I can see the data in ... and both USB analizer and the pBuffer value is the ... and the write function which write data from USB host to client works ...
    (microsoft.public.windowsce.platbuilder)

Loading