Dan
Cheers for that, that has now enabled me to get my usb radio to switch on. The
Snoopy log I posted was the wrong message, not sure what that one does, but for
information, the snoopy log that turned on the radio was:-
00000027 0.00464249 UsbSnoop - IRP_MJ_CREATE
00000028 0.00465171 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
IOCTL_INTERNAL_USB_SUBMIT_URB
00000029 0.00465590
00000030 0.00465674 >>>>>>> URB 5 going down...
00000031 0.00465981 -- URB_FUNCTION_VENDOR_DEVICE:
00000032 0.00466456 TransferFlags = 00000001
(USBD_TRANSFER_DIRECTION_IN, ~USBD_SHORT_TRANSFER_OK)
00000033 0.00466847 TransferBufferLength = 00000008
00000034 0.00467210 TransferBuffer = 81b87fb4
00000035 0.00467601 TransferBufferMDL = 00000000
00000036 0.00467937 UrbLink = 00000000
00000037 0.00468244 RequestTypeReservedBits = 00
00000038 0.00468523 Request = 02
00000039 0.00468831 Value = 0001
00000040 0.00469138 Index = 0000
00000041 0.00956183
00000042 0.00956295 <<<<<<< URB 5 coming back...
00000043 0.00956602 -- URB_FUNCTION_CONTROL_TRANSFER:
00000044 0.00957049 PipeHandle = 81ae0154
00000045 0.00957524 TransferFlags = 00000003
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)
00000046 0.00957915 TransferBufferLength = 00000001
00000047 0.00958278 TransferBuffer = 81b87fb4
00000048 0.00958669 TransferBufferMDL = 81b4d328
00000049 0.00958921
00000050 0.00959256 0000: ff
00000051 0.00959535 UrbLink = 00000000
00000052 0.00961044 SetupPacket : c0 02 01 00 00 00 08 00
00000053 0.00961938 UsbSnoop - IRP_MJ_CLOSE
I achieved this by doing the following:-
byte bmRequestType = (byte)0xc0;
byte bRequest = 0x02;
short wValue = 0x01;
short wIndex = 0x00;
byte[] buffer = new byte[8];
UsbControlIrp usbControlIrp = usbDevice.createUsbControlIrp(
bmRequestType, bRequest, wValue, wIndex);
usbControlIrp.setData(buffer);
try {
usbDevice.syncSubmit(usbControlIrp);
} catch ( UsbException e ) {
logger.error("DCP submission failed : " + e.getMessage());
}
Thanks again......
Quoting Dan Streetman <[EMAIL PROTECTED]>:
>
> The transfer you show below is a Default Control Pipe (DCP) transfer, not
> an interrupt transfer. So, you need to do it on the DCP, i.e. use
> syncSubmit (or asyncSubmit) on the UsbDevice. The DCP only accepts
> UsbControlIrps, which include the setup-packet fields; you can use the
> UsbDevice.createUsbControlIrp(bmRequestType, bRequest, wValue, wIndex)
> method to create an appropriate IRP and then set the data to whatever you
> want - it looks like there are 8 bytes of data in that transfer, although
> I don't see what the value of those 8 bytes is.
>
>
> On Wed, 5 Jan 2005 [EMAIL PROTECTED] wrote:
>
> >Hi all,
> >
> >Bit of a newbie here. Im looking for some help on writting a Java driver for
> my
> >DRU-R100 DLink USB Radio. I have used USB Snoopy in order to capture the
> data
> >when I turn the radio on and turn it off but am having problems in
> recreating
> >those actions using the Java USB API.
> >
> >Im pretty sure that I have everything right up to the point of sending data
> to
> >the device. I am at the point where I have an open pipe and am now trying to
> >send a byte[] in the means of a syncSubmit call.
> >
> >USB Snoopy reports that there is 1 interface and 1 pipe, which seems to be a
> >direction in, transfer type interrupt. The very first thing that snoopy logs
> >when I run the radio application is shown below.
> >
> >What im unsure of is what information in the Snoopy output do I use to send
> this
> >(what I believe is) radio on command to the USB device? Do i use the
> SetupPacket
> >data in a byte[] and send that using syncSubmit or am I looking at it in the
> >wrong way?
> >
> >Any help would be great, thank you.
> >
> >
> >00000000 0.00000000 UsbSnoop - IRP_MJ_CREATE
> >
> >00000001 0.00002067 UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL,
> >IOCTL_INTERNAL_USB_SUBMIT_URB
> >
> >00000002 0.00002542
> >
> >00000003 0.00002626 >>>>>>> URB 4 going down...
> >
> >00000004 0.00003045 -- URB_FUNCTION_VENDOR_DEVICE:
> >
> >00000005 0.00003604 TransferFlags = 00000001
> >(USBD_TRANSFER_DIRECTION_IN, ~USBD_SHORT_TRANSFER_OK)
> >
> >00000006 0.00004051 TransferBufferLength = 00000008
> >
> >00000007 0.00004442 TransferBuffer = 81b87fb4
> >
> >00000008 0.00004749 TransferBufferMDL = 00000000
> >
> >00000009 0.00005168 UrbLink = 00000000
> >
> >00000010 0.00005476 RequestTypeReservedBits = 00
> >
> >00000011 0.00005783 Request = 00
> >
> >00000012 0.00006090 Value = 00fc
> >
> >00000013 0.00006425 Index = 0012
> >
> >00000014 0.00456455
> >
> >00000015 0.00456538 <<<<<<< URB 4 coming back...
> >
> >00000016 0.00457069 -- URB_FUNCTION_CONTROL_TRANSFER:
> >
> >00000017 0.00457516 PipeHandle = 81ae0154
> >
> >00000018 0.00458047 TransferFlags = 00000003
> >(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)
> >
> >00000019 0.00458438 TransferBufferLength = 00000001
> >
> >00000020 0.00458829 TransferBuffer = 81b87fb4
> >
> >00000021 0.00459220 TransferBufferMDL = 81b4d328
> >
> >00000022 0.00459500
> >
> >00000023 0.00459835 0000: ff
> >
> >00000024 0.00460114 UrbLink = 00000000
> >
> >00000025 0.00461679 SetupPacket : c0 00 fc 00 12 00 08 00
> >
> >00000026 0.00462908 UsbSnoop - IRP_MJ_CLOSE
> >
> >
> >
> >
> >
> >-------------------------------------------------------
> >The SF.Net email is sponsored by: Beat the post-holiday blues
> >Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> >It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> >_______________________________________________
> >javax-usb-devel mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/javax-usb-devel
> >
>
> --
> Dan Streetman
> [EMAIL PROTECTED]
> ---------------------
> 186,272 miles per second:
> It isn't just a good idea, it's the law!
>
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
javax-usb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/javax-usb-devel