• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 19, 2024, 04:22:13 am

News:

SMF - Just Installed!


Sending Packets

Started by JamesBrown, August 12, 2009, 10:18:32 pm

Previous topic - Next topic

JamesBrown

Is there an example of sending a packet to a USB device?  There is a good one using pipes but I need one that uses packets.
Thanks......... Jim

Roman Novgorodov

Hello

See the USBPipeDemo. It shows I/O operations over USB pipes. You can use same method for send anything what you need (one byte or byte sequence (packet)).

Roman Novgorodov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

JamesBrown

Thanks for the reply Roman but:
I need to send a control message to a USB device that need to be initialized.
I need to do:

int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, int value, int index, char *bytes, int size, int timeout);

Is this function available somehow?

Thanks........... Jim

Roman Novgorodov

Hello

It seems like you need WinUsb_ControlTransfer() call.

Unfortunately, current version have no such method, we will include it in the next relese asap.

You can try use this call directly:
WinUsb_ControlTransfer(nrUsb1.Handle, ...);
Please more info you can find here:
http://msdn.microsoft.com/en-us/library/aa476436.aspx

Roman Novgorodov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

JamesBrown

I had an idea Roman.

Its verry difficult for me to grasp the problems with coding for WinUSB.  I think its because I have always coded in Delphi and it shields me from most of the stuff a C++ or C# coder has to put up with.

It would be great if you could write some demo code for the OSR USB-FX2 Learning Kit (Driver, Device and Pipe).  That way anyone could buy the kit and run your demo and know that at least it should work.  Should help you sell more softwre too.

Using WinUSB for User-Mode: http://www.osronline.com/article.cfm?article=532
OSR FX2 Learning Kit :http://www.osronline.com/article.cfm?article=382

Have you thought of doing this?

Roman Novgorodov

Hello

Thank you for information.

We know well about OSR USB-FX2 Learning Kit.

Today I have ordered this board. Now we are waiting for shipping this device.

When device will arrived we will try to create special demo project sample for it.
But, please note that the shipping can take a long time for our region.

Roman Novgorodov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

JamesBrown

Quote from: Roman Novgorodov on August 20, 2009, 03:49:15 pm
It seems like you need WinUsb_ControlTransfer() call.

You can try use this call directly:
WinUsb_ControlTransfer(nrUsb1.Handle, ...);

Roman - Can you give me a small sample of how I would do this call?  I don't understand how to link Delphi to the structures that contain WinUSB_ControlTransfer.

Thanks..... Jim