feat:增加小票打印机接口以及获取状态接口

This commit is contained in:
2025-03-17 10:28:17 +08:00
parent d3d908a407
commit 46097c0825
11 changed files with 173 additions and 38 deletions

View File

@@ -515,7 +515,7 @@ public class TestFunction {
TestUtils.showMessageOnUiThread("Write failed");
}
void Test_Port_Read(Pointer h) {
public void Test_Port_Read(Pointer h) {
// send this cmd to query printer status
byte cmd[] = {0x10, 0x04, 0x01};
AutoReplyPrint.INSTANCE.CP_Port_SkipAvailable(h);
@@ -562,7 +562,7 @@ public class TestFunction {
TestUtils.showMessageOnUiThread("valid " + valid);
}
void Test_Printer_GetPrinterInfo(Pointer h) {
public void Test_Printer_GetPrinterInfo(Pointer h) {
String firmware_version = AutoReplyPrint.CP_Printer_GetPrinterFirmwareVersion_Helper.GetPrinterFirmwareVersion(h) + "\r\n";
IntByReference width_mm = new IntByReference();
IntByReference height_mm = new IntByReference();
@@ -587,6 +587,7 @@ public class TestFunction {
String str_printer_info_status = simpleDateFormat.format(dt_printer_status) + String.format(" Printer Info Status: 0x%04X\r\n", printer_info_status.getValue() & 0xffff);
String str_printer_received = simpleDateFormat.format(dt_printer_received) + String.format(" Printer Received Byte Count: %d\r\n", printer_received_byte_count.getValue());
String str_printer_printed = simpleDateFormat.format(dt_printer_printed) + String.format(" Printer Printed Page ID: %d\r\n", printer_printed_page_id.getValue());
TestUtils.showMessageOnUiThread(firmware_version + str_printer_resolution + str_printer_error_status + str_printer_info_status + str_printer_received + str_printer_printed);
}
}