summaryrefslogtreecommitdiffstats
path: root/backend_shinkos1245.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2018-05-12 21:51:59 -0400
committerSolomon Peachy <pizza@shaftnet.org>2018-05-12 21:51:59 -0400
commit5e63324f43a3933d0dd485fdec96ac2bc606b90f (patch)
treebd883fa5048495d12dd1448306eabbb904f96973 /backend_shinkos1245.c
parentb881aef983494aaaba2c322e24e0dfa2c8744f51 (diff)
downloadselphy_print-5e63324f43a3933d0dd485fdec96ac2bc606b90f.tar.gz
selphy_print-5e63324f43a3933d0dd485fdec96ac2bc606b90f.tar.bz2
selphy_print-5e63324f43a3933d0dd485fdec96ac2bc606b90f.zip
shinko: support TEST_MODE_NOATTACH
Diffstat (limited to 'backend_shinkos1245.c')
-rw-r--r--backend_shinkos1245.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/backend_shinkos1245.c b/backend_shinkos1245.c
index 35be1e5..5fbd9e0 100644
--- a/backend_shinkos1245.c
+++ b/backend_shinkos1245.c
@@ -1291,14 +1291,18 @@ static int shinkos1245_attach(void *vctx, struct libusb_device_handle *dev, int
if (!ctx->jobid)
ctx->jobid++;
- /* Query Media */
- if (shinkos1245_get_media(ctx))
- return CUPS_BACKEND_FAILED;
- if (!ctx->num_medias) {
- ERROR("Media Query Error\n");
- return CUPS_BACKEND_FAILED;
+ if (test_mode < TEST_MODE_NOATTACH) {
+ /* Query Media */
+ if (shinkos1245_get_media(ctx))
+ return CUPS_BACKEND_FAILED;
+ if (!ctx->num_medias) {
+ ERROR("Media Query Error\n");
+ return CUPS_BACKEND_FAILED;
+ }
+ } else {
+ ctx->media_8x12 = 1;
+ ctx->num_medias = 0;
}
-
ctx->marker.color = "#00FFFF#FF00FF#FFFF00";
ctx->marker.name = ctx->media_8x12 ? "8x12" : "8x10";
ctx->marker.levelmax = ctx->media_8x12 ? 230 : 280;