(see below)
> I have usb cash drawer. I can get status of the
> device with usb_get_report function. It works fine.
>
> In docs of the device I can read:
> -------
> ... to open a cash drawer till, your application must send
> a pulse of a minimum duration to the cash drawer ... the pulse time
> is 80 milliseconds.
> -------
>
> The question is how to open the cash drawer till with
> linux usb interface? I tried with code:
> -----
> purb=usb_alloc_urb(0);
> buff[0]='1';
> buff[1]='0';
> buff[2]='1';
> buff[3]='O';
> FILL_INT_URB(purb, drawer_data.dev,
> usb_sndintpipe(drawer_data.dev, 0),
> buff, 4, drawer_complete, &drawer_data, 32*HZ);
> usb_submit_urb(purb);
> usb_free_urb(purb);
> -----
>
> but I get -EINVAL (-22) from usb_submit_urb function. Why?
a. usb_sndintpipe(dev, 0) says you want to send to an interrupt
pipe on endpoint 0, but endpoint 0 is a control endpoint/pipe.
Of course, your descriptor dump doesn't show an Interrupt
endpoint on the device at all, so maybe you want to use
usb_sndctrlpipe(dev, 0) instead. ???
b. last parameter of FILL_INT_URB() is interrupt period or
interval, which must be between 0 and 255 inclusive.
Fix these first. I still don't know if that will give
you the required pulse though.
~Randy
> This is output from usbview utility:
> ---------------
> Speed: 12Mb/s
> USB Version: 1.10
> Device Class: 00(>ifc )
> Device Subclass: 00
> Device Protocol: 00
> Maximum Default Endpoint Size: 16
> Number of Configurations: 1
> Vendor Id: 04b3
> Product Id: 4554
> Revision Number: 1.06
>
> Config Number: 1
> Number of Interfaces: 2
> Attributes: c0
> MaxPower Needed: 2mA
>
> Interface Number: 0
> Name: sp750_cash_drawer
> Alternate Number: 0
> Class: 03(HID )
> Sub Class: 0
> Protocol: 0
> Number of Endpoints: 1
>
> Endpoint Address: 81
> Direction: in
> Attribute: 3
> Type: Int.
> Max Packet Size: 8
> Interval: 32ms
>
> Interface Number: 2
> Name: sp750_cash_drawer
> Alternate Number: 0
> Class: 03(HID )
> Sub Class: 0
> Protocol: 0
> Number of Endpoints: 1
>
> Endpoint Address: 83
> Direction: in
> Attribute: 3
> Type: Int.
> Max Packet Size: 8
> Interval: 16ms
> ---------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]