Re: usb_control_msg works in linux but not windows

Rob Willard <[email protected]>
Newsgroups gmane.comp.lib.libusb.devel.windows
Message-ID <[email protected]>
Thanks for the responses!

I have read up more, and still have the same type of issues. I have 
revisited my request type:

     usb_control_msg(handle, USB_RECIP_INTERFACE | USB_ENDPOINT_IN, 1, 
0, 0, buff, 64, 10);

however still recieve errors in Windows (**this works fine under linux 
using usb.h). Should return a string, but am getting:

     libusb0-dll:err [control_msg] sending control message failed, win 
error: A device attached to the system is not functioning.

I did as Xiaofan suggested and loaded the debug version. The output is 
attached.

Any further direction would be most appreciated...

Rob


On 14-02-19 07:52 PM, Xiaofan Chen wrote:
> On Thu, Feb 20, 2014 at 9:39 AM, Travis <[email protected]> wrote:
>> Greetings,
>>
>> You are trying to use a "standard" usb request for what should be a
>> vendor request type. IE: the 0x01 in the 2nd param.
>>
>> For the 2nd param (request type) you need to use something like the
>> following to perform an action like that:
>> requesttype = USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN
>> or
>> requesttype = USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT
>>
>> if you specify USB_ENDPOINT_IN then you are saying you want the "bytes"
>> portion to be returned from the device (DEVICE TO HOST)
>> if you specify USB_ENDPOINT_OUT then you are saying you want the "bytes"
>> portion to be sent to the device (HOST TO DEVICE)
>>
> Good analysis.
>
> To the OP, if you are new to USB, you may want to go
> through the following short introduction to USB.
> http://www.usbmadesimple.co.uk/index.html
>
> In particular, the following section talks about some of
> the terminology used in the above.
> http://www.usbmadesimple.co.uk/ums_4.htm
>
> A bit more in detail
> http://msdn.microsoft.com/en-us/library/windows/hardware/ff539261(v=vs.85).aspx
>
> If you want to read more,then the USB 2.0 spec is the best.
>

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk

_______________________________________________
Libusb-win32-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
libusb_test_dgb.LOG (text/x-log, 3.8 KB)
00000001	0.00000000	libusb0-sys:[DriverEntry] [loading-driver] v1.2.6.0	
00000002	0.00045313	libusb0-sys:[add_device] device #1 created for usb\vid_1992&pid_1000&rev_0001	
00000003	0.00053778	libusb0-sys:[reg_get_properties] using default device interface guid.	
00000004	0.00057857	libusb0-sys:dbg [reg_get_properties] reg-key-name=\REGISTRY\MACHINE\SYSTEM\ControlSet001\Enum\USB\Vid_1992&Pid_1000\ECG_SOUND_0001\Device Parameters	
00000005	0.00105628	libusb0-sys:[set_filter_interface_key] updated interface registry with LUsb0 direct-access symbolic link. id=1	
00000006	0.00113841	libusb0-sys:[add_device] updated interface registry with LUsb0 direct-access symbolic link. id=0001	
00000007	0.00117250	libusb0-sys:dbg [add_device] [normal-mode] id=#1 usb\vid_1992&pid_1000&rev_0001	
00000008	0.00120267	libusb0-sys:[add_device] complete status=00000000	
00000009	0.00123116	libusb0-sys:[dispatch_pnp] IRP_MN_START_DEVICE: is-filter=N usb\vid_1992&pid_1000&rev_0001	
00000010	0.00154964	libusb0-sys:dbg [on_start_complete] is-filter=N usb\vid_1992&pid_1000&rev_0001	
00000011	0.00173430	libusb0-sys:dbg [on_start_complete] applying active configuration for usb\vid_1992&pid_1000&rev_0001	
00000012	0.00176670	libusb0-sys:[set_configuration] setting configuration index 0 timeout=5000	
00000013	0.00180135	libusb0-sys:[get_descriptor] buffer size: 18 type: 0001 recipient: 0000 index: 0000 language id: 0000 timeout: 5000	
00000014	0.00672767	libusb0-sys:dbg [call_usbd_ex] status = 00000000h	
00000015	0.00676483	libusb0-sys:[get_descriptor] buffer size: 9 type: 0002 recipient: 0000 index: 0000 language id: 0000 timeout: 5000	
00000016	0.01166293	libusb0-sys:dbg [call_usbd_ex] status = 00000000h	
00000017	0.01168473	libusb0-sys:[get_descriptor] buffer size: 32 type: 0002 recipient: 0000 index: 0000 language id: 0000 timeout: 5000	
00000018	0.01478037	libusb0-sys:dbg [call_usbd_ex] status = 00000000h	
00000019	0.01481026	libusb0-sys:[set_configuration] found interface 0	
00000020	0.01483708	libusb0-sys:dbg [set_configuration] #1 usb\vid_1992&pid_1000&rev_0001 passing configuration request to target-device.	
00000021	0.05139648	libusb0-sys:dbg [call_usbd_ex] status = 00000000h	
00000022	0.05143391	libusb0-sys:[update_pipe_info] interface 0	
00000023	0.05145570	libusb0-sys:[update_pipe_info] EP81h maximum-packet-size=64 maximum-transfer-size=65536	
00000024	0.05147609	libusb0-sys:[update_pipe_info] EP02h maximum-packet-size=64 maximum-transfer-size=65536	
00000025	0.05169093	libusb0-sys:dbg [dispatch_pnp] IRP_MN_QUERY_CAPABILITIES: is-filter=N usb\vid_1992&pid_1000&rev_0001	
00000026	3.51464367	libusb0-sys:[release_all_interfaces] releasing all interfaces bound to file object 0x8a5cf190	
00000027	3.51471114	libusb0-sys:[get_descriptor] buffer size: 18 type: 0001 recipient: 0000 index: 0000 language id: 0000 timeout: 5000	
00000028	3.51475286	libusb0-sys:[release_all_interfaces] releasing all interfaces bound to file object 0x8a5cf190	
00000029	3.51857924	libusb0-sys:[get_descriptor] buffer size: 9 type: 0002 recipient: 0000 index: 0000 language id: 0000 timeout: 1000	
00000030	3.51863122	libusb0-sys:[get_descriptor] buffer size: 32 type: 0002 recipient: 0000 index: 0000 language id: 0000 timeout: 1000	
00000031	3.51867962	libusb0-sys:[release_all_interfaces] releasing all interfaces bound to file object 0x8a5cf190	
00000032	3.51874471	libusb0-sys:[release_all_interfaces] releasing all interfaces bound to file object 0x8a5cf190	
00000033	3.51880264	libusb0-sys:[claim_interface] interface 0	
00000034	8.28595066	libusb0-sys:[clear_feature] recipient: 01 index: 0000 feature: 0000 timeout: 10	
00000035	8.28889370	libusb0-sys:dbg [call_usbd_ex] status = C0000001h	
00000036	8.28893089	libusb0-sys:err [clear_feature] clearing feature failed: status: 0xc0000001, urb-status: 0xc0000004	
00000037	10.48692703	libusb0-sys:[release_all_interfaces] releasing all interfaces bound to file object 0x8a5cf190
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.