From 4639f7c23d5b6a0afc56f00d636d5ff1e7fbc583 Mon Sep 17 00:00:00 2001 From: Dominic Radermacher Date: Thu, 23 May 2019 16:20:40 +0200 Subject: [PATCH] show user hint when PT-2430PC / PT-P700 are in P-Lite mode, show notice about unsupported raster mode --- include/ptouch.h | 1 + src/libptouch.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/ptouch.h b/include/ptouch.h index ad4e72d..ce3b499 100644 --- a/include/ptouch.h +++ b/include/ptouch.h @@ -28,6 +28,7 @@ struct _pt_tape_info { #define FLAG_NONE (0x00) #define FLAG_UNSUP_RASTER (0x01) #define FLAG_RASTER_PACKBITS (0x02) +#define FLAG_PLITE (0x04) struct _pt_dev_info { int vid; /* USB vendor ID */ diff --git a/src/libptouch.c b/src/libptouch.c index 3937b2d..5dbf320 100644 --- a/src/libptouch.c +++ b/src/libptouch.c @@ -47,10 +47,12 @@ struct _pt_dev_info ptdevs[] = { {0x04f9, 0x2007, "PT-2420PC", 128, FLAG_RASTER_PACKBITS}, /* 180dpi, 128px, maximum tape width 24mm, must send TIFF compressed pixel data */ {0x04f9, 0x202c, "PT-1230PC", 76, FLAG_NONE}, /* 180dpi, supports tapes up to 12mm - I don't know how much pixels it can print! */ {0x04f9, 0x202d, "PT-2430PC", 128, FLAG_NONE}, /* 180dpi, maximum 128px */ + {0x04f9, 0x2031, "PT-2430PC (PLite Mode)", 128, FLAG_PLITE}, {0x04f9, 0x2041, "PT-2730", 128, FLAG_NONE}, /* 180dpi, maximum 128px, max tape width 24mm - reported to work with some quirks */ /* Notes about the PT-2730: was reported to need 48px whitespace within png-images before content is actually printed - can not check this */ {0x04f9, 0x2061, "PT-P700", 120, FLAG_UNSUP_RASTER}, /* DOES NOT WORK */ + {0x04f9, 0x2064, "PT-P700 (PLite Mode)", 120, FLAG_PLITE}, {0x04f9, 0x2073, "PT-D450", 128, FLAG_RASTER_PACKBITS}, /* Notes about the PT-D450: I'm unsure if print width really is 128px */ {0,0,"",0,0} @@ -99,6 +101,16 @@ int ptouch_open(ptouch_dev *ptdev) ptdevs[k].name, libusb_get_bus_number(dev), libusb_get_device_address(dev)); + if (ptdevs[k].flags & FLAG_PLITE) { + printf("Printer is in P-Lite Mode, which is unsupported\n\n"); + printf("Turn off P-Lite mode by changing switch from position EL to position E\n"); + printf("or by pressing the PLite button for ~ 2 seconds (or consult the manual)\n"); + return -1; + } + if (ptdevs[k].flags & FLAG_UNSUP_RASTER) { + printf("Unfortunately, that printer currently is unsupported (it has a different raster data transfer)\n"); + return -1; + } if ((r=libusb_open(dev, &handle)) != 0) { fprintf(stderr, _("libusb_open error :%s\n"), libusb_error_name(r)); return -1;