On Wed, May 10, 2000 at 09:39:27PM +0200, wrobell wrote:
> 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?
Try Randy's suggestion, but also, make sure that buff is not on the stack,
but created by kmalloc.
(tiny hint that's burned me in the past.)
As a side note, who makes this cash drawer?
greg k-h
greg@(kroah|wirex).com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]