Re: Castle USB API: Interrupt endpoints
- From: dan@xxxxxxxxxxxxxxxxxxxxxxx
- Date: Mon, 24 Oct 2005 22:53:08 GMT
In message <e8980cbf4d.davehigton@xxxxxxxxxxxxx>
Dave Higton <davehigton@xxxxxxxxxxxxx> wrote:
> In message <e7436cbd4d.davehigton@xxxxxxxxxxxxx>
> Dave Higton <davehigton@xxxxxxxxxxxxx> wrote:
>
> > Under the Castle USB API, how does one send bytes to an interrupt
> > endpoint?
> >
> > The output stream to the endpoint opens fine; I get a handle, and I can
> > find the buffer handle and interrogate the buffer. I can't send bytes
> > by BPUT# as there is an immediate error. I can put bytes into the
> > buffer by OS_Byte 138, and I can see bit 0 of the buffer's flags go
> > from 0 to 1; but the buffer never empties, and no bytes are sent to
> > the device.
> >
> > I haven't found any code examples for interrupt endpoints anywhere,
> > and there is no help whatsoever in Castle's API document.
>
> Is there any example code out there for transferring bytes to/from
> interrupt endpoints from an application? Surely I don't have to
> write a module to do it?
Reading is no problem - you appear to have experienced trouble writing,
which hasn't been tested as thoroughly.
This code works well for reading from a mouse (run from in a taskwindow):
10 : f%=0
20 : ON ERROR PROCerror
30 : f%=OPENIN"usb10#sleep;interrupt:"
40 : DIM buf% 8
50 : WHILE1
60 : SYS"OS_GBPB", 4, f%, buf%, 4
70 : PRINTbuf%?0;" ";buf%?1;" ";buf%?2;" ";buf%?3
80 : ENDWHILE
90 :
100 : DEFPROCerror
110 : IF f% <> 0 THEN CLOSE#f%
120 : ERROR EXT ERR, REPORT$+" at line "+STR$ERL
130 : END
140 : ENDPROC
--
Dan Ellis
.
- Follow-Ups:
- Re: Castle USB API: Interrupt endpoints
- From: davehigton
- Re: Castle USB API: Interrupt endpoints
- References:
- Castle USB API: Interrupt endpoints
- From: Dave Higton
- Re: Castle USB API: Interrupt endpoints
- From: Dave Higton
- Castle USB API: Interrupt endpoints
- Prev by Date: Re: Makefile generator
- Next by Date: Re: Castle USB API: Interrupt endpoints
- Previous by thread: Re: Castle USB API: Interrupt endpoints
- Next by thread: Re: Castle USB API: Interrupt endpoints
- Index(es):
Relevant Pages
|