From 6d064f074c71a45115bf4b50a701e06e133154e9 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 29 Jan 2013 17:51:43 -0500 Subject: [PATCH] [selphy] Fix detection of CP-10 vs CP-XXX jobs. --- selphy_print.c | 8 ++++---- selphy_print_common.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/selphy_print.c b/selphy_print.c index 57595cb..9915002 100644 --- a/selphy_print.c +++ b/selphy_print.c @@ -105,8 +105,11 @@ static int parse_printjob(uint8_t *buffer, int *bw_mode, int *plane_len) if (buffer[12] == 0x40 && buffer[13] == 0x01) { + *plane_len = *(uint32_t*)(&buffer[16]); + *plane_len = le32_to_cpu(*plane_len); + if (buffer[2] == 0x00) { - if (buffer[6] == 0x00) + if (*plane_len == 688480) printer_type = P_CP10; else printer_type = P_CP_XXX; @@ -114,9 +117,6 @@ static int parse_printjob(uint8_t *buffer, int *bw_mode, int *plane_len) printer_type = P_ES1; *bw_mode = (buffer[2] == 0x20); } - - *plane_len = *(uint32_t*)(&buffer[16]); - *plane_len = le32_to_cpu(*plane_len); goto done; } diff --git a/selphy_print_common.h b/selphy_print_common.h index 78b7d63..628ce6d 100644 --- a/selphy_print_common.h +++ b/selphy_print_common.h @@ -25,7 +25,7 @@ * */ -#define VERSION "0.42" +#define VERSION "0.43" #define DEBUG( ... ) fprintf(stderr, "DEBUG: " __VA_ARGS__ ) #define ERROR( ... ) fprintf(stderr, "ERROR: " __VA_ARGS__ )