hpcups send 10000 bytes of garbage (0x00) to the printer

Asked by Benjamin Woods

This question relates to a bug posted to the FreeBSD bug tracker by Matthias Apitz:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207738

While hunting some other problem with a HP Deskjet 2510 printer, I discovered that prnt/hpcups/Encapsulator.cpp send 10000 bytes of 0x00 to the printer before the real PCL commands.

Is this required / necessary?

prnt/hpcups/CommonDefinitions.h:

#define PCL_BUFFER_SIZE 10000

prnt/hpcups/Encapsulator.cpp:

    cur_pcl_buffer_size = PCL_BUFFER_SIZE;
    pcl_buffer = new BYTE[cur_pcl_buffer_size + 2];
    if (pcl_buffer == NULL) {
        return ALLOCMEM_ERROR;
    }
    memset(pcl_buffer, 0, cur_pcl_buffer_size);
    cur_pcl_buffer_ptr = pcl_buffer;

    err = flushPrinterBuffer();

prnt/hpcups/Encapsulator.h:

    virtual DRIVER_ERROR flushPrinterBuffer()
    {
        return m_pSystemServices->Send((const BYTE *) pcl_buffer, 10000);
    }

$ od -c printer24674.prn | head -5
0000000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0023420 033 E 033 % - 1 2 3 4 5 X @ P J L
0023440 S E T S T R I N G C O D E S E
0023460 T = U T F 8 \n @ P J L C O M M
...

Question information

Language:
English Edit question
Status:
Expired
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Matthias Apitz (gubu) said :
#2

Which question is expired?

Revision history for this message
Benjamin Woods (woodsb02-gmail) said :
#3

Can we please re-open this question, and hopefully get an answer as to why hplip behaves in this way?

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Benjamin Woods (woodsb02-gmail) said :
#5

I have raised this as bug #1648954