DPI Driver
2-100
And in the function for the other task:
outStr = SIO_create("/pipe0", SIO_OUTPUT, bufsize, NULL);
...
SIO_put(outStr, bufp, nmadus);
or by adding with Tconf two streams that use pipe0, one in output mode
(outStream) and the other one in input mode(inStream). Then, from the
reader task call:
extern SIO_Obj inStream;
SIO_handle inStr = &inStream
...
SIO_get(inStr, bufp);
and from the writer task call:
extern SIO_Obj outStream;
SIO_handle outStr = &outStream
...
SIO_put(outStr, bufp, nmadus);
The DPI driver places no inherent restrictions on the size or memory
segments of the data buffers used when streaming to or from a pipe
device, other than the usual requirement that all buffers be the same size.
Tasks block within DPI when using SIO_get, SIO_put, or SIO_reclaim if
a buffer is not available. SIO_select can be used to guarantee that a call
to one of these functions do not block. SIO_select can be called
simultaneously by both the input and the output sides.
DPI and the
SIO_ISSUERECLAIM
Streaming Model
In the SIO_ISSUERECLAIM streaming model, an application reclaims
buffers from a stream in the same order as they were previously issued.
To preserve this mechanism of exchanging buffers with the stream, the
default implementation of the DPI driver for ISSUERECLAIM copies the
full buffers issued by the writer to the empty buffers issued by the reader.
A more efficient version of the driver that exchanges the buffers across
both sides of the stream, rather than copying them, is also provided. To
use this variant of the pipe driver for ISSUERECLAIM, edit the C source
file dpi.c provided in the C:\ti\c5000\bios\src\drivers folder. Comment out
the following line:
#define COPYBUFS
Rebuild dpi.c. Link your application with this version of dpi.obj instead of
the default one. To do this, add this version of dpi.obj to your project
explicitly. This buffer exchange alters the way in which the streaming