1
0
mirror of https://git.familie-radermacher.ch/linux/ptouch-print.git synced 2025-11-20 20:32:05 +00:00

fix support for printers that use packbits transfer mode, like PT-D450PV

This commit is contained in:
Dominic Radermacher
2019-03-17 11:36:04 +01:00
parent 1c552a3d11
commit 213a70eee0
8 changed files with 130 additions and 8440 deletions

View File

@@ -1,7 +1,7 @@
/*
ptouch-print - Print labels with images or text on a Brother P-Touch
Copyright (C) 2015-2017 Dominic Radermacher <blip@mockmoon-cybernetics.ch>
Copyright (C) 2015-2019 Dominic Radermacher <blip@mockmoon-cybernetics.ch>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 3 as
@@ -25,8 +25,10 @@ struct _pt_tape_info {
uint8_t px; /* Printing area in px */
};
#define FLAG_NONE 0
#define FLAG_UNSUP_RASTER 1
#define FLAG_NONE (0x00)
#define FLAG_UNSUP_RASTER (0x01)
#define FLAG_RASTER_PACKBITS (0x02)
struct _pt_dev_info {
int vid; /* USB vendor ID */
int pid; /* USB product ID */
@@ -36,14 +38,40 @@ struct _pt_dev_info {
};
typedef struct _pt_dev_info *pt_dev_info;
struct __attribute__((packed, aligned(4))) _ptouch_stat {
uint8_t printheadmark; // 0x80
uint8_t size; // 0x20
uint8_t brother_code; // "B"
uint8_t series_code; // "0"
uint8_t model;
uint8_t country; // "0"
uint16_t reserved_1;
uint16_t error; // table 1 and 2
uint8_t media_width; // tape width in mm
uint8_t media_type; // table 4
uint8_t ncol; // 0
uint8_t fonts; // 0
uint8_t jp_fonts; // 0
uint8_t mode;
uint8_t density; // 0
uint8_t media_len; // table length, always 0
uint8_t status_type; // table 5
uint8_t phase_type;
uint16_t phase_number; // table 6
uint8_t notif_number;
uint8_t exp; // 0
uint8_t tape_color; // table 8
uint8_t text_color; // table 9
uint32_t hw_setting;
uint16_t reserved_2;
};
typedef struct _ptouch_stat *pt_dev_stat;
struct _ptouch_dev {
libusb_device_handle *h;
uint8_t raw[32];
uint8_t tape_width_mm;
uint8_t tape_width_px;
uint8_t status;
uint8_t media_type;
pt_dev_info devinfo;
pt_dev_stat status;
uint8_t tape_width_px;
};
typedef struct _ptouch_dev *ptouch_dev;
@@ -57,5 +85,6 @@ int ptouch_cutmark(ptouch_dev ptdev);
int ptouch_eject(ptouch_dev ptdev);
int ptouch_getstatus(ptouch_dev ptdev);
int ptouch_getmaxwidth(ptouch_dev ptdev);
int ptouch_enable_packbits(ptouch_dev ptdev);
int ptouch_rasterstart(ptouch_dev ptdev);
int ptouch_sendraster(ptouch_dev ptdev, uint8_t *data, int len);