Zebra RW420のプリンタステータスをAndroidでBluetooth経由で取得できません(スマートフォンとプリンタは既にペア設定済みであり、必要な権限はすべてマニフェストファイルにあります)。私は、私は次の例外を取得するAPI 19 のためにプログラミングしています:Zebra RW420不正なステータス応答
com.zebra.sdk.comm.ConnectionException: Malformed status response - unable to determine printer status
私がしようとすると、以下のようにステータスが取得私のコード:
Connection printer_connection = new BluetoothConnection(printer_address);
printer_connection.open();
if (printer_connection.isConnected())
{
ZebraPrinter printer = ZebraPrinterFactory.getInstance(PrinterLanguage.ZPL, printer_connection);
ZebraPrinterLinkOs linkos_printer = ZebraPrinterFactory.createLinkOsPrinter(printer);
PrinterStatus printer_status = (linkos_printer != null) ? linkos_printer.getCurrentStatus() : printer.getCurrentStatus();//new PrinterStatusZpl(printer_connection);
if (printer_status.isReadyToPrint)
{
// Send print commends
printer_connection.close();
}
....
}
ZebraPrinterLinkOs linkos_printer = ZebraPrinterFactory.createLinkOsPrinter(printer);
PrinterStatus printer_status = (linkos_printer != null) ? linkos_printer.getCurrentStatus() : printer.getCurrentStatus();//new PrinterStatusZpl(printer_connection);
一部を私がZebraのサンプルコードから得たものです。
PrinterStatusに関連するコード行を削除すると、AndroidスマートフォンからRW420プリンタに印刷コマンドを送信でき、ラベル/ qrコードが問題なく印刷されます。
プリンタに問題があるときにダイアログボックスを表示する必要があるため、プリンタのステータスを取得する必要があります。の-用紙切れなど
UPDATE: 私はまた戻って送信されたデータにつながるんプリンタではなく、このようなプリンタで何の紙を持っていないか、残してテストして〜HSコマンドを送信しようとしていますヘッドは、戻ってくるデータを開くことは問題があることを示すものではありません。
'linkos_printer'インスタンスをコメントし、' printer.getcurrentStatus'を直接呼び出すとどうなりますか? –
まったく同じ結果です。最初は 'printer.getCurrentStatus'だけで試してみました。 RW420はLinkOsPrinterではないため、linkos_printerはnullです。 Zebraツールの1つを使用してステータス用にプリンタを設定する必要があるかどうかは疑問です。 – solarrobor
問題を解決できる場所はどこですか? – PLOW