dnp_ds40: Fix counter_clear and set_counter_p commands (I hope)

This commit is contained in:
Solomon Peachy 2013-12-13 15:43:30 -05:00
parent e8514eb5cf
commit d2cac28e3a
2 changed files with 11 additions and 7 deletions

8
README
View File

@ -26,7 +26,7 @@
Mitsubishi CP-D70x series
Shinko/Sinfonia CHC-S2145 (aka "S2")
Sony UP-DR150
DNP DS40/DS80
DNP DS40/DS80
***************************************************************************
Compilation:
@ -280,6 +280,8 @@
***************************************************************************
BACKEND=mitsu70x
NOTE: This backend is not yet present in mainline Gutenprint
Theoretically supported printers: (Untested)
Mitsubishi CP-D70DW
@ -300,13 +302,15 @@
***************************************************************************
BACKEND=dnpds40
NOTE: This backend is not yet present in mainline Gutenprint
Supported printers:
DNP DS40
DNP DS80
NOTE: This backend has **NOT** been tested with spooling operation, but
is known to work with various status/etc commands.
is known to work for the various status/etc commands.
This backend supports additional commands:

View File

@ -663,13 +663,13 @@ static int dnpds40_clear_counter(struct dnpds40_ctx *ctx, char counter)
int ret;
/* Generate command */
dnpds40_build_cmd(&cmd, "MNT_WT", "COUNTER_CLR", 0);
dnpds40_build_cmd(&cmd, "MNT_WT", "COUNTER_CLR", 4);
msg[0] = 'C';
msg[1] = counter;
msg[2] = 0x0d;
msg[3] = 0x00;
if ((ret = dnpds40_do_cmd(ctx, &cmd, (uint8_t*)msg, sizeof(msg))))
if ((ret = dnpds40_do_cmd(ctx, &cmd, (uint8_t*)msg, 4)))
return ret;
return 0;
@ -683,8 +683,8 @@ static int dnpds40_set_counter_p(struct dnpds40_ctx *ctx, char *arg)
int ret;
/* Generate command */
dnpds40_build_cmd(&cmd, "MNT_WT", "COUNTERP_SET", 0);
snprintf(msg, 9, "%08d", i);
dnpds40_build_cmd(&cmd, "MNT_WT", "COUNTERP_SET", 8);
snprintf(msg, sizeof(msg), "%08d", i);
if ((ret = dnpds40_do_cmd(ctx, &cmd, (uint8_t*)msg, 8)))
return ret;
@ -733,7 +733,7 @@ static int dnpds40_cmdline_arg(void *vctx, int run, char *arg1, char *arg2)
/* Exported */
struct dyesub_backend dnpds40_backend = {
.name = "DNP DS40/DS80",
.version = "0.12",
.version = "0.13",
.uri_prefix = "dnpds40",
.cmdline_usage = dnpds40_cmdline,
.cmdline_arg = dnpds40_cmdline_arg,