CAPS Universe documentation
1.0.4
All you need to know to be successful
|
Functions to setup the required I/O to the USB printer device. More...
Macros | |
#define | PRINTER_STREAM_BUFFER_DEFAULT_SIZE 128 |
#define | PRINTER_STREAM_BUFFER_MAX_SIZE 8192 |
Functions | |
static size_t | _caps_drv_buffer_size_read (struct caps_drv *cdrv) |
int | caps_drv_global_stream_io (struct caps_drv *cdrv) |
#define PRINTER_STREAM_BUFFER_DEFAULT_SIZE 128 |
The default local printer data buffer size in kiB
Used to send large pieces of print data instead of many small pieces due to data processing.
#define PRINTER_STREAM_BUFFER_MAX_SIZE 8192 |
The max size of the local printer data buffer in kiB
|
static |
Extract the printing data buffer size from the INI setting
[in,out] | cdrv | Full state information |
size | Buffer size in bytes (can be '0') |
This function deals with the setting described in Feature: printing data buffer_size
Returns PRINTER_STREAM_BUFFER_DEFAULT_SIZE kiB if no setting exists or in case the setting is invalid.
If the settings exceeds PRINTER_STREAM_BUFFER_MAX_SIZE, it is limited to this value.
int caps_drv_global_stream_io | ( | struct caps_drv * | cdrv | ) |
Convert the file descriptor to the printer into stream IO and configure it
[in,out] | cdrv | Full state information |
0 | On success |
negative | The error codes fdopen() (file descriptor to stream IO) may returns |
This functions sets up a stream IO from the given filedescriptor to be used by the printer driver. The filedescriptor is kept to be used later on to query the printer's status.
Some printers are in trouble (or time out) if there are pauses in the printing data between some kind of header data and the following printing data. These pauses can occur due to data processing, at least on slow host systems.
That's why increase the stream IO buffer size is a good idea to have most data already processed, before the printer will "see" the data. The user can control the used buffer size via the corresponding INI file in section interface, variable buffer_size. It is possible to disable a buffer at all. Refer Feature: printing data buffer_size for details.