Using Streams: 3.2 Using the Parallel Ports: Communicating

Up: GEOS SDK TechDocs | Up | Prev: 3.1 Initializing a Parallel Port | Next: 3.3 Closing a Parallel Port
ParallelWrite(), ParallelWriteByte()

Writing to a parallel port is much like writing to any other stream. To write data, call ParallelWrite() or ParallelWriteByte() . These routines take the same arguments as their Stream...() components, except that each one must be passed the handle of the Parallel Driver, not the Stream Driver, and each routine is passed the ParallelUnit for the appropriate port, instead of being passed a stream token. These routines behave exactly like their Stream...() counterparts.

To send an error to the other side of a serial connection, call ParallelSetError() . (This routine is generally not called by applications.) This routine behaves much like StreamSetError() . It is passed four arguments:

PE_FATAL
Set if the driver encountered an error that means it can't continue.
PE_TIMEOUT
Set if there is no response from the printer, but no other (non-masked) error is present.
PE_NOPAPER
Set if the device is out of paper.
PE_OFFLINE
Set if the device is off-line.
PE_ERROR
Indicates a general error.

To read an error condition passed by the other side of a serial connection, call ParallelGetError() . This routine behaves much like StreamGetError() . The error code returned will be a member of the ParallelError enumerated type.


Up: GEOS SDK TechDocs | Up | Prev: 3.1 Initializing a Parallel Port | Next: 3.3 Closing a Parallel Port