SDK malformed status reponse error

// Expert user has replied.
M Mike Donnan 1 month 1 week ago
32 1 0

Hello Forum people

Has anyone experienced the "malformed response" error from printer status checking as per the code below..?

ZebraPrinter printer = ZebraPrinterFactory.getLinkOsPrinter(connection);

PrinterStatus printerStatus = printer.getCurrentStatus();

I have seen multiple hits on this on the forum ....  but no resolution.

Anyone got any insights..?

Thanks

 

Please Register or Login to post a reply

1 Replies

S Steven Si

What's the printer model on which the malformed error happens?

Most common cause of the malformed error is due to the mismatch of the setting of device.languages on the printer. By default, the ZebraPrinterFactory.getLinkOsPrinter(connection) returns an instance of a ZPL printer. If the device.languages setting on the printer is CPCL or line_print mode, however, calling the printer.getCurrentStatus() likely triggers the malformed error. To get around this, we can query the device.languages setting on the printer first via the SGD API. Then we obtain the proper instance of the printer through ZebraPrinterFactory.getLinkOsPrinter(language, connection) with the language type returned from the device.languages SGD.

CONTACT
Can’t find what you’re looking for?