forked from agalakhov/captdriver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request agalakhov#9 from KP1533TM2/master
LBP-3000 finally seems to work
- Loading branch information
Showing
1 changed file
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
* Copyright (C) 2013 Alexey Galakhov <[email protected]> | ||
* Copyright (C) 2016 Alexei Gordeev <[email protected]> | ||
* | ||
* Licensed under the GNU General Public License Version 3 | ||
* | ||
|
@@ -121,6 +122,30 @@ static void lbp2900_job_prologue(struct printer_state_s *state) | |
lbp2900_wait_ready(state->ops); | ||
} | ||
|
||
static void lbp3000_job_prologue(struct printer_state_s *state) | ||
{ | ||
(void) state; | ||
capt_sendrecv(CAPT_IDENT, NULL, 0, NULL, 0); | ||
sleep(1); | ||
capt_init_status(); | ||
lbp2900_get_status(state->ops); | ||
|
||
capt_sendrecv(CAPT_START_0, NULL, 0, NULL, 0); | ||
capt_sendrecv(CAPT_JOB_BEGIN, magicbuf_0, ARRAY_SIZE(magicbuf_0), NULL, 0); | ||
/* LBP-3000 prints the very first printjob perfectly | ||
* and then proceeds to hang at this (commented out) | ||
* spot. That's the difference, or so it seems. */ | ||
/* lbp2900_wait_ready(state->ops); */ | ||
send_job_start(); | ||
|
||
/* There's also that command, that apparently does something, and does something, | ||
* but it's there in the Wireshark logs. Response data == command data. */ | ||
uint8_t dummy[2] = {0,0}; | ||
capt_sendrecv(0xE0A6, dummy, sizeof(dummy), NULL, 0); | ||
|
||
lbp2900_wait_ready(state->ops); | ||
} | ||
|
||
static bool lbp2900_page_prologue(struct printer_state_s *state, const struct page_dims_s *dims) | ||
{ | ||
const struct capt_status_s *status; | ||
|
@@ -298,8 +323,23 @@ static struct lbp2900_ops_s lbp2900_ops = { | |
.wait_ready = capt_wait_ready, | ||
}; | ||
|
||
static struct lbp2900_ops_s lbp3000_ops = { | ||
.ops = { | ||
.job_prologue = lbp3000_job_prologue, /* different job prologue */ | ||
.job_epilogue = lbp2900_job_epilogue, | ||
.page_setup = lbp2900_page_setup, | ||
.page_prologue = lbp2900_page_prologue, | ||
.page_epilogue = lbp2900_page_epilogue, | ||
.compress_band = ops_compress_band_hiscoa, | ||
.send_band = ops_send_band_hiscoa, | ||
.wait_user = lbp2900_wait_user, | ||
}, | ||
.get_status = capt_get_xstatus, | ||
.wait_ready = capt_wait_ready, | ||
}; | ||
|
||
register_printer("LBP2900", lbp2900_ops.ops, WORKS); | ||
register_printer("LBP3000", lbp2900_ops.ops, EXPERIMENTAL); | ||
register_printer("LBP3000", lbp3000_ops.ops, EXPERIMENTAL); | ||
|
||
static struct lbp2900_ops_s lbp3010_ops = { | ||
.ops = { | ||
|