User`s guide
3: Programming Using the DLITE Embedded Interface
DC 900-1516D 47
Note
As with the DLI interface, read requests with a NULL buffer
pointer result in DLITE allocating and returning a read buffer. The
address of the buffer allocated is returned in the supplied buffer
pointer upon return from the call. The user that wants a DLITE
allocated buffer should ensure the buffer pointer supplied with the
dlRead call is NULL.
dlTerm
Termination processing (dlTerm) releases resources and terminates DLITE. Any active
I/O active is cancelled when
dlTerm is called. Data buffers associated with the cancelled
I/O are deallocated if those buffers were allocated by DLITE (using
dlBufAlloc). OptArgs
buffers are not deallocated. The application should cancel all I/O before terminating.
Note
The user application must perform a dlTerm to release system
resources.
dlWrite
As with dlRead, dlWrite requires an associated OptArgs structure with the write request.
DLITE builds the ICP and Protocol headers, which preface every application buffer (see
dlBufAlloc), from information supplied in this OptArgs structure. Specifically, DLITE
does the following for Raw operation writes:
1.
ICP->usClientID = htons (OptArgs->usICPClientID);
2. ICP->usServerID = htons (OptArgs->usICPServerID);
3.
ICP->usCommand = htons (OptArgs->usICPCommand);
4. ICP->usParms[0-2] = htons (OptArgs->usICPParms[0-2]);